aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 20:36:12 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 20:36:12 +1200
commit0824f4fd3355b7e63f6524e8ca21b5e57d77e757 (patch)
tree38f2ff42d41277605b60140b8683c246a6faaf5d /web
parentdeb288877b8faa69c763c96ada7529380141af7f (diff)
downloadtrackermap-server-0824f4fd3355b7e63f6524e8ca21b5e57d77e757.tar.gz
trackermap-server-0824f4fd3355b7e63f6524e8ca21b5e57d77e757.tar.bz2
trackermap-server-0824f4fd3355b7e63f6524e8ca21b5e57d77e757.zip
Allow map layer selection
Diffstat (limited to 'web')
-rw-r--r--web/app/store/MapTypes.js3
-rw-r--r--web/app/view/map/Map.js23
-rw-r--r--web/l10n/en.js6
3 files changed, 26 insertions, 6 deletions
diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js
index 09636e3a0..ef63fd92b 100644
--- a/web/app/store/MapTypes.js
+++ b/web/app/store/MapTypes.js
@@ -19,6 +19,7 @@ Ext.define('Traccar.store.MapTypes', {
fields: ['key', 'name'],
data : [
{'key': 'osm', 'name': strings.map_osm},
- {'key': 'bing', 'name': strings.map_bing}
+ {'key': 'bingRoad', 'name': strings.map_bing_road},
+ {'key': 'bingAerial', 'name': strings.map_bing_aerial}
]
});
diff --git a/web/app/view/map/Map.js b/web/app/view/map/Map.js
index bf1f1328b..b4fa8338f 100644
--- a/web/app/view/map/Map.js
+++ b/web/app/view/map/Map.js
@@ -30,9 +30,26 @@ Ext.define('Traccar.view.map.Map', {
listeners: {
afterrender: function() {
- var layer = new ol.layer.Tile({ source: new ol.source.OSM({
- })});
-
+ var layer;
+ var mapLayer = Traccar.getApplication().getUser().get('map') || Traccar.getApplication().getServer().get('map');
+
+ var bindKey = 'AseEs0DLJhLlTNoxbNXu7DGsnnH4UoWuGue7-irwKkE3fffaClwc9q_Mr6AyHY8F';
+
+ if (mapLayer === 'bingRoad') {
+ var layer = new ol.layer.Tile({ source: new ol.source.BingMaps({
+ key: bindKey,
+ imagerySet: 'Road'
+ })});
+ } else if (mapLayer === 'bingAerial') {
+ var layer = new ol.layer.Tile({ source: new ol.source.BingMaps({
+ key: bindKey,
+ imagerySet: 'Aerial'
+ })});
+ } else {
+ layer = new ol.layer.Tile({ source: new ol.source.OSM({
+ })});
+ }
+
this.vectorSource = new ol.source.Vector({});
var vectorLayer = new ol.layer.Vector({
source: this.vectorSource
diff --git a/web/l10n/en.js b/web/l10n/en.js
index 2fedbb754..97612e56a 100644
--- a/web/l10n/en.js
+++ b/web/l10n/en.js
@@ -30,6 +30,7 @@ var strings = {
device_title: 'Devices',
device_name: 'Name',
device_identifier: 'Identifier',
+ device_command: 'Command',
settings_title: 'Settings',
settings_user: 'Account',
@@ -61,8 +62,9 @@ var strings = {
map_title: 'Map',
map_layer: 'Map Layer',
- map_osm: 'OpenStreetMap',
- map_bing: 'Bing Maps',
+ map_osm: 'Open Street Map',
+ map_bing_road: 'Bing Maps Road',
+ map_bing_aerial: 'Bing Maps Aerial',
state_title: 'State',
state_name: 'Parameter',