aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-17 19:54:33 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-17 19:54:33 +1200
commit1a4dbe41223f253d649fba8b506b70c7a447a1ff (patch)
tree840301185bb1adfef285d487dc68043adfddca68
parent31153730de44a31b87c8131d95de1127d2758508 (diff)
downloadtrackermap-server-1a4dbe41223f253d649fba8b506b70c7a447a1ff.tar.gz
trackermap-server-1a4dbe41223f253d649fba8b506b70c7a447a1ff.tar.bz2
trackermap-server-1a4dbe41223f253d649fba8b506b70c7a447a1ff.zip
Apply custom marker style
-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
+ })
})
});
},