Use 512× tiles
This commit is contained in:
parent
e1453deaa3
commit
b21c9400a3
|
@ -13,8 +13,8 @@ const Point = require('ol/geom/Point').default;
|
|||
const LineString = require('ol/geom/LineString').default;
|
||||
|
||||
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');
|
||||
|
||||
// Map background
|
||||
|
@ -24,8 +24,9 @@ const mapboxToken = 'pk.eyJ1IjoibWF0dGVvZGVsYWJyZSIsImEiOiJjazUxaWNsdXcwdWhjM2\
|
|||
const backgroundSource = new XYZSource({
|
||||
url: 'https://api.mapbox.com/' + [
|
||||
'styles', 'v1', 'mapbox', 'streets-v11',
|
||||
'tiles', '256', '{z}', '{x}', '{y}',
|
||||
'tiles', '512', '{z}', '{x}', '{y}',
|
||||
].join('/') + `?access_token=${mapboxToken}`,
|
||||
tileSize: [512, 512],
|
||||
});
|
||||
|
||||
const backgroundLayer = new TileLayer({
|
||||
|
@ -129,6 +130,7 @@ const map = new Map({
|
|||
center: proj.fromLonLat([3.88, 43.605]),
|
||||
zoom: 13,
|
||||
maxZoom: 22,
|
||||
constrainResolution: true,
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue