Skip to content

Commit 5e4181d

Browse files
committed
Adding tileSource prop
1 parent 9a3fcce commit 5e4181d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
onload,
8383
onidle,
8484
geoSource = "file",
85+
tileSource = "http://localhost:8080/{z}/{x}/{y}.pbf",
8586
}: {
8687
data: object[];
8788
customPalette?: object[];
@@ -126,6 +127,7 @@
126127
onload?: (map: maplibregl.Map) => void;
127128
onidle?: (e: maplibregl.MapLibreEvent) => void;
128129
geoSource: "file" | "tiles" | "none";
130+
tileSource?: string;
129131
} = $props();
130132
131133
let styleLookup = {
@@ -421,7 +423,7 @@
421423
<VectorTileSource
422424
id={"lsoas"}
423425
promoteId={"LSOA21NM"}
424-
tiles={["http://localhost:8080/{z}/{x}/{y}.pbf"]}
426+
tiles={[tileSource]}
425427
>
426428
<FillLayer
427429
paint={{

src/wrappers/components/data-vis/map/MapWrapper.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,17 @@
438438
isProp: true,
439439
description: "Tiles or maps",
440440
category: "Data",
441-
value: "Tiles",
441+
value: "file",
442442
options: ["tiles", "file", "none"],
443443
},
444+
{
445+
name: "tileSource",
446+
isProp: true,
447+
description: "A URL to get the vector tiles from",
448+
category: "Data",
449+
value: "http://localhost:8080/{z}/{x}/{y}.pbf",
450+
visible: { name: "geoSource", value: "tiles" },
451+
},
444452
{ name: "addData", isProp: true, category: "Data", value: true },
445453
{
446454
name: "year",

0 commit comments

Comments
 (0)