Helen,
Appreciate this. The double click event seems not to fire at all.
addListeners is being called from the constructor of my Main Controller AS3
class.
public function MainController(map:Map3D, featuresManager:RemoteObject,
tree:Tree, mapContainer:UIComponent, featuresData:XML)
{
this.map = map;
this.featuresManager = featuresManager;
this.tree = tree;
this.mapContainer = mapContainer;
this.featuresData = featuresData;
this.selectedFeaturesList = new Array();
loadLayersXML();
addListeners();
}
and this constructor is called from my main mxml's startMap function
public function startMap(event:Event):void
{
map = new Map3D();
mapContainer.addChild(map);
mainController = new MainController(map, featuresManager,
featuresTree, mapContainer, featuresData);
}
startMap is called by the UIComponent containing the map.
<mx:UIComponent id="mapContainer" initialize="startMap(event);"
resize="resizeMap(event)" width="100%" height="100%"/>
Hope this clears the whole application flow.
Regards,
- Mahmood
+92 300 4485655
On Tue, Aug 18, 2009 at 7:36 PM, helen <[email protected]> wrote:
>
> Mahmood,
> I can verify that MapMouseEvent.DOUBLE_CLICK does fire in Map3D.
> Are you finding that it doesn't seem to work sometimes or all the
> time?
> From the code you posted, I can't tell when your addListeners function
> is called, but I would first doublecheck that it is indeed being
> called, and have something like a trace or Alert as the first line in
> onMapDoubleClicked to see if it is called each time.
>
> On Aug 17, 4:59 am, Mahmood <[email protected]> wrote:
> > Hi,
> >
> > I have added 3D map's capabilities to my flex application with the
> > following code
> >
> > private function addListeners():void
> > {
> > map.addEventListener(MapEvent.MAP_READY, onMapReady);
> > map.addEventListener(MapEvent.MAP_PREINITIALIZE,
> > onMapPreInitialize);
> > map.addEventListener(MapMouseEvent.DOUBLE_CLICK,
> > onMapDoubleClicked);
> > map.addEventListener(MapMouseEvent.CLICK,
> onMapClicked);
> > map.addEventListener(MapMouseEvent.MOUSE_MOVE,
> onMapMouseMoved);
> > }
> >
> > private function onMapPreInitialize(event:MapEvent):void
> > {
> > var opt:MapOptions = new MapOptions();
> > opt.viewMode = View.VIEWMODE_PERSPECTIVE;
> > opt.attitude = new Attitude(20,30,0);
> > map.setInitOptions(opt);
> > }
> >
> > private function onMapReady(event:MapEvent):void
> > {
> > map.setCenter(new LatLng(defaultLatitude,
> defaultLongitude), 14,
> > MapType.HYBRID_MAP_TYPE);
> > map.disableContinuousZoom();
> >
> > map.setDoubleClickMode(MapAction.ACTION_NOTHING);
> > //map.addControl(new ZoomControl());
> > //map.addControl(new MapTypeControl());
> > //map.addControl(new PositionControl());
> > map.addControl(new NavigationControl());
> > featuresManager.getAllFeatures();
> > addContextMenus();
> > }
> >
> > This works fine for the 3D map, but the MapMouseEvent.DOUBLE_CLICK
> > does not remain consistent. i.e, the double click event is not fired
> > every time user double clicks the map.
> >
> > Any help will be appreciated.
> >
> > Regards,
> > - Mahmood
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---