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.
/
***********************************************************************************/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-
microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
<title>Google Maps JavaScript API Example: Controls</title>
<script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-
m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
type="text/javascript"></script>
<script src="epoly.js" type="text/javascript"> </script>
<script type="text/javascript">
var polygon;
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"))
map.setCenter(new GLatLng(13.08817293890114,
80.20431518554688), 13);
polygon = new GPolygon([new GLatLng(13.08817293890114,
80.20431518554688),
new GLatLng(13.117598747401665,
80.20809173583984),
new GLatLng(13.117264382979972,
80.2499771118164),
new GLatLng(13.092854552762693,
80.25959014892578),
],5, 1,0.2);
map.addOverlay(polygon);
GEvent.addListener(map, "click", function(overlay,point){
if(polygon.Contains(point)
{
alert("Contains");
}
});
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
/
**********************************************************************************************************/
Regards
Arun
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---