From a4d24ce32e6376dce3416b1446391eabb74b6bc8 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 17 Jan 2018 13:51:03 +0500 Subject: Implement POI layer --- web/app/view/map/BaseMap.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'web/app/view/map') diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index c36e71a6..68173a99 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')) { -- cgit v1.2.3