Skip to content

Commit d6367c9

Browse files
committed
Only handle events from the top-most layer #359
1 parent 27f43ae commit d6367c9

19 files changed

+21
-0
lines changed

src/lib/browse/InterventionLayer.svelte

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
{...layerId("interventions-points")}
4343
filter={["all", isPoint, hideWhileEditing, notEndpoint]}
4444
manageHoverState
45+
eventsIfTopMost
4546
paint={{
4647
"circle-color": colorInterventions,
4748
"circle-radius": circleRadius,
@@ -60,6 +61,7 @@
6061
{...layerId("interventions-lines")}
6162
filter={["all", isLine, hideWhileEditing]}
6263
manageHoverState
64+
eventsIfTopMost
6365
paint={{
6466
"line-color": colorInterventions,
6567
"line-width": lineWidth,
@@ -91,6 +93,7 @@
9193
{...layerId("interventions-polygons")}
9294
filter={["all", isPolygon, hideWhileEditing]}
9395
manageHoverState
96+
eventsIfTopMost
9497
paint={{
9598
"fill-color": colorInterventions,
9699
"fill-opacity": hoverStateFilter(0.2, 0.5),

src/lib/browse/layers/areas/CensusOutputAreas.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
layout={{
197197
visibility: colorBy != "" ? "visible" : "none",
198198
}}
199+
eventsIfTopMost
199200
manageHoverState
200201
hoverCursor="pointer"
201202
on:click={onClick}

src/lib/browse/layers/areas/CombinedAuthorities.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
visibility: show ? "visible" : "none",
6262
}}
6363
manageHoverState
64+
eventsIfTopMost
6465
on:click={onClick}
6566
hoverCursor="pointer"
6667
>

src/lib/browse/layers/areas/IMD.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
visibility: show ? "visible" : "none",
7070
}}
7171
manageHoverState
72+
eventsIfTopMost
7273
>
7374
<Popup let:props>
7475
<p>

src/lib/browse/layers/areas/LocalAuthorityDistricts.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
visibility: show ? "visible" : "none",
6262
}}
6363
manageHoverState
64+
eventsIfTopMost
6465
on:click={onClick}
6566
hoverCursor="pointer"
6667
>

src/lib/browse/layers/areas/LocalPlanningAuthorities.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
visibility: show ? "visible" : "none",
8383
}}
8484
manageHoverState
85+
eventsIfTopMost
8586
>
8687
<Popup let:props>
8788
<p>{props.name}</p>

src/lib/browse/layers/areas/ParliamentaryConstituencies.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
visibility: show ? "visible" : "none",
7070
}}
7171
manageHoverState
72+
eventsIfTopMost
7273
on:click={onClick}
7374
hoverCursor="pointer"
7475
>

src/lib/browse/layers/areas/Wards.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
visibility: show ? "visible" : "none",
6262
}}
6363
manageHoverState
64+
eventsIfTopMost
6465
on:click={onClick}
6566
hoverCursor="pointer"
6667
>

src/lib/browse/layers/lines/BusRoutes.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
visibility: show ? "visible" : "none",
6464
}}
6565
manageHoverState
66+
eventsIfTopMost
6667
>
6768
<Popup let:props>
6869
{#if props.has_bus_lane}

src/lib/browse/layers/lines/CyclePaths.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
visibility: show ? "visible" : "none",
125125
}}
126126
manageHoverState
127+
eventsIfTopMost
127128
hoverCursor="pointer"
128129
on:click={onClick}
129130
>

src/lib/browse/layers/lines/MajorRoadNetwork.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
{...layerId(name)}
4747
sourceLayer={name}
4848
manageHoverState
49+
eventsIfTopMost
4950
paint={{
5051
"line-color": color,
5152
"line-width": 7,

src/lib/browse/layers/lines/PCT.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
{...layerId(nameSchool)}
127127
sourceLayer={nameSchool}
128128
manageHoverState
129+
eventsIfTopMost
129130
paint={{
130131
"line-color": makeColorRamp(["get", scenario], limits, colorScale),
131132
"line-width": denseLineWidth,

src/lib/browse/layers/lines/RoadSpeeds.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
{...layerId(name)}
8888
sourceLayer={name}
8989
manageHoverState
90+
eventsIfTopMost
9091
paint={{
9192
"line-color": makeColorRamp(["get", showSpeed], limits, colorScale),
9293
"line-width": denseLineWidth,

src/lib/browse/layers/lines/RoadWidths.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
{...layerId(name)}
5656
sourceLayer={name}
5757
manageHoverState
58+
eventsIfTopMost
5859
paint={{
5960
"line-color": makeColorRamp(["get", "average"], limits, colorScale),
6061
// TODO Try showing the actual width, in meters and not pixels

src/lib/browse/layers/points/CriticalIssues.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
{...layerId(`${source}-points`)}
111111
applyToClusters={false}
112112
manageHoverState
113+
eventsIfTopMost
113114
paint={{
114115
"circle-color": color,
115116
"circle-opacity": hoverStateFilter(0.9, 0.5),

src/lib/browse/layers/points/Crossings.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
visibility: show ? "visible" : "none",
9191
}}
9292
hoverCursor="pointer"
93+
eventsIfTopMost
9394
on:click={onClick}
9495
>
9596
<Popup let:props>

src/lib/browse/layers/points/CycleParking.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
visibility: show ? "visible" : "none",
6161
}}
6262
manageHoverState
63+
eventsIfTopMost
6364
>
6465
<Popup let:props>
6566
<p>

src/lib/browse/layers/points/PolygonAmenityLayerControl.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
visibility: show ? "visible" : "none",
5656
}}
5757
manageHoverState
58+
eventsIfTopMost
5859
>
5960
<Popup let:props>
6061
<p>{props.name ?? `Unnamed ${singularNoun}`}</p>

src/lib/browse/layers/points/VehicleCounts.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
visibility: show ? "visible" : "none",
9797
}}
9898
hoverCursor="pointer"
99+
eventsIfTopMost
99100
on:click={onClick}
100101
>
101102
<Popup let:props>

0 commit comments

Comments
 (0)