Ping,

Looks like there's no easy solution. You will probably have to keep
track of the polygon the label is associated with, then trigger an
event on the polygon when the label is clicked.

Gary

On Nov 30, 7:37 pm, ping <[email protected]> wrote:
> Hi Gary
> I've given your suggestion a try.
>
> I've updated the v3 example to add labels to the overlayLayer pane
> (which according to 
> documentationhttp://code.google.com/apis/maps/documentation/javascript/reference.h...
> is the pane where the polygons are). I've also bumped up the zIndex to
> force it above the polygon.
>
> All these end up with pretty much the same results as before (the
> first 2 labels).
>
> - ping
>
> On Dec 1, 6:58 am, Gary Little <[email protected]> wrote:
>
>
>
> > In your V3 example, because you've set InfoBox's
> > enableEventPropagation property to true, the click event passes from
> > the overlayShadow pane to the map itself -- as you've observed. I
> > believe the various V3 map panes are independent of one another so an
> > event originating in one pane does not get passed to objects in
> > another pane, they go straight to the map. The polygon you've defined
> > must be in one of these other panes.
>
> > You might try adding the label to the same pane as the polygon and see
> > if it helps.
>
> > Gary
>
> > On Nov 30, 12:53 am, ping <[email protected]> wrote:
>
> > > Hi everybody
>
> > > I'm porting an existing app over from v2, but I'm hitting a stumper in
> > > the most surprising of places: labels on clickable polygons.
>
> > > Previously on v2, I was using the excellent Elabel extension but
> > > there's no official port for v3. I did find an unofficial Elabel v3
> > > port, but it looks like the Google-released InfoBox library (http://
> > > code.google.com/p/google-maps-utility-library-v3/wiki/Libraries) is
> > > the recommended way to go.
>
> > > v2 Mockup (with elabel):http://li-ping.com/protos/polygons_v2.html
> > > v3 Mockup (with infobox):http://li-ping.com/protos/polygons_v3.html
>
> > > In the v2 page, the polygon area covered by the label still responds
> > > to mouse clicks (click on the label to see) and label is not obscured.
>
> > > In v3, I cannot seem to get the click on the label area to propagate
> > > down to the polygon. The InfoBox lib allows the pane to be specified,
> > > and I've tried using different panes (above and below the polygon
> > > pane).
>
> > > When using a higher pane, the label is not obscured by the polygon but
> > > click doesn't register. When using a lower pane, the click registers,
> > > but the label is obscured. I cannot seem to have it both ways like in
> > > v2.
>
> > > Am I missing something? Does anyone have any idea how to fix this?
> > > Thanks!

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