diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-18 17:49:20 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 17:49:20 +1300 |
commit | 264341273746efdedab8adf663eb1a7eecac595b (patch) | |
tree | c18d9968355bc929ad57f9b21c3b238dfe87a8c9 /web/app/view/map/BaseMap.js | |
parent | ce58235447c9515e0abfacbe4c96093c852fdf98 (diff) | |
parent | a4d24ce32e6376dce3416b1446391eabb74b6bc8 (diff) | |
download | etbsa-traccar-web-264341273746efdedab8adf663eb1a7eecac595b.tar.gz etbsa-traccar-web-264341273746efdedab8adf663eb1a7eecac595b.tar.bz2 etbsa-traccar-web-264341273746efdedab8adf663eb1a7eecac595b.zip |
Merge pull request #642 from Abyss777/poi_layer
Implement POI layer
Diffstat (limited to 'web/app/view/map/BaseMap.js')
-rw-r--r-- | web/app/view/map/BaseMap.js | 15 |
1 files changed, 13 insertions, 2 deletions
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')) { |