diff --git a/umap/static/umap/js/modules/sync/updaters.js b/umap/static/umap/js/modules/sync/updaters.js index 37be4c32..9472a464 100644 --- a/umap/static/umap/js/modules/sync/updaters.js +++ b/umap/static/umap/js/modules/sync/updaters.js @@ -53,7 +53,8 @@ export class DatalayerUpdater extends BaseUpdater { const datalayer = this.getLayerFromID(metadata.id) console.log(datalayer, key, value) this.updateObjectValue(datalayer, key, value) - datalayer.renderProperties([key]) + const property = key.replace("options.", "") + datalayer.renderProperties([property]) } } diff --git a/umap/static/umap/js/umap.data.js b/umap/static/umap/js/umap.data.js index 3b75a75b..f86c840c 100644 --- a/umap/static/umap/js/umap.data.js +++ b/umap/static/umap/js/umap.data.js @@ -14,7 +14,7 @@ L.U.DataRendererMixin = { * * @param list properties : properties that have been updated. */ - renderProperties: function (properties, builder) { + renderProperties: function (properties) { let renderers = new Set() for (const prop of properties) { const propRenderers = this.propertiesRenderers[prop] @@ -36,7 +36,9 @@ L.U.DataRendererMixin = { } for (const renderer of renderers) { - this[renderer](properties, builder) + if (renderer in this) { + this[renderer](properties) + } } }, diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index 2d404e37..324b230b 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -257,13 +257,13 @@ L.U.Layer.Choropleth = L.FeatureGroup.extend({ // If user touches the breaks, then force manual mode if (field === 'options.choropleth.breaks') { this.datalayer.options.choropleth.mode = 'manual' - builder.helpers['options.choropleth.mode'].fetch() + if (builder) builder.helpers['options.choropleth.mode'].fetch() } this.computeBreaks() // If user changes the mode or the number of classes, // then update the breaks input value if (field === 'options.choropleth.mode' || field === 'options.choropleth.classes') { - builder.helpers['options.choropleth.breaks'].fetch() + if (builder) builder.helpers['options.choropleth.breaks'].fetch() } },