Note too: for 6000 markers you should look into KmlLayer or
FusionTablesLayer.  For these layers Google renders your markers into
overlay images, which are much faster to load and render.  The click event
on these layers can include details about the marker such as an ID and
metadata.

On 12 Jul 2010 07:18, "uno" <[email protected]> wrote:
> hello,
> when loading 6000+ markers on a map, each one has a click-listener
> with individual data (i.e. a numeric id and a string), what would be
> the best approach, performance-wise:
>
> to assign the data within the listener individualy, e.g.
>
> var id = ...
> var title = ...
> google.maps.event.addListener(Marker, 'click', function() {
> alert("data: " + id + ", " + title);
> });
>
> or register the data as a property in the marker and assign the
> listener like this:
>
> Marker.id = ...
> Maker.title = ...
> google.maps.event.addListener(Marker, 'click', function() {
> alert("data: " + this.id + ", " + this.title);
> });
>
> does it make a difference?
> thx, uno
>
> --
> You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
> To post to this group, send email to
[email protected].
> To unsubscribe from this group, send email to
[email protected]<google-maps-js-api-v3%[email protected]>
.
> For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to