Add zoomOffset option

This commit is contained in:
Sascha Hagedorn
2022-03-18 09:39:46 +00:00
committed by Linus Groh
parent 89899de565
commit 8c3681b6ad
4 changed files with 12 additions and 1 deletions
+8
View File
@@ -408,6 +408,14 @@ and [this Wikipedia article](https://en.wikipedia.org/wiki/Tiled_web_map).
};
```
### `map.zoomOffset`
Offset the zoom level to account for different tile sizes. For example tiles with a
size of 512x512 need an offset of -1 and for 1024x1024 an offset of -2.
- Type: [`Number`]
- Default: `0`
### `onLocationChange.fitView`
Whether to re-fit the map's content into view or not when a location update is received.
+1
View File
@@ -65,6 +65,7 @@ const DEFAULT_CONFIG = {
fillColor: "transparent",
},
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
zoomOffset: 0,
},
onLocationChange: {
fitView: false,
+1
View File
@@ -56,6 +56,7 @@ interface Config {
fillColor: OptionalColor;
};
url: string;
zoomOffset: number;
};
onLocationChange: {
fitView: boolean;
+2 -1
View File
@@ -21,7 +21,7 @@
<LTileLayer
:url="url"
:attribution="attribution"
:options="{ maxNativeZoom, maxZoom }"
:options="{ maxNativeZoom, maxZoom, zoomOffset }"
/>
<template v-if="map.layers.last">
@@ -156,6 +156,7 @@ export default {
maxNativeZoom: this.$config.map.maxNativeZoom,
url: this.$config.map.url,
zoom: this.$store.state.map.zoom,
zoomOffset: this.$config.map.zoomOffset,
circle: {
...this.$config.map.circle,
color: this.$config.map.circle.color || this.$config.primaryColor,