From 19a3387f2cae0411e591070ba728eedacea2335b Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Fri, 05 Jul 2019 22:27:13 +0000 Subject: [PATCH] Use CSS icon for geolocation button, wrap it in #menu --- map.js | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/map.js b/map.js index 9089c62..07f2361 100644 --- a/map.js +++ b/map.js @@ -20,7 +20,7 @@ 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({ @@ -594,7 +594,7 @@ })}, 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) { @@ -658,6 +658,9 @@ 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'; @@ -811,6 +814,7 @@ }); vehicles_layer[type] = new ol.layer.Vector({ source: vehicles_source[type], + renderMode: 'image', }); vehicles_last_update[type] = 0; }); @@ -835,9 +839,9 @@ 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'}); @@ -862,7 +866,7 @@ 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); @@ -900,7 +904,7 @@ element: fail_element, }), new ol.control.Control({ - element: document.getElementById('track'), + element: document.getElementById('menu'), }), ]), loadTilesWhileAnimating: false, -- Gitblit v1.9.1