diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-10-08 16:16:55 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-10-08 16:16:55 +1300 |
commit | efbaeb0393df7532dd7865f0e77171209f4e9363 (patch) | |
tree | 39c1523d5e89ac2ac40738dbfab369cc23fc5bde /web/app/view/BaseMap.js | |
parent | 58d7f195375a8d32f5260da7d4cea437ad564223 (diff) | |
download | trackermap-web-efbaeb0393df7532dd7865f0e77171209f4e9363.tar.gz trackermap-web-efbaeb0393df7532dd7865f0e77171209f4e9363.tar.bz2 trackermap-web-efbaeb0393df7532dd7865f0e77171209f4e9363.zip |
Option to force server settings
Diffstat (limited to 'web/app/view/BaseMap.js')
-rw-r--r-- | web/app/view/BaseMap.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/web/app/view/BaseMap.js b/web/app/view/BaseMap.js index 3a0f4420..e37b5cf3 100644 --- a/web/app/view/BaseMap.js +++ b/web/app/view/BaseMap.js @@ -30,12 +30,11 @@ Ext.define('Traccar.view.BaseMap', { }, initMap: function () { - var user, server, layer, type, bingKey, lat, lon, zoom, target; + var server, layer, type, bingKey, lat, lon, zoom, target; - user = Traccar.app.getUser(); server = Traccar.app.getServer(); - type = user.get('map') || server.get('map'); + type = Traccar.app.getPreference('map', null); bingKey = server.get('bingKey'); if (type === 'custom') { @@ -88,9 +87,9 @@ Ext.define('Traccar.view.BaseMap', { }); } - lat = user.get('latitude') || server.get('latitude') || Traccar.Style.mapDefaultLat; - lon = user.get('longitude') || server.get('longitude') || Traccar.Style.mapDefaultLon; - zoom = user.get('zoom') || server.get('zoom') || Traccar.Style.mapDefaultZoom; + lat = Traccar.app.getPreference('latitude', Traccar.Style.mapDefaultLat); + lon = Traccar.app.getPreference('longitude', Traccar.Style.mapDefaultLon); + zoom = Traccar.app.getPreference('zoom', Traccar.Style.mapDefaultZoom); this.mapView = new ol.View({ center: ol.proj.fromLonLat([lon, lat]), |