ramazanalic / kml-samples

Automatically exported from code.google.com/p/kml-samples
0 stars 0 forks source link

random z-index when placing two kmz overlays on the same location #345

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I put two kmz overlays on the same location on google map, one is a 
polygon, the second is a list of markers. Both are kmz files retrieved from 
server. 

According to

http://code.google.com/apis/maps/documentation/javascript/v2/reference.html
#GMapPane.G_MAP_OVERLAY_LAYER_PANE

the polygon pane should be below the marker pane. I was expecting the 
marker overlay to receive the mouse click event before the polygon layer.

However, it is not always the case. When I click on the markers, sometimes 
the info window for the polygon overlay will show up. Looks like the mouse 
event is passed to the polygon before it hits the marker.

This is not always happening - if I refresh the page and then click again, 
sometimes the marker info window will show up.

The code snippet is like this:

map=new GMap2(mapDiv);
...// get the kmz file urls
polygonKMZ=new GGeoXml(polygonKMZurl);
markerKMZ=new GGeoXml(markerKMZurl);
map.addOverlay(polygonKMZ);
map.addOverlay(markerKMZ);

Any idea why this is happening?

Thanks.

Original issue reported on code.google.com by schooldistrictfinder@gmail.com on 25 May 2010 at 5:40