Click-highlight layer is permanently detached after any layer-config change
Where: reactapp/components/visualizations/Map.js (~lines 699-704, inside onMapClick)
if (highlightLayer.current) {
highlightLayer.current.getSource().clear();
} else {
highlightLayer.current = createHighlightLayer();
map.addLayer(highlightLayer.current);
}
Mechanics: the layer-reconciliation effect in reactapp/components/map/Map.js (the layersToKeep/layersToRemove sweep, ~lines 281-290 and 540-542) removes any OL layer whose name is not in the configured layer list. highlightLayer is an imperative overlay, not a configured layer, so any layer-config rebuild (variable-input substitution changing a layer, adding/removing a layer, editing layer properties) detaches it from the map. The ref is never nulled, so the else branch never runs again — every subsequent click clears/adds features into a detached layer that renders nowhere.
User-visible effect: click-selection highlighting silently and permanently stops working after the first layer-config change that follows a click. (The marker layer does not have this bug — it is recreated and re-added on every click.)
Repro: click a feature (highlight appears) → change any variable input that rebuilds a layer, or edit a layer in the dashboard editor → click a feature again → no highlight.
Click-highlight layer is permanently detached after any layer-config change
Where:
reactapp/components/visualizations/Map.js(~lines 699-704, insideonMapClick)Mechanics: the layer-reconciliation effect in
reactapp/components/map/Map.js(thelayersToKeep/layersToRemovesweep, ~lines 281-290 and 540-542) removes any OL layer whose name is not in the configured layer list.highlightLayeris an imperative overlay, not a configured layer, so any layer-config rebuild (variable-input substitution changing a layer, adding/removing a layer, editing layer properties) detaches it from the map. The ref is never nulled, so theelsebranch never runs again — every subsequent click clears/adds features into a detached layer that renders nowhere.User-visible effect: click-selection highlighting silently and permanently stops working after the first layer-config change that follows a click. (The marker layer does not have this bug — it is recreated and re-added on every click.)
Repro: click a feature (highlight appears) → change any variable input that rebuilds a layer, or edit a layer in the dashboard editor → click a feature again → no highlight.