From e314abba557cc8b87e67b6399f52b833e7de0751 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 30 Aug 2017 08:51:25 +0500 Subject: Add Max Zoom attribute --- web/app/store/CommonUserAttributes.js | 7 +++++++ web/app/view/map/BaseMap.js | 5 +++-- web/l10n/en.json | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/app/store/CommonUserAttributes.js b/web/app/store/CommonUserAttributes.js index 85d652df..d07d955d 100644 --- a/web/app/store/CommonUserAttributes.js +++ b/web/app/store/CommonUserAttributes.js @@ -31,6 +31,13 @@ Ext.define('Traccar.store.CommonUserAttributes', { allowDecimals: false, minValue: Traccar.Style.mapDefaultZoom, maxValue: Traccar.Style.mapMaxZoom + }, { + key: 'web.maxZoom', + name: Strings.attributeWebMaxZoom, + valueType: 'number', + allowDecimals: false, + minValue: Traccar.Style.mapDefaultZoom, + maxValue: Traccar.Style.mapMaxZoom }, { key: 'ui.disableReport', name: Strings.attributeUiDisableReport, diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index c6eb5b48..a0d346ec 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -30,7 +30,7 @@ Ext.define('Traccar.view.map.BaseMap', { }, initMap: function () { - var server, layer, type, bingKey, lat, lon, zoom, target; + var server, layer, type, bingKey, lat, lon, zoom, maxZoom, target; server = Traccar.app.getServer(); @@ -161,11 +161,12 @@ Ext.define('Traccar.view.map.BaseMap', { lat = Traccar.app.getPreference('latitude', Traccar.Style.mapDefaultLat); lon = Traccar.app.getPreference('longitude', Traccar.Style.mapDefaultLon); zoom = Traccar.app.getPreference('zoom', Traccar.Style.mapDefaultZoom); + maxZoom = Traccar.app.getAttributePreference('web.maxZoom', Traccar.Style.mapMaxZoom); this.mapView = new ol.View({ center: ol.proj.fromLonLat([lon, lat]), zoom: zoom, - maxZoom: Traccar.Style.mapMaxZoom + maxZoom: maxZoom }); this.map = new ol.Map({ diff --git a/web/l10n/en.json b/web/l10n/en.json index 69df1563..f9466408 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -77,6 +77,7 @@ "attributeColor": "Color", "attributeWebLiveRouteLength": "Web: Live Route Length", "attributeWebSelectZoom": "Web: Zoom On Select", + "attributeWebMaxZoom": "Web: Maximum Zoom", "attributeMailSmtpHost": "Mail: SMTP Host", "attributeMailSmtpPort": "Mail: SMTP Port", "attributeMailSmtpStarttlsEnable": "Mail: SMTP STARTTLS Enable", -- cgit v1.2.3