forked from Snck3rs/contao-leaflet-maps
Use getClassName instead of overwriting createInstance.
This commit is contained in:
@@ -38,16 +38,13 @@ class GroupLayerMapper extends AbstractLayerMapper
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function createInstance(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
|
||||
protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
|
||||
{
|
||||
$class = $model->groupType === 'feature'
|
||||
? 'Netzmacht\LeafletPHP\Definition\Group\FeatureGroup'
|
||||
: static::$definitionClass;
|
||||
if ($model->groupType === 'feature') {
|
||||
return 'Netzmacht\LeafletPHP\Definition\Group\FeatureGroup';
|
||||
}
|
||||
|
||||
$reflector = new \ReflectionClass($class);
|
||||
$instance = $reflector->newInstanceArgs($this->buildConstructArguments($model, $mapper, $bounds));
|
||||
|
||||
return $instance;
|
||||
return parent::getClassName($model, $mapper, $bounds); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user