Skip to content

Instantly share code, notes, and snippets.

@codeofsumit
Last active January 2, 2019 12:25
Show Gist options
  • Select an option

  • Save codeofsumit/e5d1fd31d92b7ed723bf9817017d3c74 to your computer and use it in GitHub Desktop.

Select an option

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