Skip to content

Commit 886f6bd

Browse files
committed
Tooltip bug fix and removed inspect
1 parent ab673fe commit 886f6bd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/lib/components/data-vis/map/Map.svelte

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
onidle,
8686
geoSource = "file",
8787
tileSource = "http://localhost:8080/{z}/{x}/{y}.pbf",
88-
paintObject,
8988
geojsonPromoteId = "areanm",
9089
vectorMetricProperty = "Index of Multiple Deprivation (IMD) Decile",
9190
vectorLayerName = "LSOA",
@@ -493,15 +492,13 @@
493492
<p>No data</p>
494493
{/if}
495494

496-
<!-- Important note: sourceLayer must match `-l` value from tippecanoe -->
497-
495+
<!-- Important note: sourceLayer must match `-l` value from tippecanoe -->åß
498496
{#if interactive && tooltip}
499497
<Tooltip
500498
{currentMousePosition}
501499
{hoveredArea}
502500
{hoveredAreaData}
503-
{year}
504-
{metric}
501+
metric={geoSource == "tiles" ? vectorMetricProperty : metric}
505502
/>
506503
{/if}
507504
</MapLibre>

src/lib/components/data-vis/map/Tooltip.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>
2-
let { currentMousePosition, hoveredArea, hoveredAreaData, year, metric } =
3-
$props();
2+
let { currentMousePosition, hoveredArea, hoveredAreaData, metric } = $props();
43
let tooltipHeight = $state();
54
let tooltipWidth = $state();
65
@@ -16,7 +15,7 @@
1615
>
1716
<p>{hoveredArea}</p>
1817
<p class="detail">
19-
2019 IMD rank: {hoveredAreaData ?? "No data"}
18+
{metric}: {hoveredAreaData ?? "No data"}
2019
</p>
2120
</div>
2221
{/if}

0 commit comments

Comments
 (0)