These were the days when I try to solve my problem.
I have a polygon layer from GeoJSON. I want to edit my polygons using the click event. When I click on a polygon, it becomes editable, but I want the first polygon to no longer be edited when I click on another polygon.
OpenLayers, but naturally not Leaflet.
Here is an excerpt from my code:
var editableLayers = new L.FeatureGroup().addTo(map); var polygon_json; $.ajax({ type: "GET", dataType: "json", url: "get_json.php", success: function (response) { meaux_json = L.geoJson(response, { onEachFeature: onEachFeature }); } });
One person was able to do this, but it's hard for me to understand how: https://github.com/dwilhelm89/Ethermap
source share