Improved www.ttss.krakow.pl
Jacek Kowalski
2018-12-18 3d2caa78a0a7db5d6247b1a179a314804725bd8d
tramIdToVehicleId translation using vehicles_info variable (again)
2 files modified
13 ■■■■ changed files
map.html 2 ●●● patch | view | raw | blame | history
map.js 11 ●●●● patch | view | raw | blame | history
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>
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'),