Closed williams9438 closed 5 years ago
I have solved the problem. For anyone having similar issue the problem is withe the latlng object variable return the wrong coordinate (the the latlng return lnglat instead of latlng) which result in the placement of marker on the wrong part of the map.
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, geojsonMarkerOptions)
}
So to solve this just use the feature object to get the coordinate instead of the latlng
Yeah, Leaflet and GeoJSON's swapped axis order (lat/lng in leaflet vs lng/lat in GeoJSON) is a very common source of confusion. You just have to keep remembering which format/API you're working with (and try flipping the axis order when strange things happen 😉).
Any particular reason to keep this open? Closing for now, and will consider reopening if you think it's still an issue.
I just wanted you to see this in case I didn't know about the issue.
when i use this library for displaying marker on the map it get displayed on the point on the map but when i use the native function it is displayed correctly. please help me look into it
code that display on the wrong point on the map
-data return from 'http://localhost:8000/company_user/location/1'
{"geometry": {"type": "Point", "coordinates": [6.4816961423227815,3.372369035580695]}, "type": "Feature", "properties": {}}