leonardoamx / air-maps-ane

Automatically exported from code.google.com/p/air-maps-ane
0 stars 0 forks source link

About MapMouseEvent #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My code is below:
import com.adobe.nativeExtensions.maps.LatLng;
import com.adobe.nativeExtensions.maps.Map;
import com.adobe.nativeExtensions.maps.MapEvent;
import com.adobe.nativeExtensions.maps.MapMouseEvent;
import com.adobe.nativeExtensions.maps.MapType;
import com.adobe.nativeExtensions.maps.overlays.Marker;

//Iphone IOS Map ANE
public var ViewNavigatorHeight:Number = Capabilities.screenDPI/160*70;  
public var mapDisp:Map = new Map();
private var centerMark:Marker = new Marker(new LatLng(31.2304167,121.4703361));
private var mapViewPort:Rectangle = new 
Rectangle(2,zoomDPI,Capabilities.screenResolutionX-4,Capabilities.screenResoluti
onY-zoomDPI-ViewNavigatorHeight);           
private function LoadMap():void
{  
  //Iphone IOS Map ANE 
  mapDisp.setZoom(16);  
  mapDisp.setCenter(new LatLng(31.2304167,121.4703361));
  mapDisp.showUserLocation = true;
  mapDisp.addEventListener(MapMouseEvent.MARKER_SELECT,CutoverPositionSetTaxiView);
  mapDisp.addOverlay(centerMark);
  mapDisp.setMapType(0);
  mapDisp.visible = true;
  mapDisp.viewPort = mapViewPort;               
}
private function CutoverPositionSetTaxiView(event:MapMouseEvent):void
{
  SecondView.pushView(views.PositionSetTaxi);
}

I wish,when touch Maker or Location point,push an another view in SecondView.
My problem,when touch the Marker,the application no respond request,and touch 
the Location point,the application is exit in iOS.
What error in my code?
Thanks!

Original issue reported on code.google.com by zhang...@gmail.com on 9 Oct 2012 at 1:52

GoogleCodeExporter commented 9 years ago
what is SecondView over here ? You wont be able to push action script views 
just like that. Here Maps is a native iOS view just like StageWebView. You will 
have to remove or hide the maps first and then add another view. Map View will 
always stay on the top. so hide it when you dont need to show it.

Send in the debug/crash logs from XCode for the crash you are seeing.

Original comment by shahme...@gmail.com on 9 Oct 2012 at 6:20