diff --git a/front/index.js b/front/index.js index 522205d..414eea1 100644 --- a/front/index.js +++ b/front/index.js @@ -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, }), });