Wasn't it Esa who wrote:
>
>It is Saturday and quite quiet on the forum. A good time to see a
>movie. Instead of your regular Arnold movie, see this:
>http://www.youtube.com/watch?v=mHtdZgou0qU

Oddly, very little of that will gain you very much in Google Maps pages.

Using local variables instead of globals, properties or array elements
gains you a few microseconds per reference, so unless you are making
many thousands of such references the improvement will be insignificant.

You can make gains in this sort of area are by reducing the number of
API Methods that you call, for example
  for (var i=0; i<poly.getVertextCount(); i++) { ... }
makes an API call to obtain the number of vertices each time round the
loop. If the number of vertexes doesn't change, then you can make a gain
with
  var vertices = poly.getVertextCount();
  for (var i=0; i<vertices; i++) { ... }



HTMLCollections that come from the HTML may well be "live", but those
that come from XML aren't, and its only XML HTMLCollections that are
likely to be used in Google Maps pages.

When you do this:
  var markers = xmlDoc.documentElement.getElementsByTagName("marker");
"markers" is a HTMLCollection, but when you then do
  for (var i = 0; i < markers.length; i++) {
the search doesn't get re-executed.


The reflow problem doesn't seem to occur in any compatible browser. You
might expect that if you were to create your sidebar line by line, like
this:
    document.getElementById("side_bar").innerHTML  += '...';
instead of building up the sidebar in a string and loading the whole
thing at the end
    side_bar_html += '...';
    ...
  document.getElementById("side_bar").innerHTML = side_bar_html;
that the browser would reflow the sidebar for each item, but that
doesn't seem to happen.

It looks to me as if all compatible browsers wait for you to exit from
Javascript before performing a single reflow for all the outstanding
changes.

-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to