diff --git a/loleaflet/src/layer/vector/Path.js b/loleaflet/src/layer/vector/Path.js index e0b499dbe..51665ba9d 100644 --- a/loleaflet/src/layer/vector/Path.js +++ b/loleaflet/src/layer/vector/Path.js @@ -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);