leaflet-elevation icon indicating copy to clipboard operation
leaflet-elevation copied to clipboard

Unsopperted GeoJSON feature geometry type:Point

Open luisfio1 opened this issue 2 years ago • 1 comments

In your example loading a local GPX.file the way points are apparently not supported.

I have tried to add the points with the options:

waypoints: true,
wptLabels: true,

but it doesn't seem to accept them.

This is the message that appears in the console:

"control.js:328 Unsopperted GeoJSON feature geometry type:Point"

Is there any option to include them?

Thanks

luisfio1 avatar Nov 08 '23 12:11 luisfio1

Hi @luisfio1,

this is issue somehow related to: https://github.com/Raruto/leaflet-elevation/issues/273#issuecomment-1777340192


In your example loading a local GPX.file the way points are apparently not supported.

This is the message that appears in the console:

"control.js:328 Unsopperted GeoJSON feature geometry type:Point"

Is there any option to include them?

that example make use of the addData() function which is a bit lower level in the execution flow than the load() function:

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/examples/leaflet-elevation_upload-gpx.html#L138-L140

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/src/control.js#L327-L328

I have tried to add the points with the options:

waypoints: true,
wptLabels: true,

but it doesn't seem to accept them.

That's where they are currently in use:

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/src/control.js#L784-L805

For your convenience, I recommend that you take some functions such as _loadLayer() as a reference and alter them to your liking (it is nothing more than utility function for build a standard L.GeoJSON object).

Then (within the example) you can insert your customization from here 👇

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/examples/leaflet-elevation_upload-gpx.html#L138-L140

Or at least I'd start experimenting from there..

👋 Raruto

Raruto avatar Nov 08 '23 15:11 Raruto