Skip to content

Commit

Permalink
fixed performance issue when node coloring and node clustering are bo…
Browse files Browse the repository at this point in the history
…th enabled
  • Loading branch information
ASC95 committed Apr 3, 2024
1 parent b8aabb7 commit 8ac18f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions omf/static/geoJsonMap/v3/colorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8ac18f1

Please sign in to comment.