From 3d2caa78a0a7db5d6247b1a179a314804725bd8d Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Thu, 31 Jan 2019 02:53:47 +0000
Subject: [PATCH] tramIdToVehicleId translation using vehicles_info variable (again)

---
 map.js   |   11 +++++------
 map.html |    2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/map.html b/map.html
index 4530fe0..be21565 100644
--- a/map.html
+++ b/map.html
@@ -18,6 +18,6 @@
 <script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v5.3.0/build/ol.js" integrity="sha384-iQkGyyH4ioz3m+maM3s9MX1Oq67mACa4B9Z3ovUv3Sv37LJ96fx3WnZfLoiC3Wfl" crossorigin="anonymous"></script>
 <script tyle="text/javascript" src="lang_pl.js" id="lang_script"></script>
 <script tyle="text/javascript" src="common.js"></script>
-<script tyle="text/javascript" src="map.js?v2"></script>
+<script tyle="text/javascript" src="map.js?v3"></script>
 </body>
 </html>
diff --git a/map.js b/map.js
index 69cee4a..a4f4001 100644
--- a/map.js
+++ b/map.js
@@ -82,15 +82,13 @@
 				color_type = 'orange';
 			break;
 			case '1':
-				color_type = 'blue';
-			break;
 			case '2':
 				color_type = 'green';
 			break;
 		}
 	}
 	
-	var fill = '#F60';
+	var fill = '#B70';
 	if(vehicle.getId().startsWith('b')) {
 		fill = '#05B';
 	}
@@ -98,7 +96,7 @@
 		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({
@@ -206,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);
@@ -262,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);
@@ -840,6 +838,7 @@
 	});
 	
 	$.when(
+		updateVehicleInfo(),
 		updateTrams(),
 		updateBuses(),
 		updateStops(ttss_trams_base, 't'),

--
Gitblit v1.9.1