Skip to content

Commit

Permalink
fix: do not use mixin updateLayer() to restore geojson data for in me…
Browse files Browse the repository at this point in the history
…mory layers
  • Loading branch information
robinbourianes-kalisio committed Jul 16, 2024
1 parent 4ab3605 commit 1aab83c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion map/client/mixins/map/mixin.geojson-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,13 @@ export const geojsonLayers = {
if (cachedGeojson) {
if (isInMemoryLayer(layer)) {
// Restore geojson data for in-memory layers that was hidden
this.updateLayer(layer.name, cachedGeojson)
// Directly deal with the leaflet layer instead of calling updateLayer, we are just restoring data
// Handle case where there's clustering on top (cf. updateLayer)
if (typeof engineLayer.getLayers === 'function') {
const container = engineLayer
engineLayer = container.getLayers().find(layer => layer._container === container)
}
engineLayer._onNewData(false, cachedGeojson)
} else {
// Clear cache since layer is not in memory anymore
delete this.geojsonCache[layer.name]
Expand Down

0 comments on commit 1aab83c

Please sign in to comment.