Thought I would post back my solutions to these issues. The
metadata_changed is still the event I listen to, but the key was
understanding that "rendering of KmlLayer objects requires
asynchronous communication to an external server" (API documentation)
and William's note that "Because setMap() is asynchronous, you need to
have code to ensure the next layer is added after the previous one is
ready." William's notes and examples in this thread were very helpful,
and ultimately I went with his method to handle the initial draw:
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/d141c913badec13a

I'm pretty sure the reason why my IE draw was getting fouled up was
that I wasn't dumping my browser cache completely, so when I had
previous iterations that didn't wait for each layer to draw one at a
time, the bottom layer ended up getting dumped on top simply because
it was quicker.

I also had my script guy create .kmz versions of these overlays as
part of his output scripts - much faster load time. The map "blinks" a
bit on initial load, but the result is much more stable, so I'm
sticking with it.

The code on my production page is compressed; if anyone wants to see a
non-compressed version, fire me a note.

On Apr 11, 2:16 pm, Mike Dolbow <[email protected]> wrote:
> Hello:
> I've got a map with 3 fairly large KML overlays, although in theory
> they meet the restrictions detailed 
> here:http://code.google.com/apis/kml/documentation/mapsSupport.html
>
> And I'm in the middle of investigating these two group threads for
> help:http://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...http://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...
>
> But in the meantime, I'm hoping for any critique of my code and help
> with two specific problems:
> 1. Is there a better way for me to signal to the user that the KMLs
> are loaded (and drawn)? Right now I'm waiting for the map tiles to
> draw, then firing the KML overlays via setMap(map). Then I have a
> ListenerOnce on the metadata_changed event that sets up my legend
> throbbers. Any better ideas?
> 2. The draw order isn't working quite right on initial load in IE7.
> You should see the KMLs order up like the legend shows, with the blue
> outlines on top. IE7 dumps the multi-colored polygons on top for
> initial load - but if you toggle anything in the legend, it returns to
> normal.
>
> Here's my page:http://gis.mda.state.mn.us/maps/source_water.htm
>
> Any help is much appreciated.

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