On Aug 4, 12:51 pm, Arun <[email protected]> wrote:
> Hi,
>
> polygon.Contains() method is not working properly for me. Below is the
> script i.e. If i click on teh polygon i cannot able to get the alert
> message(according to my script). I dont know what is the mistake.
> Please forgive me if it is silly.

(a) Don't post code. Give a link. This is important, especially for
more complicated problems. I think I've identified the issue...

(b) The issue is that you are clicking on a polygon. If you click on
an overlay, the arguments passed to the handler function are the
overlay and null -- they are either/or, not both together. You never
get a point to check. You need to use the full version of that handler
function. See 
http://code.google.com/apis/maps/documentation/reference.html#GMap2.click

 GEvent.addListener(map, "click", function(ov,pt,ovpt){
   if(polygon.Contains(ovpt)
     {
     alert("Contains");
     }
   }

The third argument is the coordinates of the click on the overlay.

Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to