summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-09-20 16:09:20 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-09-20 16:09:20 +0100
commitcc19c592b3c5ed7dc814e427ce990235d27d2ff5 (patch)
tree6b98ac70563db89e51036e52c3a25fae2dca08ca /src
parent87cbe3dcd4159c6ddbc76a8be27c0b989d70dc76 (diff)
downloadleaflet-soton-cc19c592b3c5ed7dc814e427ce990235d27d2ff5.tar
leaflet-soton-cc19c592b3c5ed7dc814e427ce990235d27d2ff5.tar.gz
Prevent popups from being larger than the map
This helps on smaller devices.
Diffstat (limited to 'src')
-rw-r--r--src/leaflet-soton.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index 65e8e6e..85a322b 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -994,7 +994,12 @@ SELECT * WHERE {\
options.maxWidth = map.getContainer().offsetWidth*0.9;
options.minWidth = 320;
- //options.maxHeight = map.getContainer().offsetHeight*0.8;
+
+ if (options.minWidth > options.maxWidth) {
+ options.minWidth = options.maxWidth;
+ }
+
+ options.maxHeight = map.getContainer().offsetHeight*0.8;
map.closeInfo();