From 1555bab4044e58deea53a5ade07ece80db592a93 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 21 Sep 2020 23:01:09 -0700 Subject: Use OpenStreetMap by default --- modern/src/mapManager.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'modern/src') diff --git a/modern/src/mapManager.js b/modern/src/mapManager.js index c597eb58..9e5d631d 100644 --- a/modern/src/mapManager.js +++ b/modern/src/mapManager.js @@ -132,14 +132,14 @@ const element = document.createElement('div'); element.style.width = '100%'; element.style.height = '100%'; -/*map = new mapboxgl.Map({ +/*const map = new mapboxgl.Map({ container: this.mapContainer, style: 'https://cdn.traccar.com/map/basic.json', center: [0, 0], zoom: 1 });*/ -const map = new mapboxgl.Map({ +/*const map = new mapboxgl.Map({ container: element, style: { 'version': 8, @@ -169,6 +169,27 @@ const map = new mapboxgl.Map({ }, center: [0, 0], zoom: 1 +});*/ + +const map = new mapboxgl.Map({ + container: element, + style: { + version: 8, + sources: { + osm: { + type: 'raster', + tiles: ["https://tile.openstreetmap.org/{z}/{x}/{y}.png"], + tileSize: 256, + attribution: '© OpenStreetMap contributors', + }, + }, + glyphs: 'https://cdn.traccar.com/map/fonts/{fontstack}/{range}.pbf', + layers: [{ + id: 'osm', + type: 'raster', + source: 'osm', + }], + }, }); map.addControl(new mapboxgl.NavigationControl()); -- cgit v1.2.3