aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/app/store/MapTypes.js9
-rw-r--r--web/app/view/map/BaseMap.js32
-rw-r--r--web/l10n/en.json3
3 files changed, 42 insertions, 2 deletions
diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js
index 9cca525e..01657565 100644
--- a/web/app/store/MapTypes.js
+++ b/web/app/store/MapTypes.js
@@ -20,6 +20,15 @@ Ext.define('Traccar.store.MapTypes', {
fields: ['key', 'name'],
data: [{
+ key: 'locationIqStreets',
+ name: Strings.mapLocationIqStreets
+ }, {
+ key: 'locationIqEarth',
+ name: Strings.mapLocationIqEarth
+ }, {
+ key: 'locationIqHybrid',
+ name: Strings.mapLocationIqHybrid
+ }, {
key: 'osm',
name: Strings.mapOsm
}, {
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js
index efd05021..e280de8e 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: '&copy; <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: '&copy; <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: '&copy; <a href="https://locationiq.com/">LocationIQ</a>'
+ })
})
]
});
diff --git a/web/l10n/en.json b/web/l10n/en.json
index 8ee4d659..dd310577 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -263,6 +263,9 @@
"mapMapboxSatellite": "Mapbox Satellite",
"mapMapTilerBasic": "MapTiler Basic",
"mapMapTilerHybrid": "MapTiler Hybrid",
+ "mapLocationIqStreets": "LocationIQ Streets",
+ "mapLocationIqEarth": "LocationIQ Earth",
+ "mapLocationIqHybrid": "LocationIQ Hybrid",
"mapShapePolygon": "Polygon",
"mapShapeCircle": "Circle",
"mapShapePolyline": "Polyline",