From 22eca5a2992b9e13238c6eab26f6b7e5cf26e895 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Tue, 30 Oct 2018 10:50:26 -0400 Subject: [PATCH] loleaflet: add _reset function to Path object Used by L.Path.Transformation Change-Id: I337bc583acb8ba1cf211e709b3bf3b9e7507d486 --- loleaflet/src/layer/vector/Path.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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);