From b21c9400a369476d17feddc5e3379bbeaa459a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Thu, 16 Jan 2020 16:27:18 +0100 Subject: [PATCH] =?UTF-8?q?Use=20512=C3=97=20tiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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, }), });