To whom it may concern: since there is no native Polygon.getBounds()
method, you may use

    google.maps.Polygon.prototype.getBounds = function(){
        var bounds = new google.maps.LatLngBounds;
        this.getPath().forEach(function(latLng){
                bounds.extend(latLng);
            });

        return bounds;
    };

to support it (more or less) as the API V2 did...


On Jun 17, 11:03 am, kilkul <[email protected]> wrote:
> Yeah, thanks, I'll try that. Indeed, should do the trick. But... isn't
> there any "native" way of doing this? 'Cause if not, this is a real
> bug.
>
> On Jun 17, 10:22 am, ClubPit <[email protected]> wrote:
>
> > It's not the cleanest solution, but if you checked if the LatLng of
> > the click event was
> > within the boundaries of the polygon it would have the same effect. If
> > it's within the boundary,
> > it's a polygon event, if it's not within the boundary it's a map
> > event. Ugly, but it would work.
>
> > KW

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