mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-28 11:04:08 +01:00
Support popups.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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});
|
||||
}
|
||||
|
||||
@@ -221,6 +221,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
|
||||
'boundsMode',
|
||||
'minZoom',
|
||||
'overpassEndpoint',
|
||||
'overpassPopup'
|
||||
),
|
||||
'style' => array(
|
||||
'amenityIcons'
|
||||
@@ -911,5 +912,19 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
|
||||
),
|
||||
'sql' => "blob NULL",
|
||||
),
|
||||
'overpassPopup' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassPopup'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'textarea',
|
||||
'eval' => array(
|
||||
'preserveTags' => true,
|
||||
'decodeEntities' => true,
|
||||
'allowHtml' => true,
|
||||
'rte' => 'ace|javascript',
|
||||
'tl_class' => 'clr'
|
||||
),
|
||||
'sql' => "mediumtext NULL"
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -77,6 +77,10 @@ class OverpassLayerMapper extends AbstractLayerMapper
|
||||
if ($model->onEachFeature) {
|
||||
$definition->setOnEachFeature(new Expression($model->onEachFeature));
|
||||
}
|
||||
|
||||
if ($model->overpassPopup) {
|
||||
$definition->setOption('overpassPopup', new Expression($model->overpassPopup));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user