From c57bed6e3c5ae889c591c533d1cee93f5a761c9f Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Thu, 31 Jan 2019 03:01:24 +0000
Subject: [PATCH] Add special labels to mark non-passenger bus trips

---
 map.js |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/map.js b/map.js
index 10be16a..a4f4001 100644
--- a/map.js
+++ b/map.js
@@ -82,17 +82,21 @@
 				color_type = 'orange';
 			break;
 			case '1':
-				color_type = 'blue';
-			break;
 			case '2':
 				color_type = 'green';
 			break;
 		}
 	}
 	
-	var fill = (selected ? '#a00' : '#3399ff');
+	var fill = '#B70';
+	if(vehicle.getId().startsWith('b')) {
+		fill = '#05B';
+	}
+	if(selected) {
+		fill = '#292';
+	}
 	
-	var image = '<svg xmlns="http://www.w3.org/2000/svg" height="30" width="20"><polygon points="10,0 20,23 0,23" style="fill:'+fill+';stroke:'+color_type+';stroke-width:2" /></svg>';
+	var image = '<svg xmlns="http://www.w3.org/2000/svg" height="30" width="20"><polygon points="10,0 20,23 0,23" style="fill:'+fill+';stroke:'+color_type+';stroke-width:3" /></svg>';
 	
 	return new ol.style.Style({
 		image: new ol.style.Icon({
@@ -200,7 +204,7 @@
 			}
 			
 			vehicle.geometry = getGeometry(vehicle);
-			vehicle.vehicle_type = parseVehicle(vehicle.id);
+			vehicle.vehicle_type = parseVehicle('t' + vehicle.id);
 			
 			if(!vehicle_feature) {
 				vehicle_feature = new ol.Feature(vehicle);
@@ -256,7 +260,7 @@
 			}
 			
 			vehicle.geometry = getGeometry(vehicle);
-			vehicle.vehicle_type = parseVehicle(vehicle.id);
+			vehicle.vehicle_type = parseVehicle('b' + vehicle.id);
 			
 			if(!vehicle_feature) {
 				vehicle_feature = new ol.Feature(vehicle);
@@ -834,6 +838,7 @@
 	});
 	
 	$.when(
+		updateVehicleInfo(),
 		updateTrams(),
 		updateBuses(),
 		updateStops(ttss_trams_base, 't'),

--
Gitblit v1.9.1