OpenGIS / Waymark

Waymark adds powerful mapping features to WordPress that are easy to use. Create beautiful, interactive Maps that you can customise to suit your needs.
https://www.waymark.dev
GNU General Public License v2.0
20 stars 6 forks source link

Ascent and descent values too high #31

Open micrtoeq opened 5 months ago

micrtoeq commented 5 months ago

Hi

Ascent and descent values are too high, because they are calculated every 1 to 4 meters. They should be calculated in bigger walking distances. My suggestion is 10 meters.

I have adjusted the source code, which is pasted at the end of this message. Only what I have marked with DGF are changes made by me, the rest is the original. There are two functions in leaflet-elevation.js that are affected: _addData and _addPoint.

Best regards. Daniel.


/*


/*

morehawes commented 5 months ago

@micrtoeq,

DGF are changes made by me, the rest is the original

Appreciated. I will look in to this.

Joe

morehawes commented 5 months ago

Originally discussed here. My thoughts:

I’m not sure what the best way to deal with this will be honestly. The ascent/descent values in question were added in a recent Pull Request and were pulled over from the Leaflet Elevation plugin that Waymark uses… but is not using the most recent version (I believe because of some conflicts I was not able to resolve a long time ago… but can’t quite remember).

So this is quite messy already and any other edits may compound the problem. I agree though that these values should be accurate and that user control over the measurement “frequency” (there is probably a more accurate term) would be a good solution.

Introduced in PR by @MaximeChallon.

Input/help welcome! This may have been discussed/addressed in the source project already so that's worth checking.