Not sure if you need this functionality or not, but if you set the
clickable attribute to the polyline or polygon that you are creating
to false then it should work fine for you again.

The problem would be as you said, the polygon/polyline is being
created over the kml layer that you created.  If it has a clickable
attribute set to true it is going to capture the click event as
opposed to the kml layer.  This is one thing I miss with regards to
the older api was that the map click event returned the overlay and
the overlaylatlng, now click events just return a simple latlng.  In
the old api you could check against the overlay or just pull the
overlaylatlng, but now you only get the latlng of the object you
clicked on.  Your polygon/polyline is at the uppermost layer and
therefore it is capturing the event.

As far as I know there is no z-index available yet in api v3 for
polygons and polylines, only infowindows and markers.

On May 13, 7:17 pm, DmitryM <[email protected]> wrote:
> Nevermind, I figured it out. Just in case anyone is interested, here
> is what is happening.
>
> I was trying to 'select' a feature on a KML layer by creating Polygon
> overlay on top of the KML file. It worked for the first time when I
> click on the KML layer, but once Polygon overlay is created, KML click
> event is not triggered. Even if you delete the overlay by setting the
> map to NULL, KML click event is still not fired.
>
> So, If you add a KML layer to the map first and then create a polygon
> object for example, KML click event is not fired because it is
> 'blocked' by Polyline overlay. What I end up doing is 'precreating'
> Polygon overlay first and only then add KML layer. In this case
> everytime I create an Overlay layer, it is going to be under the KML
> layer and I'm able to click on it.
>
> So my question is if there is any way of controling zIndex of
> overlays?
>
> On May 13, 3:44 pm, DmitryM <[email protected]> wrote:
>
> > When I create a polygon overlay  on top of my  kml layer, the kml
> > click event is not triggered anymore. Map click event and polygon
> > click event however fires.
> > Is it expected behaviour?
>
> > --
> > 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 
> > athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
> --
> 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 
> athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.

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