Roger92 / metric-ruler-labels

MIT License
5 stars 2 forks source link

[API] - return waypoints and distances #22

Closed rinnocenti closed 1 year ago

rinnocenti commented 1 year ago

I have a travel pace module (https://github.com/rinnocenti/travel-pace), and I wanted to improve it with your module. Can you create an API in your module returning an array/hash with each measured waypoint?

because I want to make the thing more automatic, today it's just a calculator.

Roger92 commented 1 year ago

So you want an array with values from the currently active ruler?

So this: image

Would return something like:

`[ {foundry: "10 miles",customConversion:"16.09 km",travelTimes: "0.50 | 0.50 | 0.25 Days"},

{foundry: "10 miles [20 miles]",customConversion:"16.09 km [32.19 km]",travelTimes: "0.50 | 0.50 | 0.25 Days"}
]`

Or what do you mean?

rinnocenti commented 1 year ago

less complicated than that. something like in hook of end measurement: apiGetRule() =>[ { feet:0, miles:10, meters: 0, km:16.9}, { feet:0, miles:10, meters: 0, km:16.9} ]

the ideal would be that instead of days, the return is in hours, so the speed is slow or fast (so you can have a separate configuration to do these maths, including being agnostic with other systems). Alias doesn't even need to return the time, because the system can calculate according to the speed variant.

The totality and quantities are left for another function or system setting to do the sums.

Roger92 commented 1 year ago

hmmm so for the case that people are using ft/miles and then the metric conversion 🤔

Roger92 commented 1 year ago

try the following on 3.1.0 ... i put in a quick api:

image

Roger92 commented 1 year ago

The current requirement is that the user is using one of the following measurements in the scene:

rinnocenti commented 1 year ago

I'm taking the tests this weekend. But I believe it will work. I'll just need to think of a way to gather the information from difficult terrain. but this information will help a lot, thank you