Support popups.

This commit is contained in:
David Molineus
2016-11-14 11:50:20 +01:00
parent f462a11c1d
commit cb370f6723
4 changed files with 26 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -110,8 +110,10 @@ L.OverPassLayer = L.FeatureGroup.extend({
if (icon) {
marker.setIcon(icon);
}
}
L.contao.bindPopupFromFeature(marker, feature);
if (this.options.overpassPopup) {
marker.bindPopup(this.options.overpassPopup(feature, marker));
}
this._map.fire('point:added', {marker: marker, feature: feature, latlng: latlng, type: type});
@@ -122,7 +124,9 @@ L.OverPassLayer = L.FeatureGroup.extend({
if (feature.properties) {
L.Util.setOptions(layer, feature.properties.options);
L.contao.bindPopupFromFeature(layer, feature);
if (this.options.overpassPopup) {
layer.bindPopup(this.options.overpassPopup(feature, layer));
}
this._map.fire('feature:added', {feature: feature, layer: layer});
}