From 7a2fc1b6a2e7baee8c61fb70b5d5a38cad55b218 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sat, 22 Apr 2017 21:47:05 +0000
Subject: [PATCH] Mark front of the vehicle (closes #7)
---
map.js | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/map.js b/map.js
index e7b821d..f19bd45 100644
--- a/map.js
+++ b/map.js
@@ -114,14 +114,9 @@
}
vehicle_feature.setStyle(new ol.style.Style({
- image: new ol.style.RegularShape({
- fill: new ol.style.Fill({color: '#3399ff'}),
- stroke: new ol.style.Stroke({color: color_type, width: 2}),
- points: 3,
- radius: 12,
+ image: new ol.style.Icon({
+ src: 'data:image/svg+xml;base64,' + btoa('<svg xmlns="http://www.w3.org/2000/svg" height="30" width="20"><polygon points="10,0 20,23 0,23" style="fill:#3399ff;stroke:'+color_type+';stroke-width:2" /></svg>'),
rotation: Math.PI * parseFloat(vehicle.heading) / 180.0,
- rotateWithView: true,
- angle: 0
}),
text: new ol.style.Text({
font: 'bold 10px sans-serif',
--
Gitblit v1.9.1