Hi.

Problem 1

I've taken your original edmonton.html page and made a few
optimalisations.

http://googlemapsapi.martinpearman.co.uk/user_maps/edmonton/edmonton.html

Commented the changes in the page for you to see.

Page still takes a while to parse the XML, create and then render the
markers though :-(

If you view the page in Firefox and have Firebug installed then it's
'Profile' feature can track what functions are using what amount of
processing time - that will enable you to see exactly what's taking so
long for the map to fully render.

Have you considered using JSON instead of XML to get marker data from
your database to your map page?
JSON will typically perform better than XML.

Problem 2

Could you make the URLs that take visitors to another page/site open
in a new window?
That way they can click a URL, view that page and your map page
remains loaded rather than having to reload.


Martin.


On 25 Sep, 07:32, Mike Williams <[EMAIL PROTECTED]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to