From a09b8a43f6444eea2506dc8b3d04b8f5ea80a4df Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Tue, 09 Jun 2020 21:39:50 +0000
Subject: [PATCH] [map] Disallow non-integer zoom levels

---
 map.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/map.js b/map.js
index 4eb5861..14cd19c 100644
--- a/map.js
+++ b/map.js
@@ -2,6 +2,7 @@
 
 var api_refresh = 10000; // 10 seconds
 var api_poll_url = 'http://127.0.0.1/sub';
+var api_poll_refresh = 1000;
 
 var geolocation = null;
 var geolocation_set = 0;
@@ -406,7 +407,7 @@
 		).done(function(data) {
 			try {
 				if(this.request.status == 304) {
-					setTimeout(self.fetchDiff.bind(self), 1000);
+					setTimeout(self.fetchDiff.bind(self), api_poll_refresh);
 					return;
 				}
 				self.lastUpdate = this.request.getResponseHeader('Etag');
@@ -1112,6 +1113,7 @@
 				url: 'https://tiles.ttss.pl/x' + pixelRatio + '/{z}/{x}/{y}.png',
 				maxZoom: 19,
 				tilePixelRatio: pixelRatio,
+				opaque: false,
 			}),
 		}),
 		route_layer,
@@ -1131,6 +1133,7 @@
 			center: ol.proj.fromLonLat([19.94, 50.06]),
 			zoom: 14,
 			maxZoom: 19,
+			constrainResolution: true,
 		}),
 		controls: ol.control.defaults({
 			attributionOptions: ({

--
Gitblit v1.9.1