The big thing that's slowing it down is that you perform
markerManager.refresh();
inside your
for (var i = 0; i < markers.length; i++) {
loop. If you've got 1500 markers, then that means you're refreshing the
marker manager 1500 times, and each time the manager has to process all
the existing markers, so that's over 2 million unnecessary marker
checks. Move the refresh outside the loop.
One small thing is that when you're using GMarkerManager, there's no
need to include the open source MarkerManager code, because
GMarkerManager is included in the API. However, I'd actually recommend
using MarkerManager. There are some significant fixes and improvements
that went into MarkerManager that didn't make it into GMarkerManager.
And you only need one instance of GMarkerManager, not two. That's not
going to make any difference to the speed, but if you ever need to add
code that makes later calls to markerManager, you might be confused by
the fact that the variable ends up pointing at the empty one rather than
the GMarkerManager that is managing the 1500 markers.
--
Mike Williams
http://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---