Skip to content

Instantly share code, notes, and snippets.

@marchbold
Last active October 7, 2016 04:51
Show Gist options
  • Save marchbold/c84de2c23a0a35c78138263be75a94bb to your computer and use it in GitHub Desktop.
Save marchbold/c84de2c23a0a35c78138263be75a94bb to your computer and use it in GitHub Desktop.
Create a native map using the NativeMaps ANE
var viewport:Rectangle = new Rectangle( 0, 0, 500, 800 );
NativeMaps.service.addEventListener( NativeMapEvent.MAP_CREATED, mapCreatedHandler );
var success:Boolean = NativeMaps.service.createMap( viewport.width, viewport.height, viewport.x, viewport.y, MapType.MAP_TYPE_HYBRID );
if (success)
{
trace( "Map creation started successfully" );
}
else
{
trace( "Map creation failed - most likely a map has already been created" );
}
...
private function mapCreatedHandler( event:NativeMapEvent ):void
{
trace( "Map created" );
}
// com.distriqt.NativeMaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment