From b470addbdbc536f1da04e004282ba73d15f78ae1 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Fri, 13 Mar 2020 20:18:47 +0000
Subject: [PATCH] Test high DPI tiles

---
 map.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/map.js b/map.js
index 6f628c9..956612f 100644
--- a/map.js
+++ b/map.js
@@ -962,10 +962,14 @@
 	
 	document.getElementById('find').addEventListener('click', find.open.bind(find, panel));
 	
+	var hidpi = ol.has.DEVICE_PIXEL_RATIO > 1;
 	var layers = [
 		new ol.layer.Tile({
-			source: new ol.source.OSM({
-				url: 'https://tiles.ttss.pl/{z}/{x}/{y}.png',
+			source: new ol.source.XYZ({
+				attributions: [ol.source.OSM.ATTRIBUTION],
+				url: 'http://10.12.16.142:8080/tiles/mapnik_'+(hidpi ? 'x2' : 'x1')+'/webmercator_'+(hidpi ? 'x2' : 'x1')+'/{z}/{x}/{y}.png',
+				maxZoom: 19,
+				tilePixelRatio: (hidpi ? 2 : 1),
 			}),
 		}),
 		route_layer,

--
Gitblit v1.9.1