Leaflet / Leaflet.Editable

Make geometries editable in Leaflet.
http://leaflet.github.io/Leaflet.Editable/doc/api.html
559 stars 197 forks source link

Editables inside Layergroup #218

Open Meirur opened 4 months ago

Meirur commented 4 months ago

In a larger (tab driven) project I'am adding all stuff to L.Layergroup for easy managing the Layers. If I'm using this.Map.editTools.startCircle() then the circle will automatically added to map. I', looking for a solution to add the circle to my own Layer like

this.Map.editTools.startCircle({target: myLayer}) Any inspirations?

Edit: This

 startCircle: function (latlng, options,target) {
            latlng = latlng || this.map.getCenter().clone();
            var circle = this.createCircle(latlng, options);
            if (!target) target = this.map;
            circle.enableEdit(target).startDrawing();
            return circle;
        },

doesnt work, because later (in L.Editable.CircleEditor) the lib try to use this.map.project and this fails