Closed mjpoo closed 3 months ago
I apologize, I am very new to this. I managed to load a .gpx file from my computer and display the polyline. However, only the start and end points get the markers. I aim to have a a kind of marker of all the trackpoints (or to list them beside the map), in order to delete the points that are clearly wrong.
Hi @ranran2121 ,
I think our issues are different.
You can see an example of how to list all your trackpoints using getLatLngs()
in issue #145.
@mjpoo You can listen to addpoint
events.
You'll get events with a point_type
property which can be start
, end
, label
(named points) and waypoint
, and a point
property that will be the marker object. You can accumulate them into a list or do whatever you need with them.
HTH! Max
I can get all the track points (
trkpt
) usingevent.line.getLatLngs()
.Is there a method to get an array of waypoints (
wpt
) from the GPX file?I tried
getLayers()
onloaded
but it returns an empty array.