I am currently working with leaflet. I was able to draw the polygons with geojson using lat,lng with below code snippet:

var geolayer=L.geoJson(geodata);

But above code uses the latlng for drawing the polygons. Now is there any way possible to draw the polygon using x and y coordinate(eg:1,1)?

  • 1
    By 'x,y' Do you mean pixel coordinates or do you mean geographical coordinates? – MappaGnosis Jan 8 '18 at 11:36

The GeoJSON format only supports the WGS84 CRS.

The coordinate reference system for all GeoJSON coordinates is a
geographic coordinate reference system, using the World Geodetic
System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units of decimal degrees.

Please see the website for more information or read the specification here.

If you need to reproject GeoJSON, you could look at https://github.com/perliedman/reproject.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.