Skip to content Skip to sidebar Skip to footer

Markerclusterer - Associated Array

MarkerClusterer works well with numeric array, but have you tried to use it with object of markers? I mean associated array, because I keep all markers inside this kind of array. O

Solution 1:

You can add an array of markers to the MarkerClusterer, or you can add them individually (they don't have to be in an array). Add your markers to the MarkerClusterer as you create them and add them to your "associative" array/object.

See the addMarker method in the documentation

Solution 2:

Google Maps API v3

MarkerClusterer(map:google.maps.Map, opt_markers:Array.<google.maps.Marker>, opt_options:Object)

Please note this: opt_markers:Array.

This means that you should only use an array! According to this, just send your object to normal, numerical, array.

Post a Comment for "Markerclusterer - Associated Array"