Skip to content

Commit

Permalink
Add tileSize option
Browse files Browse the repository at this point in the history
  • Loading branch information
saesh authored and linusg committed Mar 18, 2022
1 parent 8c3681b commit 5a64c06
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,14 @@ for all possible values.
}
```

### `map.tileSize`

Size of the tiles in pixels returned by the tile server. Can be used together with
[`map.zoomOffset`](#map.zoomOffset) to configure bigger tile sizes.

- Type: [`Number`]
- Default: `256`

### `map.url`

Tile server URL. For more information see [Leaflet tile layer documentation](https://leafletjs.com/reference-1.5.0.html#tilelayer-url-template)
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const DEFAULT_CONFIG = {
color: null,
fillColor: "transparent",
},
tileSize: 256,
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
zoomOffset: 0,
},
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ interface Config {
color: OptionalColor;
fillColor: OptionalColor;
};
tileSize: number;
url: string;
zoomOffset: number;
};
Expand Down
2 changes: 2 additions & 0 deletions src/views/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<LTileLayer
:url="url"
:attribution="attribution"
:tileSize="tileSize"
:options="{ maxNativeZoom, maxZoom, zoomOffset }"
/>

Expand Down Expand Up @@ -154,6 +155,7 @@ export default {
markerIcon: LCustomMarker,
maxZoom: this.$config.map.maxZoom,
maxNativeZoom: this.$config.map.maxNativeZoom,
tileSize: this.$config.map.tileSize,
url: this.$config.map.url,
zoom: this.$store.state.map.zoom,
zoomOffset: this.$config.map.zoomOffset,
Expand Down

0 comments on commit 5a64c06

Please sign in to comment.