aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-09-18 15:06:57 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-09-18 15:06:57 +1200
commit21e85e00b30564b291492f3bdba1ae146e84efc2 (patch)
tree19e28f7efa69882eebbd06929e0c9f39def33992 /web
parentc3095be3d331cfc4732e16d1d9fb36c129b4a70c (diff)
downloadetbsa-traccar-web-21e85e00b30564b291492f3bdba1ae146e84efc2.tar.gz
etbsa-traccar-web-21e85e00b30564b291492f3bdba1ae146e84efc2.tar.bz2
etbsa-traccar-web-21e85e00b30564b291492f3bdba1ae146e84efc2.zip
Add support for Carto Basemaps
Diffstat (limited to 'web')
-rw-r--r--web/app/store/MapTypes.js3
-rw-r--r--web/app/view/BaseMap.js29
-rw-r--r--web/l10n/en.json1
3 files changed, 29 insertions, 4 deletions
diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js
index 179343e..a24864e 100644
--- a/web/app/store/MapTypes.js
+++ b/web/app/store/MapTypes.js
@@ -20,6 +20,9 @@ Ext.define('Traccar.store.MapTypes', {
fields: ['key', 'name'],
data: [{
+ key: 'carto',
+ name: Strings.mapCarto
+ }, {
key: 'osm',
name: Strings.mapOsm
}, {
diff --git a/web/app/view/BaseMap.js b/web/app/view/BaseMap.js
index 5074665..a352420 100644
--- a/web/app/view/BaseMap.js
+++ b/web/app/view/BaseMap.js
@@ -42,9 +42,11 @@ Ext.define('Traccar.view.BaseMap', {
layer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: server.get('mapUrl'),
- attributions: [new ol.Attribution({
- html: ''
- })]
+ attributions: [
+ new ol.Attribution({
+ html: ''
+ })
+ ]
})
});
} else if (type === 'bingRoad') {
@@ -61,10 +63,29 @@ Ext.define('Traccar.view.BaseMap', {
imagerySet: 'Aerial'
})
});
- } else {
+ } else if (type === 'osm'){
layer = new ol.layer.Tile({
source: new ol.source.OSM({})
});
+ } else {
+ layer = new ol.layer.Tile({
+ source: new ol.source.XYZ({
+ urls: [
+ 'https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
+ 'https://cartodb-basemaps-b.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
+ 'https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
+ 'https://cartodb-basemaps-d.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png'
+ ],
+ attributions: [
+ new ol.Attribution({
+ html: [
+ '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> '
+ + 'contributors, &copy; <a href="https://carto.com/attributions">CARTO</a>'
+ ]
+ })
+ ]
+ })
+ });
}
lat = user.get('latitude') || server.get('latitude') || Traccar.Style.mapDefaultLat;
diff --git a/web/l10n/en.json b/web/l10n/en.json
index a1fc97c..e34c8d1 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -83,6 +83,7 @@
"mapTitle": "Map",
"mapLayer": "Map Layer",
"mapCustom": "Custom Map",
+ "mapCarto": "Carto Basemaps",
"mapOsm": "Open Street Map",
"mapBingKey": "Bing Maps Key",
"mapBingRoad": "Bing Maps Road",