From 51814b0ba5ae52a4999291dc1cdf03d43bb1d189 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 23 Aug 2014 09:37:34 +0100 Subject: Better support for high resolution displays Enable leaflets support, and display the indoor layer on lower zoom levels. --- src/leaflet-soton.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index 1a47ce9..ecbc9c6 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -350,6 +350,7 @@ SELECT * WHERE {\ busRouteControl: false, workstations: false, zoom: 17, + detectRetina: true, tileUrl: 'http://bus.southampton.ac.uk/graphics/map/tiles/{z}/{x}/{y}.png', tileAttribution: 'Map data © OpenStreetMap contributors' }, @@ -708,8 +709,13 @@ SELECT * WHERE {\ } if (options.indoor) { + var level = 19; + if (L.Browser.retina) { + level = 18; + } + var setIndoorContent = function(zoom) { - if (zoom <= 19) { + if (zoom <= level) { if (showingIndoorControl) { map.levelControl.removeFrom(map); showingIndoorControl = false; @@ -722,7 +728,7 @@ SELECT * WHERE {\ if (options.workstations && !map.hasLayer(workstationMarkerLayer)) { map.addLayer(workstationMarkerLayer); } - } else if (zoom > 19) { + } else if (zoom > level) { if (!showingIndoorControl) { map.levelControl.addTo(map); showingIndoorControl = true; -- cgit v1.2.3