Last active
January 2, 2019 12:25
-
-
Save codeofsumit/e5d1fd31d92b7ed723bf9817017d3c74 to your computer and use it in GitHub Desktop.
Leaflet Circle to GeoJSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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