aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/Map.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/Map.js')
-rw-r--r--web/app/view/Map.js32
1 files changed, 25 insertions, 7 deletions
diff --git a/web/app/view/Map.js b/web/app/view/Map.js
index 7d81699a3..b8c0d8dc5 100644
--- a/web/app/view/Map.js
+++ b/web/app/view/Map.js
@@ -35,13 +35,21 @@ Ext.define('Traccar.view.Map', {
return this.mapView;
},
- getVectorSource: function () {
- return this.vectorSource;
+ getLatestSource: function () {
+ return this.latestSource;
+ },
+
+ getRouteSource: function () {
+ return this.routeSource;
+ },
+
+ getReportSource: function () {
+ return this.reportSource;
},
listeners: {
afterrender: function () {
- var user, server, layer, type, bingKey, vectorLayer, lat, lon, zoom, target;
+ var user, server, layer, type, bingKey, latestLayer, routeLayer, reportLayer, lat, lon, zoom, target;
user = Traccar.app.getUser();
server = Traccar.app.getServer();
@@ -78,9 +86,19 @@ Ext.define('Traccar.view.Map', {
});
}
- this.vectorSource = new ol.source.Vector({});
- vectorLayer = new ol.layer.Vector({
- source: this.vectorSource
+ this.latestSource = new ol.source.Vector({});
+ latestLayer = new ol.layer.Vector({
+ source: this.latestSource
+ });
+
+ this.routeSource = new ol.source.Vector({});
+ routeLayer = new ol.layer.Vector({
+ source: this.routeSource
+ });
+
+ this.reportSource = new ol.source.Vector({});
+ reportLayer = new ol.layer.Vector({
+ source: this.reportSource
});
lat = user.get('latitude') || server.get('latitude') || Traccar.Style.mapDefaultLat;
@@ -95,7 +113,7 @@ Ext.define('Traccar.view.Map', {
this.map = new ol.Map({
target: this.body.dom.id,
- layers: [layer, vectorLayer],
+ layers: [layer, routeLayer, reportLayer, latestLayer],
view: this.mapView
});