-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathleaflet-add-content-options-to-bindPopup.patch
37 lines (33 loc) · 1.32 KB
/
leaflet-add-content-options-to-bindPopup.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff --git a/leaflet.drupal.js b/leaflet.drupal.js
index c9dc366..84cae71 100644
--- a/leaflet.drupal.js
+++ b/leaflet.drupal.js
@@ -40,6 +40,14 @@
for (i = 0; i < this.features.length; i++) {
var feature = this.features[i];
var lFeature;
+
+ // load an options object with all of our content options
+ var contentOptions = {};
+ if (feature.content.options) {
+ for (var contentOption in feature.content.options) {
+ contentOptions[contentOption] = feature.content.options[contentOption];
+ }
+ }
// dealing with a layer group
if (feature.group) {
@@ -48,7 +56,7 @@
var groupFeature = feature.features[groupKey];
lFeature = leaflet_create_feature(groupFeature, lMap);
if (groupFeature.popup) {
- lFeature.bindPopup(groupFeature.popup);
+ lFeature.bindPopup(groupFeature.popup, contentOptions);
}
lGroup.addLayer(lFeature);
@@ -66,7 +74,7 @@
lMap.addLayer(lFeature);
if (feature.popup) {
- lFeature.bindPopup(feature.popup);
+ lFeature.bindPopup(feature.popup, contentOptions);
}
// Allow others to do something with the feature.