@@ -55,9 +55,21 @@ watch(
5555 [" ==" , [" get" , " bron_id" ], 3 ],
5656 " #ffc107" ,
5757 [" ==" , [" get" , " bron_id" ], 4 ],
58- " #dc3545 " ,
58+ " #895129 " ,
5959 " #6c757d" ,
6060 ],
61+ " circle-opacity" : [
62+ " case" ,
63+ [" ==" , [" get" , " bron_id" ], 1 ],
64+ 1 ,
65+ [" ==" , [" get" , " bron_id" ], 2 ],
66+ 1 ,
67+ [" ==" , [" get" , " bron_id" ], 3 ],
68+ 1 ,
69+ [" ==" , [" get" , " bron_id" ], 4 ],
70+ 1 ,
71+ 1 ,
72+ ],
6173 },
6274 });
6375 map .addSource (" active-location" , {
@@ -80,6 +92,12 @@ watch(
8092 map .on (" click" , " locations-layer" , (e ) => {
8193 const feature = e .features ? .[0 ];
8294 if (feature) {
95+ const bronId = feature .properties ? .bron_id ;
96+ // Don't allow interaction if category is disabled
97+ if (appStore .disabledCategories .has (bronId)) {
98+ return ;
99+ }
100+
83101 locationsStore .setActiveLocation (feature);
84102 appStore .expandPanel ();
85103
@@ -97,10 +115,16 @@ watch(
97115 });
98116
99117 map .on (" mouseenter" , " locations-layer" , (e ) => {
100- map .getCanvas ().style .cursor = " pointer" ;
101-
102118 const feature = e .features ? .[0 ];
103119 if (feature) {
120+ const hoverBronId = feature .properties ? .bron_id ;
121+ // Don't show hover if category is disabled
122+ if (appStore .disabledCategories .has (hoverBronId)) {
123+ map .getCanvas ().style .cursor = " grab" ;
124+ return ;
125+ }
126+
127+ map .getCanvas ().style .cursor = " pointer" ;
104128 const coords = feature .geometry .coordinates .slice ();
105129 const locatieId = feature .properties ? .locatie_id || " Unknown" ;
106130 const peilfilterIds = feature .properties ? .peilfilter_ids || " " ;
@@ -111,13 +135,8 @@ watch(
111135 : [];
112136
113137 // Build HTML content
114- const bronId = feature .properties ? .bron_id || " Unknown" ;
115- const dataleverancier =
116- feature .properties ? .dataleverancier || " Unknown" ;
117138
118139 let htmlContent = ` <div>Locatie ID: <strong>${ locatieId} </strong></div>` ;
119- htmlContent += ` <div>Bron ID: <strong>${ bronId} </strong></div>` ;
120- htmlContent += ` <div>Dataleverancier: <strong>${ dataleverancier} </strong></div>` ;
121140
122141 if (peilfilterList .length > 0 ) {
123142 const label =
@@ -150,6 +169,56 @@ watch(
150169 { immediate: true }
151170);
152171
172+ // Watch for disabled categories changes and update map layer
173+ watch (
174+ () => appStore .disabledCategories ,
175+ (disabledCategories ) => {
176+ const map = props .map ;
177+ if (! map || ! map .getLayer (" locations-layer" )) return ;
178+
179+ // Update circle opacity based on disabled categories
180+ const opacityExpression = [
181+ " case" ,
182+ [" ==" , [" get" , " bron_id" ], 1 ],
183+ disabledCategories .has (1 ) ? 0.3 : 1 ,
184+ [" ==" , [" get" , " bron_id" ], 2 ],
185+ disabledCategories .has (2 ) ? 0.3 : 1 ,
186+ [" ==" , [" get" , " bron_id" ], 3 ],
187+ disabledCategories .has (3 ) ? 0.3 : 1 ,
188+ [" ==" , [" get" , " bron_id" ], 4 ],
189+ disabledCategories .has (4 ) ? 0.3 : 1 ,
190+ 1 ,
191+ ];
192+
193+ // Update stroke color to gray with transparency when disabled
194+ const strokeColorExpression = [
195+ " case" ,
196+ [" ==" , [" get" , " bron_id" ], 1 ],
197+ disabledCategories .has (1 ) ? " rgba(153, 153, 153, 0.3)" : " #008fc5" ,
198+ [" ==" , [" get" , " bron_id" ], 2 ],
199+ disabledCategories .has (2 ) ? " rgba(153, 153, 153, 0.3)" : " #28a745" ,
200+ [" ==" , [" get" , " bron_id" ], 3 ],
201+ disabledCategories .has (3 ) ? " rgba(153, 153, 153, 0.3)" : " #ffc107" ,
202+ [" ==" , [" get" , " bron_id" ], 4 ],
203+ disabledCategories .has (4 ) ? " rgba(153, 153, 153, 0.3)" : " #895129" ,
204+ " #6c757d" ,
205+ ];
206+
207+ map .setPaintProperty (
208+ " locations-layer" ,
209+ " circle-opacity" ,
210+ opacityExpression
211+ );
212+
213+ map .setPaintProperty (
214+ " locations-layer" ,
215+ " circle-stroke-color" ,
216+ strokeColorExpression
217+ );
218+ },
219+ { deep: true }
220+ );
221+
153222watch (
154223 () => locationsStore .activeLocation ,
155224 (activeLocation ) => {
0 commit comments