I had the same exact issue, and put the "marker.getMap()" into my code
and whalla, it worked perfectly.  No idea the difference, but thanks
for the information.  I spent 2 hours looking up this solution.

On Jan 8, 2:24 pm, Magnus Jonneryd <[email protected]> wrote:
> Hi, I had the same issue and it bothered me no end. I found your post
> and realized you're using the same appproach as me (more or less). So
> I thought I'd share my solution with you.
> Try replacing:infoWindow.open(map, this);
> With:infoWindow.open(marker.getMap(), marker);
> This solved it for me. Only thing that troubbles me is that i don't
> really understand why! If it works for you perhaps you can help me
> explaint it? Or is there someone else out there who can help shed some
> light on this?
>
> On Nov 13 2011, 1:02 am, Lothaire Ruellan
>
>
>
>
>
>
>
> <[email protected]> wrote:
> > I have an issue that I have been unable to troubleshoot with my
> > infowindows. You can view the page where the problem occurs 
> > athttp://www.queenofnewyork.com/
> > Click any marker on themap, and as soon as it appears, a javascript error
> > is registered, which prevents theinfowindowfrom closing.
>
> > Mymapcode is contained in a javascript class
> > (http://www.queenofnewyork.com/wp-content/themes/queenofnewyork/js/map.js)
> > Inside, I have a method called showMarkers which takes as argument an
> > array, as follows:
>
> >     this.showMarkers =function(places) {
> >         for ( var i = 0 ; i < places.length ; i++) {
> >             var marker = new google.maps.Marker({
> >               position: places[i]['LatLng'],
> >              map: this.map,
> >               title: places[i]['title'],
> >               icon: icon,
> >               html: places[i]['html']
> >             })
> >             google.maps.event.addListener(marker, 'click',function() {
> >                infoWindow.setContent(this.html) ;
> >                infoWindow.open(map, this);
> >             });
> >             markersArray.push(marker);
> >         }
>
> > My markers andinfowindowappear as expected, but I'm stuck with this
> > javascript error which prevents theinfowindowfrom closing.
> > Any idea what I am doing wrong?
> > Thanks in advance for your help.
>
> > Lothaire

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