diff --git a/js/index.js b/js/index.js index e8fcae3..6dc7021 100644 --- a/js/index.js +++ b/js/index.js @@ -124,11 +124,13 @@ function updateActiveFeature(feature_or_featureid){ } document.getElementById("result-panel").addEventListener("activePanelChange", e => { - let activeElement = e.target.children[e.activePanelIndex] - if(activeElement instanceof FeatureElement){ - let feature = activeElement.feature - updateActiveFeature(feature) - } else { - MAP.unhighlight_all() + if(e.activePanelIndex){ + let activeElement = e.target.children[e.activePanelIndex] + if(activeElement instanceof FeatureElement){ + let feature = activeElement.feature + updateActiveFeature(feature) + } else { + MAP.unhighlight_all() + } } })