From 059103b66c7e09d36aa4ac4b56be4c9883fda0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Thu, 9 May 2024 16:35:33 +0200 Subject: [PATCH] fix(sync): Allow overlays to sync `this.options.overlay` is now set during `map.initialize()`, which makes it possible to be set by incoming websocket operations. --- umap/static/umap/js/umap.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index e7a052a2..27175ab3 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -207,6 +207,10 @@ U.Map = L.Map.extend({ this.editTools = new U.Editable(this) this.renderEditToolbar() } + if (!U.Utils.isObject(this.options.overlay)) { + this.options.overlay = {} + } + this.initShortcuts() this.onceDataLoaded(function () { const slug = L.Util.queryString('feature') @@ -1363,9 +1367,6 @@ U.Map = L.Map.extend({ }, _editOverlay: function (container) { - if (!U.Utils.isObject(this.options.overlay)) { - this.options.overlay = {} - } const overlayFields = [ [ 'options.overlay.url_template',