How could I generate a CRS field inside the GeoJSON object created by Leaflet layer.t

المشرف العام

Administrator
طاقم الإدارة
I'm using Leaflet to transform some drawn polygons to GeoJSON and send them to a backend. But the GeoJSON objects generated by layer.toGeoJSON are like this:

{ "type":"Feature", "properties":{}, "geometry":{ "type":"Polygon", "coordinates":[[[18.69873046875,51.481382896100975],[18.69873046875,51.890053935216926],[20.456542968749996,51.890053935216926],[20.456542968749996,51.481382896100975],[18.69873046875,51.481382896100975]]] } }When I receive that GeoJSON object in the backend of my application (Django based) and create a GEOS object from it, epsg:4326 is assumed. Even when epsg:3857 is used for the map.

I know GeoJSON spec supports CRS definition, but I don't know how to include it in the GeoJSON object generated by toGeoJSON.

Any suggestion?



أكثر...
 
أعلى