aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-23 21:38:39 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-23 21:38:39 +1200
commit3195e708dc18c82f07869267738e43f08bd74696 (patch)
tree74ff67d905a4b50d8ca73320619bbaf540e618fb
parent1d01b029eef451f2e340fe0807f861bea034e442 (diff)
downloadtrackermap-server-3195e708dc18c82f07869267738e43f08bd74696.tar.gz
trackermap-server-3195e708dc18c82f07869267738e43f08bd74696.tar.bz2
trackermap-server-3195e708dc18c82f07869267738e43f08bd74696.zip
Move Bing key into settings
-rw-r--r--debug.xml2
-rw-r--r--src/org/traccar/model/Server.java4
-rw-r--r--web/app/model/Server.js1
-rw-r--r--web/app/view/admin/ServerDialog.js4
-rw-r--r--web/app/view/map/Map.js6
-rw-r--r--web/l10n/en.js1
6 files changed, 15 insertions, 3 deletions
diff --git a/debug.xml b/debug.xml
index 099291725..ff78736bb 100644
--- a/debug.xml
+++ b/debug.xml
@@ -124,6 +124,7 @@
id INT PRIMARY KEY AUTO_INCREMENT,
registration BIT NOT NULL,
map VARCHAR(128),
+ bingKey VARCHAR(128),
language VARCHAR(128),
distanceUnit VARCHAR(128),
speedUnit VARCHAR(128),
@@ -150,6 +151,7 @@
UPDATE server SET
registration = :registration,
map = :map,
+ bingKey = :bingKey,
language = :language,
distanceUnit = :distanceUnit,
speedUnit = :speedUnit,
diff --git a/src/org/traccar/model/Server.java b/src/org/traccar/model/Server.java
index f5ad4887c..fb27b796a 100644
--- a/src/org/traccar/model/Server.java
+++ b/src/org/traccar/model/Server.java
@@ -34,6 +34,10 @@ public class Server implements Factory {
public String getMap() { return map; }
public void setMap(String map) { this.map = map; }
+ private String bingKey;
+ public String getBingKey() { return bingKey; }
+ public void setBingKey(String bingKey) { this.bingKey = bingKey; }
+
private String language;
public String getLanguage() { return language; }
public void setLanguage(String language) { this.language = language; }
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
@@ -43,6 +43,10 @@ Ext.define('Traccar.view.admin.ServerDialog', {
displayField: 'name',
valueField: 'key'
}, {
+ xtype: 'textfield',
+ name: 'bingKey',
+ fieldLabel: strings.mapBingKey
+ }, {
xtype: 'combobox',
name: 'distanceUnit',
fieldLabel: strings.settingsDistanceUnit,
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 {
diff --git a/web/l10n/en.js b/web/l10n/en.js
index 33c494a54..0ae9bea78 100644
--- a/web/l10n/en.js
+++ b/web/l10n/en.js
@@ -67,6 +67,7 @@ var strings = {
mapTitle: 'Map',
mapLayer: 'Map Layer',
mapOsm: 'Open Street Map',
+ mapBingKey: 'Bing Maps Key',
mapBingRoad: 'Bing Maps Road',
mapBingAerial: 'Bing Maps Aerial',