using the leaflet-distance-markers plug in

20 views
Skip to first unread message

Gary Whitcher

unread,
Apr 12, 2022, 12:38:57 PM4/12/22
to Leaflet
Has anyone used the leaflet-distance-markers plug in for leaflet? The example shown in Git shows a polyline created with points. I am creating a polyline with geojson. I cant seem to get this to work with geojson.. Any help would be appreciated.

Thanks

Edwin Corrigan

unread,
Apr 12, 2022, 5:31:57 PM4/12/22
to leafl...@googlegroups.com
Hey, 

A codepen or snippet would clear up what you're trying to do.

I understand that you're creating lines on a leaflet map from multiple features in a geojson using L.geojson and now you want to use an external library that requires an L.Polyline instance? 

If so, I think you'll have to iterate over the features array in your geoJson and generate the lines. Then you can pass them to your library. 

One other thing - Geojson coordinates are lon lat while you'll need lat lon for creating L.Polylines. 

Best Regards, 
Edwin

On Tue 12 Apr 2022, 5:38 PM Gary Whitcher, <gwhi...@blueskyevo.com> wrote:
Has anyone used the leaflet-distance-markers plug in for leaflet? The example shown in Git shows a polyline created with points. I am creating a polyline with geojson. I cant seem to get this to work with geojson.. Any help would be appreciated.

Thanks

--

---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/ad35ecad-dcae-4198-8bed-cfa28b3b1b40n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages