aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-02 09:29:08 +0700
committerAbyss777 <abyss@fox5.ru>2016-12-02 09:29:08 +0700
commitea09b2e85e014d438084a454fae7c0cce57d9773 (patch)
treea19c942034f2404a4e44bd7655b46f769c0691a5 /web/app
parent1aae9dee5ecd797c3c2d2a6e985f605d783620ee (diff)
downloadetbsa-traccar-web-ea09b2e85e014d438084a454fae7c0cce57d9773.tar.gz
etbsa-traccar-web-ea09b2e85e014d438084a454fae7c0cce57d9773.tar.bz2
etbsa-traccar-web-ea09b2e85e014d438084a454fae7c0cce57d9773.zip
- Remove single event
- Redo ol.extent calculation with less compares - Uncomment url manipulation
Diffstat (limited to 'web/app')
-rw-r--r--web/app/controller/Root.js2
-rw-r--r--web/app/view/MapMarkerController.js13
-rw-r--r--web/app/view/ReportController.js4
3 files changed, 11 insertions, 8 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 1e83a45..87c4cf5 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -97,7 +97,7 @@ Ext.define('Traccar.controller.Root', {
eventId = Ext.Object.fromQueryString(window.location.search).eventId;
if (eventId) {
this.fireEvent('showsingleevent', eventId);
- //this.removeUrlParameter('eventId');
+ this.removeUrlParameter('eventId');
}
},
diff --git a/web/app/view/MapMarkerController.js b/web/app/view/MapMarkerController.js
index a526d91..5fa9f4c 100644
--- a/web/app/view/MapMarkerController.js
+++ b/web/app/view/MapMarkerController.js
@@ -229,10 +229,15 @@ Ext.define('Traccar.view.MapMarkerController', {
position.get('longitude'),
position.get('latitude')
]);
- minx = minx ? Math.min(point[0], minx) : point[0];
- miny = miny ? Math.min(point[1], miny) : point[1];
- maxx = maxx ? Math.max(point[0], maxx) : point[0];
- maxy = maxy ? Math.max(point[1], maxy) : point[1];
+ if (i === 0) {
+ minx = maxx = point[0];
+ miny = maxy = point[1];
+ } else {
+ minx = Math.min(point[0], minx);
+ miny = Math.min(point[1], miny);
+ maxx = Math.max(point[0], maxx);
+ maxy = Math.max(point[1], maxy);
+ }
geometry = new ol.geom.Point(point);
marker = new ol.Feature(geometry);
marker.set('record', position);
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index 2ad2bdd..1f3f3a2 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -214,8 +214,7 @@ Ext.define('Traccar.view.ReportController', {
callback: function (records, operation, success) {
if (success) {
Ext.getStore('ReportRoute').add(records);
- if (this.singleEvent && records.length > 0) {
- this.singleEvent = false;
+ if (records.length === 1) {
this.fireEvent('selectreport', records[0], false);
}
}
@@ -225,7 +224,6 @@ Ext.define('Traccar.view.ReportController', {
},
showSingleEvent: function (eventId) {
- this.singleEvent = true;
this.lookupReference('reportTypeField').setValue('events');
Ext.getStore('Events').load({
id: eventId,