summaryrefslogtreecommitdiff
path: root/src/leaflet-soton.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/leaflet-soton.js')
-rw-r--r--src/leaflet-soton.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index b8f1414..cb8184b 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -119,14 +119,17 @@
pointToLayer: vendingPointToLayer,
onEachFeature: function(feature, layer) {
layer.on('click', function(e) {
- var popupOptions = {
- offset: icons.vendingHotDrinks.options.popupAnchor
- };
- var content = vendingPopupTemplate(feature.properties);
+ // If this is a leaflet-soton map
+ if ("showInfo" in this._map) {
+ var popupOptions = {
+ offset: icons.vendingHotDrinks.options.popupAnchor
+ };
- // TODO: Unsure if map is accessible?
- map.showInfo(content, e.latlng, popupOptions);
+ var content = vendingPopupTemplate(feature.properties);
+
+ this._map.showInfo(content, e.latlng, popupOptions);
+ }
});
}
});