summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-09-17 15:10:21 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-09-17 15:10:21 +0100
commit068833709ae26fbbe87e9b079d5e1160d0f7fcec (patch)
treeb45a4397a21838ec784a03489e065fd53ce7890f
parent9373af8df20df1e125e72c96ec18b5fc67c73405 (diff)
downloadleaflet-soton-068833709ae26fbbe87e9b079d5e1160d0f7fcec.tar
leaflet-soton-068833709ae26fbbe87e9b079d5e1160d0f7fcec.tar.gz
Fix problem with map variable
-rw-r--r--src/leaflet-soton.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index cb8184b..89f82dc 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -166,13 +166,17 @@
},
onEachFeature: function(feature, layer) {
layer.on('click', function(e) {
- var popupOptions = {
- offset: icons.vendingHotDrinks.options.popupAnchor
- };
- var content = pointOfServiceTemplate(feature.properties);
+ // If this is a leaflet-soton map
+ if ("showInfo" in this._map) {
+ var popupOptions = {
+ offset: icons.vendingHotDrinks.options.popupAnchor
+ };
+
+ var content = pointOfServiceTemplate(feature.properties);
- map.showInfo(content, e.latlng, popupOptions);
+ this._map.showInfo(content, e.latlng, popupOptions);
+ }
});
}
});