diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-11-25 17:04:26 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-11-25 17:04:26 -0800 |
commit | a8d499612b3e37f0ba3864eb97ea396221be8cb7 (patch) | |
tree | 45361b2b8d87d8350a375d3020950452096b07d2 /web/app/view/map | |
parent | ea72b9f96d6e03a4f9bbbeadcc8f41efbff4427f (diff) | |
download | etbsa-traccar-web-a8d499612b3e37f0ba3864eb97ea396221be8cb7.tar.gz etbsa-traccar-web-a8d499612b3e37f0ba3864eb97ea396221be8cb7.tar.bz2 etbsa-traccar-web-a8d499612b3e37f0ba3864eb97ea396221be8cb7.zip |
Enable LocationIQ by default
Diffstat (limited to 'web/app/view/map')
-rw-r--r-- | web/app/view/map/BaseMap.js | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index efd0502..e280de8 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -30,12 +30,13 @@ Ext.define('Traccar.view.map.BaseMap', { }, initMap: function () { - var server, layer, type, bingKey, lat, lon, zoom, maxZoom, target, poiLayer, self = this; + var server, layer, type, bingKey, locationIqKey, lat, lon, zoom, maxZoom, target, poiLayer, self = this; server = Traccar.app.getServer(); type = Traccar.app.getPreference('map', null); bingKey = server.get('bingKey'); + locationIqKey = Traccar.app.getAttributePreference('locationIqKey', 'pk.b34237342901fc175252c790d1674dcc'); layer = new ol.layer.Group({ title: Strings.mapLayer, @@ -125,8 +126,35 @@ Ext.define('Traccar.view.map.BaseMap', { new ol.layer.Tile({ title: Strings.mapOsm, type: 'base', - visible: type === 'osm' || type === 'wikimedia' || !type, + visible: type === 'osm', source: new ol.source.OSM({}) + }), + new ol.layer.Tile({ + title: Strings.mapLocationIqHybrid, + type: 'base', + visible: type === 'locationIqHybrid', + source: new ol.source.XYZ({ + url: 'https://{a-c}-tiles.locationiq.com/v3/hybrid/r/{z}/{x}/{y}.jpg?key=' + locationIqKey, + attributions: '© <a href="https://locationiq.com/">LocationIQ</a>' + }) + }), + new ol.layer.Tile({ + title: Strings.mapLocationIqEarth, + type: 'base', + visible: type === 'locationIqEarth', + source: new ol.source.XYZ({ + url: 'https://{a-c}-tiles.locationiq.com/v3/earth/r/{z}/{x}/{y}.jpg?key=' + locationIqKey, + attributions: '© <a href="https://locationiq.com/">LocationIQ</a>' + }) + }), + new ol.layer.Tile({ + title: Strings.mapLocationIqStreets, + type: 'base', + visible: type === 'locationIqStreets' || type === 'wikimedia' || !type, + source: new ol.source.XYZ({ + url: 'https://{a-c}-tiles.locationiq.com/v3/streets/r/{z}/{x}/{y}.png?key=' + locationIqKey, + attributions: '© <a href="https://locationiq.com/">LocationIQ</a>' + }) }) ] }); |