Open
Description
openedon Oct 6, 2015
I updated Leaflet to the latest dev version. In that version they changed L.Circle and added the radius to the options. I changed that inside the draw plugin inside L.Draw.Circle in the following two functions.
_drawShape: function (latlng) {
if (!this._shape) {
this.options.shapeOptions.radius = this._startLatLng.distanceTo(latlng);
this._shape = new L.Circle(this._startLatLng, this.options.shapeOptions);
this._map.addLayer(this._shape);
} else {
this._shape.setRadius(this._startLatLng.distanceTo(latlng));
}
},
_fireCreatedEvent: function () {
this.options.shapeOptions.radius = this._shape.getRadius();
var circle = new L.Circle(this._startLatLng, this.options.shapeOptions);
L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this, circle);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment