From 3195e708dc18c82f07869267738e43f08bd74696 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 23 Aug 2015 21:38:39 +1200 Subject: Move Bing key into settings --- web/app/model/Server.js | 1 + web/app/view/admin/ServerDialog.js | 4 ++++ web/app/view/map/Map.js | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'web/app') diff --git a/web/app/model/Server.js b/web/app/model/Server.js index 9e4ab1eec..b7d356226 100644 --- a/web/app/model/Server.js +++ b/web/app/model/Server.js @@ -22,6 +22,7 @@ Ext.define('Traccar.model.Server', { { name: 'id', type: 'int' }, { name: 'registration', type: 'boolean' }, { name: 'map', type: 'string' }, + { name: 'bingKey', type: 'string' }, { name: 'language', type: 'string' }, { name: 'distanceUnit', type: 'string' }, { name: 'speedUnit', type: 'string' }, diff --git a/web/app/view/admin/ServerDialog.js b/web/app/view/admin/ServerDialog.js index 37bb498a0..7e316c8a6 100644 --- a/web/app/view/admin/ServerDialog.js +++ b/web/app/view/admin/ServerDialog.js @@ -42,6 +42,10 @@ Ext.define('Traccar.view.admin.ServerDialog', { store: 'MapTypes', displayField: 'name', valueField: 'key' + }, { + xtype: 'textfield', + name: 'bingKey', + fieldLabel: strings.mapBingKey }, { xtype: 'combobox', name: 'distanceUnit', diff --git a/web/app/view/map/Map.js b/web/app/view/map/Map.js index 9d9a92886..db7dde02e 100644 --- a/web/app/view/map/Map.js +++ b/web/app/view/map/Map.js @@ -36,16 +36,16 @@ Ext.define('Traccar.view.map.Map', { var layer; var mapLayer = user.get('map') || server.get('map'); - var bindKey = 'AseEs0DLJhLlTNoxbNXu7DGsnnH4UoWuGue7-irwKkE3fffaClwc9q_Mr6AyHY8F'; + var bingKey = server.get('bingKey'); if (mapLayer === 'bingRoad') { layer = new ol.layer.Tile({ source: new ol.source.BingMaps({ - key: bindKey, + key: bingKey, imagerySet: 'Road' })}); } else if (mapLayer === 'bingAerial') { layer = new ol.layer.Tile({ source: new ol.source.BingMaps({ - key: bindKey, + key: bingKey, imagerySet: 'Aerial' })}); } else { -- cgit v1.2.3