thanks for the help in advance.

The Map is the global var  called map.


the all the data (for each object) is loaded first (in a JSON array)
then the map is initialized. Once the map is ready then the polygons
are created in a loop.

during the loop ( basically a for loop going through the JSON array)
it calls this function to setup the event listener for each Polygon.

thanks









On Aug 12, 9:11 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Aug 12, 8:27 am, Dave <dave...@gmail.com> wrote:
>
>
>
> > I'm having trouble opening an InfoWindow from a Polygon click event.
>
> > I have a loop of polygons (database driven) that load into the map.
> > during the loop it calls this function passing in the Polygon shape
> > and the object of data.
>
> > from there it adds and eventhandler to add a infowindow?
>
> > function conservancyInfoWindow(shape, conservancyobj) {
> >                 var thisshape = shape;
> >                 var conservancy = conservancyobj;
> >         google.maps.event.addListener(thisshape, 'mousedown', 
> > function(event)
> > {
> >                 //clearEnterpriseWindows();
> >                 //alert(conservancy.title);
> >                 var clickedLocation = new google.maps.LatLng(event.latLng);
> >                 var cwindow = new google.maps.InfoWindow({  });
> >                 cwindow.setPosition(clickedLocation);
> >                 var thiscontent = conservancy.title;
> >                 cwindow.setContent(thiscontent);
> >                 cwindow.open(map, thisshape);
>
> >         });
>
> > }
>
> > But it does not open the InfoWindow. What am i doing wrong?
> > Any help is appreciated!
>
> Not enough information.  Where is your map where you tried to
> implement this?
>
>   -- Larry

-- 
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 google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to