Hi!,

With your Class:

public var infoWindowOpen:Boolean = false;

In main:

myMarker.addEventListener(MapMouseEvent.CLICK, function
(e:MapMouseEvent):void {
                           e.target.openInfoWindow(infoWindowOptions);

                        });
myMarker.addEventListener(MapEvent.INFOWINDOW_CLOSED, function
(e:MapEvent):void {
                           e.target.infoWindowOpen = false;
                        });
myMarker.addEventListener(MapEvent.INFOWINDOW_OPENED, function
(e:MapEvent):void {
                        e.target.infoWindowOpen = true;
                        });

Thank's a lot!


On Aug 24, 8:55 pm, helen <[email protected]> wrote:
> There is no field in the Marker class to tell you this.
> I can think of a couple options:
> 1 - easiest to just call marker.closeInfoWindow() without checking; if
> it isn't open, nothing will happen
> 2 - You can extend the Marker class to have a boolean field called
> something like 'infoWindowOpen' and set a listener for
> INFOWINDOW_CLOSED event when you handle the click event that opens the
> info window, so you can set the value of your boolean appropriately.
> For example (off the top of my head, not guaranteed to work as is):
>
> public class MyMarker extends Marker {
>   private var infoWindowOpen:Boolean = false;
>   public function MyMarker(....) {
>     super(....);
>     this.addEventListener(MapMouseEvent.CLICK, onMarkerClick);
>   }
>   private function onMarkerClick(event:MapMouseEvent):void {
>     this.openInfoWindow(new InfoWindowOptions({...}));
>     this.addEventListener(MapEvent.INFOWINDOW_CLOSED, onInfoWinClose);
>     this.infoWindowOpen = true;
>   }
>   private function onInfoWinClose(event:MapEvent):void {
>     this.infoWindowOpen = false;
>     this.removeEventListener(MapEvent.INFOWINDOW_CLOSED,
> onInfoWinClose);
>   }
>   public function get openedInfoWindow():Boolean {
>     return this.infoWindowOpen;
>   }
>
> }
>
> Hope that helps.
>
> On Aug 22, 11:48 am, V <[email protected]> wrote:
>
> > Hi,
>
> > I need to know if the infoWindow of a marker is open.
>
> > Something like that....
>
> > // this.arrayMarkers is and array of all markers on the map.
>
> > for each ( var marker:Marker in this.arrayMarkers ) {
> >         if ( marker.getLatLng().lat() == nnnnnnnnnn ) {                     
> >                             if
> > ( marker.infoWindow.open ) {
> >                         marker.closeInfoWindow();
> >                         break;
> >                 }
> >         }
>
> > }
>
> > Thanks a lot!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" 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-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to