From 0824f4fd3355b7e63f6524e8ca21b5e57d77e757 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 25 Jul 2015 20:36:12 +1200 Subject: Allow map layer selection --- web/app/view/map/Map.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'web/app/view') 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 -- cgit v1.2.3