Use 512× tiles

This commit is contained in:
Mattéo Delabre 2020-01-16 16:27:18 +01:00
parent e1453deaa3
commit b21c9400a3
Signed by: matteo
GPG Key ID: AE3FBD02DC583ABB
1 changed files with 4 additions and 2 deletions

View File

@ -13,8 +13,8 @@ const Point = require('ol/geom/Point').default;
const LineString = require('ol/geom/LineString').default; const LineString = require('ol/geom/LineString').default;
const proj = require('ol/proj'); const proj = require('ol/proj');
const {Style, Fill, Stroke, Circle} = require('ol/style');
const {Style, Fill, Stroke, Circle} = require('ol/style');
const color = require('color'); const color = require('color');
// Map background // Map background
@ -24,8 +24,9 @@ const mapboxToken = 'pk.eyJ1IjoibWF0dGVvZGVsYWJyZSIsImEiOiJjazUxaWNsdXcwdWhjM2\
const backgroundSource = new XYZSource({ const backgroundSource = new XYZSource({
url: 'https://api.mapbox.com/' + [ url: 'https://api.mapbox.com/' + [
'styles', 'v1', 'mapbox', 'streets-v11', 'styles', 'v1', 'mapbox', 'streets-v11',
'tiles', '256', '{z}', '{x}', '{y}', 'tiles', '512', '{z}', '{x}', '{y}',
].join('/') + `?access_token=${mapboxToken}`, ].join('/') + `?access_token=${mapboxToken}`,
tileSize: [512, 512],
}); });
const backgroundLayer = new TileLayer({ const backgroundLayer = new TileLayer({
@ -129,6 +130,7 @@ const map = new Map({
center: proj.fromLonLat([3.88, 43.605]), center: proj.fromLonLat([3.88, 43.605]),
zoom: 13, zoom: 13,
maxZoom: 22, maxZoom: 22,
constrainResolution: true,
}), }),
}); });