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.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/web/app/view/Map.js b/web/app/view/Map.js
index 9a032e79f..849f678a7 100644
--- a/web/app/view/Map.js
+++ b/web/app/view/Map.js
@@ -27,6 +27,18 @@ Ext.define('Traccar.view.Map', {
title: Strings.mapTitle,
layout: 'fit',
+ getMap: function () {
+ return this.map;
+ },
+
+ getMapView: function () {
+ return this.mapView;
+ },
+
+ getVectorSource: function () {
+ return this.vectorSource;
+ },
+
listeners: {
afterrender: function () {
var user, server, layer, type, bingKey, vectorLayer, lat, lon, zoom;
@@ -40,7 +52,10 @@ Ext.define('Traccar.view.Map', {
if (type === 'custom') {
layer = new ol.layer.Tile({
source: new ol.source.XYZ({
- url: server.get('mapUrl')
+ url: server.get('mapUrl'),
+ attributions: [new ol.Attribution({
+ html: ''
+ })]
})
});
} else if (type === 'bingRoad') {
@@ -83,6 +98,12 @@ Ext.define('Traccar.view.Map', {
layers: [layer, vectorLayer],
view: this.mapView
});
+
+ this.map.on('click', function (e) {
+ this.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
+ this.fireEvent('selectFeature', feature);
+ }, this);
+ }, this);
},
resize: function () {