Setting a flag to select features

This commit is contained in:
Eric van der Vlist 2022-11-29 16:54:13 +01:00
parent deb1f267ab
commit 4d1b1c9a06
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ import MouseWheelZoom from 'ol/interaction/MouseWheelZoom';
import DragZoom from 'ol/interaction/DragZoom';
import Select from 'ol/interaction/Select';
import Layer from 'ol/layer/Layer';
import { selectedStyle } from './selectedStyle';
const [getState, setState] = createSignal({
lon: 0,
@ -156,6 +157,7 @@ const Map: Component = () => {
});
features.map((feature) => {
const id = feature.get('id');
feature.set('isSelected', !feature.get('isSelected'));
console.log({ caller: 'clickHandler / feature', event, feature, id });
const branch = tree[id];
if (branch?.updateHandler) branch.updateHandler(feature);