You certainly should reduce the number of markers displayed at once to
less than 200. Less than 100 if possible. Consider using MarkerManager
or a Clusterer to reduce the number of markers that are actually
displayed simultaneously.
However, there's something else going on in your particular site. It's
difficult to debug because your page has a habit of freezing when asked
to do any more work, like debugging or tracking resource load times.
In some browsers, doing things like this 500 times with slightly larger
contents can be ridiculously slow.
document.getElementById("sidebar").innerHTML = sidebar_html;
In particular, it puts a lot of stress on the memory management, because
the browser grabs enough memory for the current contents, then you add
another line, causing the new version to not fit in that space.
It's much more efficient to wait for the loop to complete, and then load
the sidebar once.
Similarly, you may gain some speed by not doing this inside the loop
document.getElementById(color).checked=true;
It's a bad idea to call your custom properties "marker.type" and
"marker.name". The API uses GMarker.name internally for its own
purposes. I recommend starting your custom properties with a capital
letter to avoid possible conflicts, because Google always start their
property names with a lower case letter or underscore.
To do serious timing analysis, I suggest writing a temporary page that
uses a smaller XML file. Then use either Firefox+Firebug or Google
Chrome to monitor the loading times of your resources.
[In Google Chrome, click on the icon to the left of the spanner, select
"Developer", select "Javascript Console" click on the "Resources" icon,
then reload your page.]
Place statements like
GLog.write("Requesting XML file");
GLog.write("Processing XML file");
GLog.write("XML file Processed");
in appropriate places in your temporary page. The GLog outputs have time
stamps. So you can see what part of your code is taking all the time.
2. Once you exit from a page, all its Javascript and variables are lost.
The only way to keep them is not to exit from the page, e.g. by opening
the linked page in a new window or in an <iframe>.
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---