summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-08-23 09:37:34 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-08-23 09:37:34 +0100
commit51814b0ba5ae52a4999291dc1cdf03d43bb1d189 (patch)
tree0b24f9dc38f9e3ffe8850f70c418a05aa4838b0d /src
parent08979071ac39ae9d4acc14c24f801a9bffed4caf (diff)
downloadleaflet-soton-51814b0ba5ae52a4999291dc1cdf03d43bb1d189.tar
leaflet-soton-51814b0ba5ae52a4999291dc1cdf03d43bb1d189.tar.gz
Better support for high resolution displays
Enable leaflets support, and display the indoor layer on lower zoom levels.
Diffstat (limited to 'src')
-rw-r--r--src/leaflet-soton.js10
1 files changed, 8 insertions, 2 deletions
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 &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> 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;