summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/full.html14
-rw-r--r--src/leaflet-soton.js4
2 files changed, 12 insertions, 6 deletions
diff --git a/examples/full.html b/examples/full.html
index c59fdea..10037ab 100644
--- a/examples/full.html
+++ b/examples/full.html
@@ -36,12 +36,14 @@
LS.imagePath = '../resources/images/';
LS.dataPath = '../data.json';
- var map = LS.map('map', {
- workstations: true,
- indoor: true
- });
-
- L.control.locate().addTo(map);
+ (function() {
+ var map = LS.map('map', {
+ workstations: true,
+ indoor: true
+ });
+
+ L.control.locate().addTo(map);
+ })();
</script>
</body>
</html>
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index 4f08e9f..90ba947 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -952,6 +952,8 @@ SELECT * WHERE {\
},
showInfo: function(content, latlng, options) {
+ var map = this;
+
options = options || {};
options.maxWidth = map.getContainer().offsetWidth;
@@ -966,6 +968,8 @@ SELECT * WHERE {\
popup.openOn(map);
},
closeInfo: function() {
+ var map = this;
+
if (map._popup) {
map.closePopup(map._popup);
}