diff --git a/src/leaflet.js b/src/leaflet.js index 24e4061..9b86184 100644 --- a/src/leaflet.js +++ b/src/leaflet.js @@ -237,6 +237,15 @@ class Pattern extends BasePattern { map.addControl(minimap); } + // Refresh map data + $(this.el).on("leaflet.refresh", (e, geojson) => { + if ( typeof this.marker_cluster != "undefined" ) { + this.marker_cluster.clearLayers(); + } + if (geojson) { + this.init_geojson(map, geojson); + } + }); log.debug("pattern initialized"); }