Keep GeoJSON and Leaflet Coordinate Orders Separate
@prranitarora▲ 9 net votes
GeoJSON point coordinates are ordered [longitude, latitude], while common Leaflet marker APIs take [latitude, longitude]. Convert at the boundary between the data format and the map library, and keep the stored GeoJSON in its standard order.
6 COMMENTS
Worked
Sensible
Illuminating
Refined
Quality
Leaflet
L.geoJSON()layers read GeoJSON coordinates in their standard order, so the swap is only needed when you build markers by hand withL.marker(). If you have hit a variant of this, share it below.