| | |
| | | var vehicles_info = {}; |
| | | |
| | | var stops_xhr = null; |
| | | var stops_ignored = ['131', '744', '1263']; |
| | | var stops_ignored = ['131', '744', '1263', '3039']; |
| | | var stops_style = { |
| | | 'sb': new ol.style.Style({ |
| | | image: new ol.style.Circle({ |
| | |
| | | })}, 10); |
| | | }; |
| | | showOnMapElement.addEventListener('click', showOnMapFunction); |
| | | showOnMapElement.className = 'icon-zoom pad-left-icon'; |
| | | showOnMapElement.className = 'icon-pin addon-icon'; |
| | | showOnMapElement.title = lang.show_on_map; |
| | | |
| | | if(additional) { |
| | |
| | | typeName = lang.types[full_type]; |
| | | if(typeof typeName === 'undefined') { |
| | | typeName = ''; |
| | | } |
| | | if(feature.get('vehicle_type')) { |
| | | typeName += ' ' + feature.get('vehicle_type').num; |
| | | } |
| | | |
| | | addElementWithText(a, 'span', typeName).className = 'small'; |
| | |
| | | }); |
| | | vehicles_layer[type] = new ol.layer.Vector({ |
| | | source: vehicles_source[type], |
| | | renderMode: 'image', |
| | | }); |
| | | vehicles_last_update[type] = 0; |
| | | }); |
| | |
| | | geolocation_layer = new ol.layer.Vector({ |
| | | source: geolocation_source, |
| | | }); |
| | | geolocation_button = document.querySelector('#track button'); |
| | | geolocation_button = document.querySelector('#track'); |
| | | if(!navigator.geolocation) { |
| | | geolocation_button.classList.add('hidden'); |
| | | geolocation_button.remove(); |
| | | } |
| | | |
| | | geolocation = new ol.Geolocation({projection: 'EPSG:3857'}); |
| | |
| | | geolocation.on('error', function(error) { |
| | | fail(lang.error_location + ' ' + error.message); |
| | | trackingStop(); |
| | | geolocation_button.classList.add('hidden'); |
| | | geolocation_button.remove(); |
| | | }); |
| | | geolocation_button.addEventListener('click', trackingToggle); |
| | | |
| | |
| | | element: fail_element, |
| | | }), |
| | | new ol.control.Control({ |
| | | element: document.getElementById('track'), |
| | | element: document.getElementById('menu'), |
| | | }), |
| | | ]), |
| | | loadTilesWhileAnimating: false, |