aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-07-19 20:36:24 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-07-19 20:36:24 -0700
commit16d579d1628bd8aa4a8d1f262ed70face50af907 (patch)
treee3c2da5930fee52e7a86563cf85116e97aa6970e /web
parent928de80f2c3af58459cc31a75384d0a950e480cf (diff)
downloadetbsa-traccar-web-16d579d1628bd8aa4a8d1f262ed70face50af907.tar.gz
etbsa-traccar-web-16d579d1628bd8aa4a8d1f262ed70face50af907.tar.bz2
etbsa-traccar-web-16d579d1628bd8aa4a8d1f262ed70face50af907.zip
Add Yandex map back
Diffstat (limited to 'web')
-rw-r--r--web/app/store/MapTypes.js6
-rw-r--r--web/app/view/map/BaseMap.js30
2 files changed, 35 insertions, 1 deletions
diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js
index dd889d4..9cca525 100644
--- a/web/app/store/MapTypes.js
+++ b/web/app/store/MapTypes.js
@@ -38,6 +38,12 @@ Ext.define('Traccar.store.MapTypes', {
key: 'bingHybrid',
name: Strings.mapBingHybrid
}, {
+ key: 'yandexMap',
+ name: Strings.mapYandexMap
+ }, {
+ key: 'yandexSat',
+ name: Strings.mapYandexSat
+ }, {
key: 'custom',
name: Strings.mapCustom
}, {
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js
index 6891598..0107acd 100644
--- a/web/app/view/map/BaseMap.js
+++ b/web/app/view/map/BaseMap.js
@@ -103,9 +103,29 @@ Ext.define('Traccar.view.map.BaseMap', {
})
}),
new ol.layer.Tile({
+ title: Strings.mapYandexMap,
+ type: 'base',
+ visible: type === 'yandexMap',
+ source: new ol.source.XYZ({
+ url: 'https://core-renderer-tiles.maps.yandex.net/tiles?l=map&x={x}&y={y}&z={z}',
+ projection: 'EPSG:3395',
+ attributions: '&copy; <a href="https://yandex.com/maps/">Yandex</a>'
+ })
+ }),
+ new ol.layer.Tile({
+ title: Strings.mapYandexSat,
+ type: 'base',
+ visible: type === 'yandexSat',
+ source: new ol.source.XYZ({
+ url: 'https://core-sat.maps.yandex.net/tiles?l=sat&x={x}&y={y}&z={z}',
+ projection: 'EPSG:3395',
+ attributions: '&copy; <a href="https://yandex.com/maps/">Yandex</a>'
+ })
+ }),
+ new ol.layer.Tile({
title: Strings.mapOsm,
type: 'base',
- visible: type === 'osm' || type === 'yandexMap' || type === 'yandexSat' || type === 'wikimedia' || !type,
+ visible: type === 'osm' || type === 'wikimedia' || !type,
source: new ol.source.OSM({})
})
]
@@ -204,4 +224,12 @@ Ext.define('Traccar.view.map.BaseMap', {
this.map.updateSize();
}
}
+}, function () {
+ var projection;
+ proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
+ ol.proj.proj4.register(proj4);
+ projection = ol.proj.get('EPSG:3395');
+ if (projection) {
+ projection.setExtent([-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]);
+ }
});