Improve affect bounds handling.

This commit is contained in:
David Molineus committed 2015-01-21 20:37:53 +01:00
1 parent b3eb4c8e61
commit 72f5e3b9ed
5 files changed
+10 -9

No files matched your search

@@ -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);
}