On Mar 16, 11:10 am, daza <darren.fels...@derm.qld.gov.au> wrote: > Hi > > I have read all the post regarding order including > thishttp://code.google.com/apis/maps/documentation/javascript/forum.html?... > > I'm loading 4 kml layers of polygons some of which overlap so the layer > ordering is important. > I can load them in the correct order on initialise by using thelistening to > the metadata changed KML event and load each layer after the previous has > loaded. > All works well the first time round, but when I toggle layers on and off, I > run the ordering routine again to redisplay the layers in order (except for > any turned off). > The layer I toggle back always displays on top, no matter what. Is there any > known bug here. > Could it be caching? > Can't post code now but can later.
KMLLayers are not designed for dynamic changes. I suspect KMLLayers tiles are built in FIFO order of layers. It you remove a layer & insert a layer, its position will change. To further frustrate the situation, two different sets of tiles have to be built - one without the toggled layer - another with the toggled layer. You can reduce it to just one tile rebuild if you remove all layers & insert all layers in their original order. You will also be able to reuse previously cached tiles both at Google's server & at your browser. It appears counterintuitive. What seems to be more work is actually less work. You might be able to optimize if you just back track to the toggled layer. Layers deep in the stack will not change position. -- 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 google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.