mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-29 19:43:50 +01:00
Improve affect bounds handling.
This commit is contained in:
@@ -87,8 +87,6 @@ class MarkerClusterLayerMapper extends AbstractLayerMapper
|
||||
$GLOBALS['TL_CSS'][] = 'assets/leaflet/libs/leaflet-markercluster/MarkerCluster.Default.css||static';
|
||||
}
|
||||
|
||||
$definition->setOption('affectBounds', (bool) $model->affectBounds);
|
||||
|
||||
$collection = LayerModel::findBy(
|
||||
array('pid=?', 'active=1'),
|
||||
array($model->id),
|
||||
|
||||
@@ -68,8 +68,14 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
|
||||
if ($model->pointToLayer || $model->affectBounds) {
|
||||
$layer = new GeoJson($this->getElementId($model, $elementId));
|
||||
$layer->setPointToLayer(new Expression($model->pointToLayer));
|
||||
$layer->setOption('affectBounds', (bool) $model->affectBounds);
|
||||
|
||||
if ($model->pointToLayer ) {
|
||||
$layer->setPointToLayer(new Expression($model->pointToLayer));
|
||||
}
|
||||
|
||||
if ($model->affectBounds) {
|
||||
$layer->setOption('affectBounds', (bool) $model->affectBounds);
|
||||
}
|
||||
|
||||
return array($this->getElementId($model, $elementId), RequestUrl::create($model->id), array(), $layer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user