Support pointToLayer and onEachFeature customization.

This commit is contained in:
David Molineus
2015-01-09 16:10:17 +01:00
parent 717b02e615
commit 150e3706ed
5 changed files with 54 additions and 4 deletions

View File

@@ -74,8 +74,13 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
}
if ($definition instanceof GeoJson) {
$definition->setOnEachFeature(new Expression('ContaoLeaflet.onEachFeature.bind(ContaoLeaflet)'));
$definition->setPointToLayer(new Expression('ContaoLeaflet.pointToLayer.bind(ContaoLeaflet)'));
if ($model->pointToLayer) {
$definition->setPointToLayer(new Expression($model->pointToLayer));
}
if ($model->onEachFeature) {
$definition->setOnEachFeature(new Expression($model->onEachFeature));
}
}
}