aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/database/DataManager.java5
-rw-r--r--web/app/view/map/MapController.js27
2 files changed, 28 insertions, 4 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 807a75f34..2b5373197 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -34,7 +34,6 @@ import javax.naming.InitialContext;
import javax.sql.DataSource;
import org.traccar.Context;
import org.traccar.helper.DriverDelegate;
-import org.traccar.helper.Hashing;
import org.traccar.helper.Log;
import org.traccar.http.JsonConverter;
import org.traccar.model.Device;
@@ -200,6 +199,10 @@ public class DataManager {
position.setLatitude(-36.8932371);
position.setLongitude(174.7743053);
addPosition(position);
+
+ QueryBuilder.create(dataSource, properties.getProperty("database.updateLatestPosition"))
+ .setObject(position)
+ .executeUpdate();
} catch (SQLException error) {
Log.warning(error);
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js
index 5cde39494..b0ab0bb58 100644
--- a/web/app/view/map/MapController.js
+++ b/web/app/view/map/MapController.js
@@ -55,9 +55,20 @@ Ext.define('Traccar.view.map.MapController', {
this.liveData[data[i].deviceId].setGeometry(geometry);
} else {
var marker = new ol.Feature({
- geometry: geometry,
- style: this.getLineStyle(styles.map_live_marker)
+ geometry: geometry
});
+ marker.setStyle(new ol.style.Style({
+ image: new ol.style.Circle({
+ radius: 40,
+ fill: new ol.style.Fill({
+ color: 'rgba(150,150,200,0.6)'
+ }),
+ stroke: new ol.style.Stroke({
+ color: 'rgba(20,30,100,0.8)',
+ width: 3
+ })
+ })
+ }));
this.getView().vectorSource.addFeature(marker);
this.liveData[data[i].deviceId] = marker;
}
@@ -73,12 +84,22 @@ Ext.define('Traccar.view.map.MapController', {
getLineStyle: function(color) {
return new ol.style.Style({
- fill: new ol.style.Fill({
+ /*fill: new ol.style.Fill({
color: color
}),
stroke: new ol.style.Stroke({
color: color,
width: styles.map_route_width
+ }),*/
+ image: new ol.style.Circle({
+ radius: 40,
+ fill: new ol.style.Fill({
+ color: 'rgba(150,150,200,0.6)'
+ }),
+ stroke: new ol.style.Stroke({
+ color: 'rgba(20,30,100,0.8)',
+ width: 3
+ })
})
});
},