From 01fa7543a255ed3181dbad33d4807958df43c38b Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 17 Aug 2018 09:30:18 +0200 Subject: [PATCH] Pass a binded function to zoomToSeeLayer MarkerCluster function fix #611 --- umap/static/umap/js/umap.controls.js | 4 ++-- umap/static/umap/js/umap.features.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index b8b72f46..8bbaaa3d 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -670,11 +670,11 @@ L.U.Map.include({ color.style.backgroundImage = 'url(' + symbol + ')'; } L.DomEvent.on(zoom_to, 'click', function (e) { - e.callback = this.view; + e.callback = L.bind(this.view, this); this.bringToCenter(e); }, feature); L.DomEvent.on(title, 'click', function (e) { - e.callback = this.view + e.callback = L.bind(this.view, this) this.bringToCenter(e); }, feature); L.DomEvent.on(edit, 'click', function () { diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index dc8acb49..2d234af5 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -62,6 +62,7 @@ L.U.FeatureMixin = { } return; } + // TODO deal with an event instead? if (this.map.slideshow) this.map.slideshow.current = this; this.attachPopup(); this.openPopup(e && e.latlng || this.getCenter());