From 8ac18f1d165041b8be9e2b81e6718cae68c3aba7 Mon Sep 17 00:00:00 2001 From: ASC95 <16790624+ASC95@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:08:14 -0400 Subject: [PATCH] fixed performance issue when node coloring and node clustering are both enabled --- omf/static/geoJsonMap/v3/colorModal.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/omf/static/geoJsonMap/v3/colorModal.js b/omf/static/geoJsonMap/v3/colorModal.js index 03eb1c81e..72604229d 100644 --- a/omf/static/geoJsonMap/v3/colorModal.js +++ b/omf/static/geoJsonMap/v3/colorModal.js @@ -357,8 +357,12 @@ class ColorModal { // implements ModalInterface, ObserverInterface ob.getObservers().filter(ob => ob instanceof LeafletLayer).forEach(ll => { // - Color nodes gray if (Object.values(ll.getLayer()._layers)[0].hasOwnProperty('_icon')) { - const svg = Object.values(ll.getLayer()._layers)[0]._icon.children[0]; - this.#colorSvg(svg, {_rgb: [128, 128, 128, 1]}); + let svg = Object.values(ll.getLayer()._layers)[0]; + // - Can be null when node clustering is active + if (svg._icon !== null) { + svg = svg._icon.children[0]; + this.#colorSvg(svg, {_rgb: [128, 128, 128, 1]}); + } // - Color lines gray } else { const options = Object.values(ll.getLayer()._layers)[0].options;