diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-21 23:01:09 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-21 23:01:09 -0700 |
commit | 1555bab4044e58deea53a5ade07ece80db592a93 (patch) | |
tree | ed51ce6579a75d527f1d59a57f10fe1f5c537867 /modern | |
parent | 5ddf1e04451239ddc64e8a06f36f99a50d64d37b (diff) | |
download | trackermap-web-1555bab4044e58deea53a5ade07ece80db592a93.tar.gz trackermap-web-1555bab4044e58deea53a5ade07ece80db592a93.tar.bz2 trackermap-web-1555bab4044e58deea53a5ade07ece80db592a93.zip |
Use OpenStreetMap by default
Diffstat (limited to 'modern')
-rw-r--r-- | modern/src/mapManager.js | 25 |
1 files changed, 23 insertions, 2 deletions
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: '© <a target="_top" rel="noopener" href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', + }, + }, + glyphs: 'https://cdn.traccar.com/map/fonts/{fontstack}/{range}.pbf', + layers: [{ + id: 'osm', + type: 'raster', + source: 'osm', + }], + }, }); map.addControl(new mapboxgl.NavigationControl()); |