diff options
author | Abyss777 <abyss@fox5.ru> | 2018-01-17 13:51:03 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2018-01-17 13:51:03 +0500 |
commit | a4d24ce32e6376dce3416b1446391eabb74b6bc8 (patch) | |
tree | c18d9968355bc929ad57f9b21c3b238dfe87a8c9 | |
parent | ce58235447c9515e0abfacbe4c96093c852fdf98 (diff) | |
download | etbsa-traccar-web-a4d24ce32e6376dce3416b1446391eabb74b6bc8.tar.gz etbsa-traccar-web-a4d24ce32e6376dce3416b1446391eabb74b6bc8.tar.bz2 etbsa-traccar-web-a4d24ce32e6376dce3416b1446391eabb74b6bc8.zip |
Implement POI layer
-rw-r--r-- | web/app/model/Server.js | 5 | ||||
-rw-r--r-- | web/app/model/User.js | 5 | ||||
-rw-r--r-- | web/app/view/dialog/Server.js | 6 | ||||
-rw-r--r-- | web/app/view/dialog/User.js | 6 | ||||
-rw-r--r-- | web/app/view/map/BaseMap.js | 15 | ||||
-rw-r--r-- | web/l10n/en.json | 1 |
6 files changed, 32 insertions, 6 deletions
diff --git a/web/app/model/Server.js b/web/app/model/Server.js index da1618b..795bd60 100644 --- a/web/app/model/Server.js +++ b/web/app/model/Server.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,6 +62,9 @@ Ext.define('Traccar.model.Server', { name: 'coordinateFormat', type: 'string' }, { + name: 'poiLayer', + type: 'string' + }, { name: 'attributes' }], diff --git a/web/app/model/User.js b/web/app/model/User.js index 42b4fa7..5232c9f 100644 --- a/web/app/model/User.js +++ b/web/app/model/User.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,6 +81,9 @@ Ext.define('Traccar.model.User', { name: 'limitCommands', type: 'boolean' }, { + name: 'poiLayer', + type: 'string' + }, { name: 'token', type: 'string' }, { diff --git a/web/app/view/dialog/Server.js b/web/app/view/dialog/Server.js index a39408d..fbfb3c6 100644 --- a/web/app/view/dialog/Server.js +++ b/web/app/view/dialog/Server.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,6 +82,10 @@ Ext.define('Traccar.view.dialog.Server', { store: 'CoordinateFormats', displayField: 'name', valueField: 'key' + }, { + xtype: 'textfield', + name: 'poiLayer', + fieldLabel: Strings.mapPoiLayer }] }, { xtype: 'fieldset', diff --git a/web/app/view/dialog/User.js b/web/app/view/dialog/User.js index 45ecd6e..69bbd70 100644 --- a/web/app/view/dialog/User.js +++ b/web/app/view/dialog/User.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,6 +93,10 @@ Ext.define('Traccar.view.dialog.User', { store: 'CoordinateFormats', displayField: 'name', valueField: 'key' + }, { + xtype: 'textfield', + name: 'poiLayer', + fieldLabel: Strings.mapPoiLayer }] }, { xtype: 'fieldset', diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index c36e71a..68173a9 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -1,5 +1,5 @@ /* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ Ext.define('Traccar.view.map.BaseMap', { }, initMap: function () { - var server, layer, type, bingKey, lat, lon, zoom, maxZoom, target; + var server, layer, type, bingKey, lat, lon, zoom, maxZoom, target, poiLayer; server = Traccar.app.getServer(); @@ -153,6 +153,17 @@ Ext.define('Traccar.view.map.BaseMap', { view: this.mapView }); + poiLayer = Traccar.app.getPreference('poiLayer', null); + + if (poiLayer) { + this.map.addLayer(new ol.layer.Vector({ + source: new ol.source.Vector({ + url: poiLayer, + format: new ol.format.KML() + }) + })); + } + this.body.dom.tabIndex = 0; switch (Traccar.app.getAttributePreference('distanceUnit', 'km')) { diff --git a/web/l10n/en.json b/web/l10n/en.json index 78a2b65..e23d5a6 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -240,6 +240,7 @@ "mapShapeCircle": "Circle", "mapShapePolyline": "Polyline", "mapLiveRoutes": "Live Routes", + "mapPoiLayer": "POI Layer", "stateTitle": "State", "stateName": "Attribute", "stateValue": "Value", |