Skip to content

Instantly share code, notes, and snippets.

@codeofsumit
Last active January 2, 2019 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeofsumit/e5d1fd31d92b7ed723bf9817017d3c74 to your computer and use it in GitHub Desktop.
Save codeofsumit/e5d1fd31d92b7ed723bf9817017d3c74 to your computer and use it in GitHub Desktop.
Leaflet Circle to GeoJSON
transformLayerToJson(layer) {
const json = layer.toGeoJSON();
if (layer instanceof L.Circle) {
json.properties.radius = layer.getRadius();
}
return json;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment