mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix: do not fail when navigating with popup arrows in cluster mode (#2307)
- make sure we have correct `this` in callback - do not call anymatePan if icon is not added to map (because clusterized)
This commit is contained in:
commit
e33fc787ab
2 changed files with 4 additions and 3 deletions
|
@ -44,7 +44,8 @@ const Popup = BasePopup.extend({
|
||||||
DomEvent.on(el, 'load', () => {
|
DomEvent.on(el, 'load', () => {
|
||||||
this._updateLayout()
|
this._updateLayout()
|
||||||
this._updatePosition()
|
this._updatePosition()
|
||||||
this._adjustPan()
|
// Do not call when feature is in cluster.
|
||||||
|
if (this._map) this._adjustPan()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -60,7 +60,7 @@ class PopupTemplate {
|
||||||
feature: nextFeature.properties.name || translate('next'),
|
feature: nextFeature.properties.name || translate('next'),
|
||||||
})
|
})
|
||||||
DomEvent.on(next, 'click', () => {
|
DomEvent.on(next, 'click', () => {
|
||||||
nextFeature.zoomTo({ callback: nextFeature.view })
|
nextFeature.zoomTo({ callback: (event) => nextFeature.view(event) })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (previousFeature) {
|
if (previousFeature) {
|
||||||
|
@ -68,7 +68,7 @@ class PopupTemplate {
|
||||||
feature: previousFeature.properties.name || translate('previous'),
|
feature: previousFeature.properties.name || translate('previous'),
|
||||||
})
|
})
|
||||||
DomEvent.on(previous, 'click', () => {
|
DomEvent.on(previous, 'click', () => {
|
||||||
previousFeature.zoomTo({ callback: previousFeature.view })
|
previousFeature.zoomTo({ callback: (event) => previousFeature.view(event) })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
DomEvent.on(zoom, 'click', () => feature.zoomTo())
|
DomEvent.on(zoom, 'click', () => feature.zoomTo())
|
||||||
|
|
Loading…
Reference in a new issue