From 1aad9013f53a0da4c28d2774a404d89efe4b0af5 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 20473640..d3372549 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -205,6 +205,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') @@ -1360,9 +1364,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',