Skip to content

Latest commit

 

History

History
executable file
·
46 lines (34 loc) · 1.66 KB

marker_cluster.md

File metadata and controls

executable file
·
46 lines (34 loc) · 1.66 KB

Marker Cluster

Some applications are required to display a large number of locations or markers. Despite the v3 JavaScript API's significant improvement to performance, naively plotting thousands of markers on a map can quickly lead to to a degraded user experience. Too many markers on the map cause both visual overload and sluggish interaction with the map. To overcome this poor performance, the information displayed on the map needs to be simplified, we need a marker clustering solution.

Build your marker

By default, the bundle doesn't need any configuration. Most of the service have a default configuration which allows you to use the given objects like they are. The fungio_google_map.marker_cluster service is. The configuration describes below is this default configuration.

# app/config/config.yml

fungio_google_map:
    marker_cluster:
        # Your own marker cluster class
        class: "My\Fucking\MarkerCluster"

        # Your own marker cluster helper class
        helper_class: "My\Fucking\MarkerClusterHelper"

        # Prefix used for the generation of the marker cluster javascript variable
        prefix_javascript_variable: "marker_cluster_"

        # Marker cluster type
        type: "default"

        # Custom marker cluster options
        # By default there is no marker cluster options
        options:
            option: "value"
<?php

// Requests the fungio google map marker cluster service
$markerCluster = $this->get('fungio_google_map.marker_cluster');

If you want to learn more, you can read this documentation.