Background map provides HSL style map tiles for example for browser based applications.
Raster maps are available in Tile Map Service format
Note: Background map is also available as vector tiles from source hsl-vector-map
.
https://cdn.digitransit.fi/map/v1/:source/:z/:x/:y:size.png
Parameter | Type | Description |
---|---|---|
source | string |
|
z | int | Zoom level |
x | int | x-coordinate |
y | int | y-coordinate |
size | string | '@2x' for retina tiles or empty value for normal |
https://cdn.digitransit.fi/map/v1/hsl-map/16/37313/18958.png
https://cdn.digitransit.fi/map/v1/hsl-map/16/37313/18958@2x.png
https://cdn.digitransit.fi/map/v1/hsl-map-sv/16/37313/18958.png
Here is a quick example that uses Leaflet to display scrollable map.
Note that this example is using hsl-map
tiles (512px), which are not the size that Leaflet expects. To display 512px tiles correctly with Leaflet, use options tileSize: 512
and zoomOffset: -1