aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-18 15:02:04 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-18 15:02:04 +1200
commit601ffd5cc7e1d6fa66938915264cd2c1d1dbf8bc (patch)
tree8553cfa022feb2f8418157e5b3bba9b3a27964a4
parent04d300ca65f448301047c6f97bd88da13026b2bc (diff)
downloadtrackermap-server-601ffd5cc7e1d6fa66938915264cd2c1d1dbf8bc.tar.gz
trackermap-server-601ffd5cc7e1d6fa66938915264cd2c1d1dbf8bc.tar.bz2
trackermap-server-601ffd5cc7e1d6fa66938915264cd2c1d1dbf8bc.zip
Force initial async update
-rw-r--r--src/org/traccar/http/AsyncServlet.java2
-rw-r--r--web/app/Resources.js8
-rw-r--r--web/app/view/map/MapController.js9
3 files changed, 11 insertions, 8 deletions
diff --git a/src/org/traccar/http/AsyncServlet.java b/src/org/traccar/http/AsyncServlet.java
index 16402e24b..5481f4ba3 100644
--- a/src/org/traccar/http/AsyncServlet.java
+++ b/src/org/traccar/http/AsyncServlet.java
@@ -181,7 +181,7 @@ public class AsyncServlet extends HttpServlet {
synchronized (asyncSessions) {
- if (!asyncSessions.containsKey(user.getId())) {
+ if (Boolean.valueOf(req.getParameter("first")) || !asyncSessions.containsKey(user.getId())) {
Collection<Long> devices = Context.getPermissionsManager().allowedDevices(user.getId());
asyncSessions.put(user.getId(), new AsyncSession(user.getId(), devices));
}
diff --git a/web/app/Resources.js b/web/app/Resources.js
index e08996e2b..fe08fb943 100644
--- a/web/app/Resources.js
+++ b/web/app/Resources.js
@@ -96,13 +96,13 @@ var styles = {
map_center: [ -0.1275, 51.507222 ],
map_zoom: 6,
map_max_zoom: 16,
- map_select_color: 'green',
+ map_select_color: 'rgba(0, 255, 0, 1.0)',
map_select_radius: 10,
- map_report_color: 'blue',
+ map_report_color: 'rgba(0, 0, 255, 1.0)',
map_report_radius: 5,
- map_live_color: 'red',
+ map_live_color: 'rgba(255, 0, 0, 1.0)',
map_live_radius: 7,
- map_stroke_color: 'grey',
+ map_stroke_color: 'rgba(50, 50, 50, 1.0)',
map_route_width: 5,
map_marker_stroke: 2,
map_delay: 500
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js
index a0f167ec3..9e009218e 100644
--- a/web/app/view/map/MapController.js
+++ b/web/app/view/map/MapController.js
@@ -33,13 +33,16 @@ Ext.define('Traccar.view.map.MapController', {
init: function() {
this.liveData = {};
- this.update();
+ this.update(true);
},
- update: function() {
+ update: function(first) {
Ext.Ajax.request({
scope: this,
url: '/api/async',
+ params: {
+ first: first
+ },
success: function(response) {
var data = Ext.decode(response.responseText).data;
@@ -63,7 +66,7 @@ Ext.define('Traccar.view.map.MapController', {
}
}
- this.update();
+ this.update(false);
},
failure: function() {
// TODO: error