Improved www.ttss.krakow.pl
Jacek Kowalski
2018-12-18 b1632819ee6d2f5f01724d9ef2f69ced5f1c221e
Fix tramIdToVehicleId translation using vehicles_info variable
2 files modified
13 ■■■■ changed files
common.js 10 ●●●● patch | view | raw | blame | history
map.js 3 ●●●● patch | view | raw | blame | history
common.js
@@ -7,7 +7,7 @@
var script_version;
var script_version_xhr;
var vehicles_info;
var vehicles_info = {};
// Check for website updates
function checkVersion() {
@@ -105,10 +105,10 @@
}
function tramIdToVehicleId(tramId) {
    if(0 <= tramId && tramId <= 999) {
        var vehicleId = '0000' + (tramId + 736);
        vehicleId = vehicleId.substr(vehicleId.length - 4)
        return '635218529567218' + vehicleId;
    for(var prop in vehicles_info) {
        if(vehicles_info[prop]['num'].substr(2) == tramId) {
            return prop;
        }
    }
}
map.js
@@ -732,9 +732,8 @@
        stop_points_layer.setVisible(map.getView().getZoom() >= 16);
    });
    
    updateVehicleInfo()
    $.when(
        updateVehicleInfo(),
        updateVehicles(),
        updateStops(),
        updateStopPoints()