Skip to content

Commit 74b9f57

Browse files
committed
added zoom input
1 parent 86cc34a commit 74b9f57

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
hoverOpacity = 0.8,
5858
center = [-2.5, 53],
5959
zoom = 5,
60+
minZoom,
61+
maxZoom,
6062
hash = false,
6163
updateHash = (u) => {
6264
replaceState(u, page.state);
@@ -92,6 +94,8 @@
9294
hoverOpacity?: number;
9395
center?: LngLatLike | undefined;
9496
zoom?: number;
97+
minZoom?: number;
98+
maxZoom?: number;
9599
hash?: boolean;
96100
updateHash?: (URL) => void;
97101
useInitialHash?: boolean;
@@ -253,6 +257,8 @@
253257
{standardControls}
254258
{center}
255259
{zoom}
260+
{maxZoom}
261+
{minZoom}
256262
{hash}
257263
{updateHash}
258264
class="map"

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,24 @@
180180
category: "UI",
181181
visible: { name: "standardControls", value: false },
182182
},
183+
{
184+
name: "maxZoom",
185+
isProp: true,
186+
description:
187+
"Add zoom in and out, and 'reset bearing to north' buttons",
188+
value: 10,
189+
category: "UI",
190+
visible: { name: "standardControls", value: false },
191+
},
192+
{
193+
name: "minZoom",
194+
isProp: true,
195+
description:
196+
"Add zoom in and out, and 'reset bearing to north' buttons",
197+
value: 0,
198+
category: "UI",
199+
visible: { name: "standardControls", value: false },
200+
},
183201
{
184202
name: "navigationControlPosition",
185203
isProp: true,
@@ -266,6 +284,7 @@
266284
},
267285
{
268286
name: "mapHeight",
287+
category: "Styling",
269288
isProp: true,
270289
value: 400,
271290
},

0 commit comments

Comments
 (0)