loleaflet: add _reset function to Path object

Used by L.Path.Transformation

Change-Id: I337bc583acb8ba1cf211e709b3bf3b9e7507d486
This commit is contained in:
Henry Castro 2018-10-30 10:50:26 -04:00 committed by Jan Holesovsky
parent 8a645d283a
commit 22eca5a299

View file

@ -27,11 +27,7 @@ L.Path = L.Layer.extend({
onAdd: function () {
this._renderer = this._map.getRenderer(this);
this._renderer._initPath(this);
// defined in children classes
this._project();
this._update();
this._reset();
this._renderer._addPath(this);
},
@ -75,6 +71,12 @@ L.Path = L.Layer.extend({
return this;
},
_reset: function () {
// defined in child classes
this._project();
this._update();
},
_clickTolerance: function () {
// used when doing hit detection for Canvas layers
return (this.options.stroke ? this.options.weight / 2 : 0) + (L.Browser.touch ? 10 : 0);