aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/map/Map.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-12 10:55:18 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-12 10:55:18 +1200
commit8b0564efaaec36c2937f6cd748fda506b1e2fb9e (patch)
tree090fc6525da80e20d88c874d7deb8ae3e4bbe5bc /web/app/view/map/Map.js
parent0d0e118d44e8b43f351a75068c5e9077972b20c0 (diff)
downloadtraccar-server-8b0564efaaec36c2937f6cd748fda506b1e2fb9e.tar.gz
traccar-server-8b0564efaaec36c2937f6cd748fda506b1e2fb9e.tar.bz2
traccar-server-8b0564efaaec36c2937f6cd748fda506b1e2fb9e.zip
Add simple map marker
Diffstat (limited to 'web/app/view/map/Map.js')
-rw-r--r--web/app/view/map/Map.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/web/app/view/map/Map.js b/web/app/view/map/Map.js
index b63d87c9f..b1254aaf3 100644
--- a/web/app/view/map/Map.js
+++ b/web/app/view/map/Map.js
@@ -47,6 +47,8 @@ Ext.define('Traccar.view.map.Map', {
listeners: {
afterrender: function() {
+ var transform = this.transform;
+
/*var bindKey = 'AseEs0DLJhLlTNoxbNXu7DGsnnH4UoWuGue7-irwKkE3fffaClwc9q_Mr6AyHY8F';
var layer = new ol.layer.Tile({ source: new ol.source.BingMaps({
@@ -63,10 +65,22 @@ Ext.define('Traccar.view.map.Map', {
})});
this.vectorSource = new ol.source.Vector({});
- var vectorLayer = new ol.layer.Vector({ source: this.vectorSource });
+ var vectorLayer = new ol.layer.Vector({
+ source: this.vectorSource,
+ style: new ol.style.Style({
+ text: new ol.style.Text({
+ text: '\uf041',
+ font: 'normal 32px FontAwesome',
+ textBaseline: 'Bottom',
+ fill: new ol.style.Fill({
+ color: 'green'
+ })
+ })
+ })
+ });
var view = new ol.View({
- center: ol.proj.transform(styles.map_center, 'EPSG:4326', 'EPSG:3857'),
+ center: ol.proj.fromLonLat(styles.map_center),
zoom: styles.map_zoom,
maxZoom: styles.map_max_zoom
});
@@ -76,7 +90,13 @@ Ext.define('Traccar.view.map.Map', {
layers: [ layer, vectorLayer ],
view: view
});
-
+
+ var iconFeature = new ol.Feature({
+ geometry: new ol.geom.Point(ol.proj.fromLonLat([-1.257778, 51.751944]))
+ });
+
+ this.vectorSource.addFeature(iconFeature);
+
//this.update();
},