diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-30 22:31:24 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-30 22:31:24 +1300 |
commit | 37001649c81ab0d9eb31b517fc0def473440fb21 (patch) | |
tree | 63cbceb8bc3e4eaf783f53342a6d7cc0c9c3fcb7 /web | |
parent | f5030b90ecde5a50e05cd81ed8d08b6387b8dead (diff) | |
parent | c142bc62a8f004630efac97cf15eb9ba604c3981 (diff) | |
download | etbsa-traccar-web-37001649c81ab0d9eb31b517fc0def473440fb21.tar.gz etbsa-traccar-web-37001649c81ab0d9eb31b517fc0def473440fb21.tar.bz2 etbsa-traccar-web-37001649c81ab0d9eb31b517fc0def473440fb21.zip |
Merge pull request #378 from Abyss777/not_show_markers
Add an option to not show report markers
Diffstat (limited to 'web')
-rw-r--r-- | web/app/view/MapMarkerController.js | 18 | ||||
-rw-r--r-- | web/app/view/ReportConfigController.js | 3 | ||||
-rw-r--r-- | web/app/view/ReportConfigDialog.js | 7 | ||||
-rw-r--r-- | web/app/view/ReportController.js | 6 | ||||
-rw-r--r-- | web/l10n/en.json | 1 |
5 files changed, 25 insertions, 10 deletions
diff --git a/web/app/view/MapMarkerController.js b/web/app/view/MapMarkerController.js index 907451b..0a87b5d 100644 --- a/web/app/view/MapMarkerController.js +++ b/web/app/view/MapMarkerController.js @@ -240,15 +240,15 @@ Ext.define('Traccar.view.MapMarkerController', { 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); - style = this.getReportMarker(position.get('deviceId'), position.get('course')); - /*style.getText().setText( - Ext.Date.format(position.get('fixTime'), Traccar.Style.dateTimeFormat24));*/ - marker.setStyle(style); - this.reportMarkers[position.get('id')] = marker; - this.getView().getMarkersSource().addFeature(marker); + if (store.showMarkers !== false) { + geometry = new ol.geom.Point(point); + marker = new ol.Feature(geometry); + marker.set('record', position); + style = this.getReportMarker(position.get('deviceId'), position.get('course')); + marker.setStyle(style); + this.reportMarkers[position.get('id')] = marker; + this.getView().getMarkersSource().addFeature(marker); + } } if (minx !== maxx || miny !== maxy) { this.getView().getMapView().fit([minx, miny, maxx, maxy], this.getView().getMap().getSize()); diff --git a/web/app/view/ReportConfigController.js b/web/app/view/ReportConfigController.js index f76a082..955b2e9 100644 --- a/web/app/view/ReportConfigController.js +++ b/web/app/view/ReportConfigController.js @@ -57,8 +57,9 @@ Ext.define('Traccar.view.ReportConfigController', { } else if (eventType.length === this.lookupReference('eventTypeField').getStore().getCount() - 1) { eventType = [Traccar.store.ReportEventTypes.allEvents]; } - this.getView().callingPanel.chartType = this.lookupReference('chartTypeField').getValue(); this.getView().callingPanel.eventType = eventType; + this.getView().callingPanel.chartType = this.lookupReference('chartTypeField').getValue(); + this.getView().callingPanel.showMarkers = this.lookupReference('showMarkersField').getValue(); this.getView().callingPanel.fromDate = this.lookupReference('fromDateField').getValue(); this.getView().callingPanel.fromTime = this.lookupReference('fromTimeField').getValue(); this.getView().callingPanel.toDate = this.lookupReference('toDateField').getValue(); diff --git a/web/app/view/ReportConfigDialog.js b/web/app/view/ReportConfigDialog.js index d9cf847..8d42334 100644 --- a/web/app/view/ReportConfigDialog.js +++ b/web/app/view/ReportConfigDialog.js @@ -67,6 +67,13 @@ Ext.define('Traccar.view.ReportConfigDialog', { displayField: 'name', queryMode: 'local' }, { + fieldLabel: Strings.reportShowMarkers, + xtype: 'checkbox', + reference: 'showMarkersField', + inputValue: true, + uncheckedValue: false, + value: true + }, { xtype: 'fieldcontainer', layout: 'hbox', items: [{ diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index 0064c5b..d53abed 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -79,6 +79,9 @@ Ext.define('Traccar.view.ReportController', { if (this.chartType !== undefined) { dialog.lookupReference('chartTypeField').setValue(this.chartType); } + if (this.showMarkers !== undefined) { + dialog.lookupReference('showMarkersField').setValue(this.showMarkers); + } if (this.fromDate !== undefined) { dialog.lookupReference('fromDateField').setValue(this.fromDate); } @@ -125,6 +128,7 @@ Ext.define('Traccar.view.ReportController', { } else { store = this.getGrid().getStore(); } + store.showMarkers = this.showMarkers; store.load({ params: { deviceId: this.deviceId, @@ -207,6 +211,7 @@ Ext.define('Traccar.view.ReportController', { from = new Date(trip.get('startTime')); to = new Date(trip.get('endTime')); Ext.getStore('ReportRoute').removeAll(); + Ext.getStore('ReportRoute').showMarkers = this.showMarkers; Ext.getStore('ReportRoute').load({ params: { deviceId: trip.get('deviceId'), @@ -243,6 +248,7 @@ Ext.define('Traccar.view.ReportController', { scope: this, callback: function (records, operation, success) { if (success) { + Ext.getStore('ReportRoute').showMarkers = this.showMarkers; Ext.getStore('ReportRoute').add(records); if (records.length === 1) { this.fireEvent('selectreport', records[0], false); diff --git a/web/l10n/en.json b/web/l10n/en.json index 7b59e68..c760ea2 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -189,6 +189,7 @@ "reportConfigure": "Configure", "reportEventTypes": "Event Types", "reportChartType": "Chart Type", + "reportShowMarkers": "Show Markers", "reportExport": "Export", "reportDeviceName": "Device Name", "reportAverageSpeed": "Average Speed", |