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 |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/map.js b/map.js
index 354baa9..07f2361 100644
--- a/map.js
+++ b/map.js
@@ -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) {
@@ -814,6 +814,7 @@
 		});
 		vehicles_layer[type] = new ol.layer.Vector({
 			source: vehicles_source[type],
+			renderMode: 'image',
 		});
 		vehicles_last_update[type] = 0;
 	});
@@ -838,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'});
@@ -865,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);
 	
@@ -903,7 +904,7 @@
 				element: fail_element,
 			}),
 			new ol.control.Control({
-				element: document.getElementById('track'),
+				element: document.getElementById('menu'),
 			}),
 		]),
 		loadTilesWhileAnimating: false,

--
Gitblit v1.9.1