Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Add style options for marker cluster #4

@iiirxs

Description

@iiirxs

Currently it's impossible to define in config.yml some styles for a marker cluster. The getConfigTreeBuilder() inside Ivory\GoogleMapBundle\DependencyInjection\Configuration.php expects only scalar values for marker_cluster options:

->arrayNode('options')
->useAttributeAsKey('options')
->prototype('scalar')->end()
->end()

In order to enable this functionality of defining styles for marker clusters we have to change the existent code to this one:

->arrayNode('options')
->children()
->scalarNode('gridSize')->end()
->scalarNode('maxZoom')->end()
->scalarNode('zoomOnClick')->end()
->scalarNode('averageCenter')->end()
->scalarNode('minimumClusterSize')->end()
->arrayNode('styles')
->prototype('array')
->children()
->scalarNode('url')->end()
->scalarNode('height')->end()
->scalarNode('width')->end()
->scalarNode('anchor')->end()
->scalarNode('textColor')->end()
->scalarNode('textSize')->end()
->scalarNode('backgroundPosition')->end()
->scalarNode('iconAnchor')->end()
->end()
->end()
->end()
->end()
->end()

The above code provides all options currently available by Google Maps Api

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions