(using 1_8a library)
I am trying to get my info window to close with a drag_start event.
My code (in part) is below. The code executes but the problem is that
as soon as you stop dragging the mouse the infowindow reappears. (I
have also tried putting in a "hasCloseButton: true" into my info
window options but the same closing and reappearing occurs.) Drag_end
does nothing at all
Are these issues a result of using the map move event: move_end
listener to open the infowindow? If so how can I stop the listener
inside the function.
If not, then what is occurring and how can I get around it?
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapMouseEvent;
import com.google.maps.MapMoveEvent;
import com.google.maps.MapType;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.styles.FillStyle;
import com.google.maps.styles.StrokeStyle
import com.google.maps.InfoWindowOptions
import com.google.maps.controls.MapTypeControl;
import com.google.maps.controls.ZoomControl;
import com.google.maps.controls.PositionControl
var map:Map = new Map();
map.key =
"ABQIAAAA80Glo37MZ56fw1S4UUY44hRzPnC9TjKENMaIdC0OLHndWsw2xhQ6iXbvihoFZVFtQOvx88ZlKonUEg";
map.setSize(new Point(550, 400));
map.x = 15;
map.y = 300;
map.addEventListener(MapEvent.MAP_READY, onMapReady);
this.addChild(map);
function onMapReady(event:Event):void {
map.setCenter(new LatLng(56.242973,-117.294069), 16,
MapType.SATELLITE_MAP_TYPE);
map.addControl(new MapTypeControl());
map.addControl(new ZoomControl());
map.addControl(new PositionControl());
map.removeMapType(MapType.PHYSICAL_MAP_TYPE);
var markerA:Marker = new Marker(
new LatLng(56.241617,-117.289728),
new MarkerOptions({
strokeStyle: new StrokeStyle({color: 0x000000}),
fillStyle: new FillStyle({color: 0xFF0000, alpha:
1.0}),
radius: 7,
hasShadow: true
}));
map.addOverlay(markerA);
};
function panMarkerA (event:MouseEvent):void {
map.panTo(new LatLng(56.241617,-117.289728));
map.addEventListener(MapMoveEvent.MOVE_END, function
(event:Event):void {
map.openInfoWindow(new LatLng(56.241817,-117.289728),
new InfoWindowOptions({content: "Peace River High
School"}))
});
};
map.addEventListener(MapMouseEvent.DRAG_START, function
(event:MapMouseEvent):void {
map.closeInfoWindow();
});
Thanks,
eyeole
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---