Packagecom.distriqt.extension.nativemaps
Classpublic final class NativeMaps
InheritanceNativeMaps Inheritance flash.events.EventDispatcher

This extension implements native map UI and functionality for iOS and Android.

Currently supported services are:

Important Information

Important: For use on the Android platform, your application must be set up in a specific way to authenticate with the Google Maps service. This includes some custom manifest settings and application signing procedures. Please refer to our instructions in the PDF tutorial supplied with the ANE package files for this extension, or visit the native extensions blog section of our blog here: http://labs.distriqt.com/category/blog/native-extensions for tips and help with ANEs.

The minimum Android SDK version supported for Android maps is API Version 12 (Android 3.2)

Important: The Android native maps implementation utilises the Google Maps API v2, which is part of Google Play Services. Using this API requires you to include a legal notice in your application, for example, under a Legal Notices section or an About section in your app. See: Google's documentation on this for reference.

Getting started

Creating the map is as simple as the following code example. You specify the desired size and position of the map in the create call.

	 var viewport:Rectangle = new Rectangle( 0, 0, 500, 800 );
	 NativeMaps.service.createMap( viewport );
	 



Public Properties
 PropertyDefined By
  circles : Vector.<CircleOverlay>
[read-only] Retrieves a list of all current circle overlays.
NativeMaps
  customMarkerIcons : Vector.<CustomMarkerIcon>
[read-only] Retrieves a list of all current custom marker icons.
NativeMaps
  implementation : String
[read-only] The implementation currently in use.
NativeMaps
  isSupported : Boolean
[static] [read-only] Whether the current device supports the extensions functionality
NativeMaps
  mapOptions : MapOptions
[read-only]
NativeMaps
  markers : Vector.<MapMarker>
[read-only] Retrieves a list of all current map markers.
NativeMaps
  nativeVersion : String
[read-only] The native version string of the native extension.
NativeMaps
  polygons : Vector.<Polygon>
[read-only] Retrieves a list of all current polygon overlays.
NativeMaps
  polylines : Vector.<Polyline>
[read-only] Retrieves a list of all current polyline overlays.
NativeMaps
  projection : Projection
[read-only] Access to the Projection instance for the current map for screen / geographic conversion utilities
NativeMaps
  service : NativeMaps
[static] [read-only] The singleton instance of the Extension class.
NativeMaps
  showingUserLocation : Boolean
[read-only]
NativeMaps
  version : String
[read-only] The version of this extension.
NativeMaps
Public Methods
 MethodDefined By
  
Constructor You should not call this directly, but instead use the singleton access i.e.
NativeMaps
  
Adds a circular overlay to the map.
NativeMaps
  
Adds a reference to a custom marker icon which can be used by MapMarker objects.
NativeMaps
  
addMarker(marker:MapMarker):int
Adds a marker to the map.
NativeMaps
  
addPolygon(polygon:Polygon):int
Adds a polygon overlay to the map.
NativeMaps
  
addPolyline(polyline:Polyline):int
Adds a polyline overlay to the map.
NativeMaps
  
Retrieves the current authorisation status.
NativeMaps
  
clearMap():void
Removes all markers and overlays from the map.
NativeMaps
  
createMap(viewport:Rectangle, mapType:uint = 1, centre:LatLng = null, zoom:Number = -1):Boolean
Creates a native map object using the supplied parameters.
NativeMaps
  
destroyMap():void
Destroys and removes the native map object from the view You should call this method when you change views or are finished displaying the map object.
NativeMaps
  
dispose():void
Disposes the extension and releases any allocated resources.
NativeMaps
  
drawMapToBitmapData():BitmapData
This method is deprecated. You should use the requestMapBitmapData() method and wait for the NativeMapBitmapEvent.READY event to retrieve the bitmap data. Returns a new BitmapData object of the current map view frame NOTE: This is only available on iOS.
NativeMaps
  
Retrieves an array of all current marker IDs
NativeMaps
  
getAltitude():Number
Returns the current altitude of the map camera Supported platforms: iOS only
NativeMaps
  
getBearing():Number
Returns the current bearing orientation of the map.
NativeMaps
  
Returns the current visible area of the map as a LatLngBounds object
NativeMaps
  
Returns the current centre position of the map as a LatLng object.
NativeMaps
  
Retrieves a CircleOverlay object with the specified ID, or null if none exists. Also useful for checking if an overlay exists before performing operations.
NativeMaps
  
Retrieves a CircleOverlay object with the given name, or null if no overlay exists with that name.
NativeMaps
  
getCircleOverlayIdByName(name:String):int
Retrieves a circle overlay's ID number with the given name or -1 if no overlay was found
NativeMaps
  
Returns a custom marker icon for the specified ID
NativeMaps
  
Returns the Google Play Services attribution text which is required to be shown on Android applications utilising the Google Maps service.
NativeMaps
  
getMarker(markerId:uint):MapMarker
Retrieves a MapMarker object with the specified ID, or null if none exists. Also useful for checking if a marker exists before performing operations.
NativeMaps
  
Retrieves a MapMarker object with the given name, or null if no marker exists with that name.
NativeMaps
  
getMarkerIdByName(name:String):int
Retrieves a marker's ID number with the given name or -1 if no marker was found
NativeMaps
  
getMarkerScreenPosition(markerId:uint):Point
Gets the 2D screen coordinate positions of a map marker relative to the top-left corner of the map.
NativeMaps
  
getPolygon(polygonId:uint):Polygon
Retrieves a Polygon object with the specified ID, or null if none exists. Also useful for checking if an overlay exists before performing operations.
NativeMaps
  
Retrieves a Polygon object with the given name, or null if no overlay exists with that name.
NativeMaps
  
getPolygonIdByName(name:String):int
Retrieves a polygon overlay's ID number with the given name or -1 if no overlay was found
NativeMaps
  
getPolyline(polylineId:uint):Polyline
Retrieves a Polyline object with the specified ID, or null if none exists. Also useful for checking if an overlay exists before performing operations.
NativeMaps
  
Retrieves a Polyline object with the given name, or null if no overlay exists with that name.
NativeMaps
  
getPolylineIdByName(name:String):int
Retrieves a polyline overlay's ID number with the given name or -1 if no overlay was found
NativeMaps
  
getTilt():Number
Returns the current tilt level of the map.
NativeMaps
  
getZoom():Number
Returns the current zoom level of the map.
NativeMaps
  
Checks the authorisation status of the application, to see if the user has previously denied access to location services.
NativeMaps
  
hideInfoWindow(markerId:uint):void
Manually closes the info window for the specified marker NOTE: This method overrides the "infoWindowEnabled" property of a marker.
NativeMaps
  
hideMap():Boolean
Hides the map view, if it exists.
NativeMaps
  
init(key:String):void
Deprecated: You no longer need to use an application key
[static] Initialises the extension class for use with the provided developer key.
NativeMaps
  
isRetinaDisplay():Boolean
Returns true or false depending on whether the current device has a retina display
NativeMaps
  
mapExists():Boolean
Returns true or false if the map has been created
NativeMaps
  
Opens the native OS maps application, showing details about a location or directions.
NativeMaps
  
Android only Prepares the view before a map is created.
NativeMaps
  
removeCircleOverlay(circleId:uint):void
Removes a circle overlay from the map.
NativeMaps
  
removeCustomMarkerIcon(id:String):Boolean
Removes and destroys an existing custom marker icon
NativeMaps
  
removeMarker(markerId:uint):void
Removes a marker from the map.
NativeMaps
  
removePolygon(polygonId:uint):void
Removes a polygon overlay from the map.
NativeMaps
  
removePolyline(polylineId:uint):void
Removes a polyline overlay from the map.
NativeMaps
  
requestAuthorisation(status:String):Boolean
Request access to location services.
NativeMaps
  
Requests a new BitmapData object of the current map view frame After this is called, a NativeMapBitmapEvent.READY event will be fired when the bitmap data is available. If the bitmap data was not retrievable, a NativeMapBitmapEvent.FAILED event will be dispatched.
NativeMaps
  
setAltitude(altitude:Number, animated:Boolean = true):void
Sets the altitude of the map camera with optional animation The altitude must not be less than 0 Supported platforms: iOS
NativeMaps
  
setBearing(bearing:Number, animated:Boolean = true, duration:uint = 1000):void
Sets the bearing orientation of the map with optional animation and duration.
NativeMaps
  
setBounds(bounds:LatLngBounds, padding:int = 0, animated:Boolean = true):void
Repositions and zooms the map to fit a specific bounding area with optional padding and animation.
NativeMaps
  
setCentre(position:LatLng, zoom:Number = -1, animated:Boolean = true, duration:int = 2000):void
Moves the map to the given centre coordinate with optional zoom, animation and duration values.
NativeMaps
  
setLayout(width:uint, height:uint, x:uint = 0, y:uint = 0):void
Resizes and repositions the native map object in the view
NativeMaps
  
Applies all map option settings to the map.
NativeMaps
  
NativeMaps
  
setMapType(mapType:uint):void
Sets the type of map to be drawn.
NativeMaps
  
setTilt(tilt:Number, animated:Boolean = true, duration:uint = 1000):void
Sets the tilt level of the map with optional animation and duration.
NativeMaps
  
setUserFollowMode(userTrackingMode:uint):void
Sets the current user tracking mode for iOS maps.
NativeMaps
  
setZoom(zoom:Number, animated:Boolean = true, duration:uint = 1000):void
Sets the zoom level of the map with optional animation.
NativeMaps
  
showBuildings(value:Boolean):void
Sets whether to show 3D buildings the map.
NativeMaps
  
showInfoWindow(markerId:uint):void
Manually opens the info window for the specified marker NOTE: This method overrides the "infoWindowEnabled" property of a marker.
NativeMaps
  
showMap():Boolean
Shows the map view if it is hidden.
NativeMaps
  
showMarker(markerId:uint, shown:Boolean = true):void
Hides or shows a marker on the map.
NativeMaps
  
showPointsOfInterest(value:Boolean):void
Sets whether to show points of interest on the map for iOS.
NativeMaps
  
showUserLocation(show:Boolean = true):void
Enables and shows the user's location marker and any associated UI controls on the map.
NativeMaps
  
Stops any movement or panning animation of the map.
NativeMaps
  
updateCircleOverlay(circleId:uint):void
Updates and redraws a Circle overlay with any new data.
NativeMaps
  
updateMarker(idNameOrMarker:*):void
Updates the properties of an existing map marker.
NativeMaps
  
updatePolygon(polygonId:uint):void
Updates and redraws a Polygon with any new data.
NativeMaps
  
updatePolyline(polylineId:uint):void
Updates and redraws a Polyline with any new data.
NativeMaps
  
zoomIn():void
Zooms the map in by one level
NativeMaps
  
zoomOut():void
Zooms the map out by one level
NativeMaps
Protected Methods
 MethodDefined By
  
NativeMaps
  
getMapOpenPlaceString(place:*):String
NativeMaps
  
NativeMaps
Public Constants
 ConstantDefined By
  EXT_CONTEXT_ID : String = com.distriqt.NativeMaps
[static]
NativeMaps
  VERSION : String = 6.0.0
[static]
NativeMaps
Property Detail
circlesproperty
circles:Vector.<CircleOverlay>  [read-only]

Retrieves a list of all current circle overlays.


Implementation
    public function get circles():Vector.<CircleOverlay>

See also

customMarkerIconsproperty 
customMarkerIcons:Vector.<CustomMarkerIcon>  [read-only]

Retrieves a list of all current custom marker icons.


Implementation
    public function get customMarkerIcons():Vector.<CustomMarkerIcon>

See also

implementationproperty 
implementation:String  [read-only]

The implementation currently in use. This should be one of the following depending on the platform in use and the functionality supported by this extension:


Implementation
    public function get implementation():String
isSupportedproperty 
isSupported:Boolean  [read-only]

Whether the current device supports the extensions functionality


Implementation
    public static function get isSupported():Boolean
mapOptionsproperty 
mapOptions:MapOptions  [read-only]


Implementation
    public function get mapOptions():MapOptions
markersproperty 
markers:Vector.<MapMarker>  [read-only]

Retrieves a list of all current map markers.


Implementation
    public function get markers():Vector.<MapMarker>

See also

nativeVersionproperty 
nativeVersion:String  [read-only]

The native version string of the native extension.


Implementation
    public function get nativeVersion():String
polygonsproperty 
polygons:Vector.<Polygon>  [read-only]

Retrieves a list of all current polygon overlays.


Implementation
    public function get polygons():Vector.<Polygon>

See also

polylinesproperty 
polylines:Vector.<Polyline>  [read-only]

Retrieves a list of all current polyline overlays.


Implementation
    public function get polylines():Vector.<Polyline>

See also

projectionproperty 
projection:Projection  [read-only]

Access to the Projection instance for the current map for screen / geographic conversion utilities


Implementation
    public function get projection():Projection
serviceproperty 
service:NativeMaps  [read-only]

The singleton instance of the Extension class.


Implementation
    public static function get service():NativeMaps
showingUserLocationproperty 
showingUserLocation:Boolean  [read-only]


Implementation
    public function get showingUserLocation():Boolean
versionproperty 
version:String  [read-only]

The version of this extension.

This should be of the format, MAJOR.MINOR.BUILD


Implementation
    public function get version():String
Constructor Detail
NativeMaps()Constructor
public function NativeMaps()

Constructor You should not call this directly, but instead use the singleton access i.e. NativeMaps.service.FUNCTION()

Method Detail
addCircleOverlay()method
public function addCircleOverlay(circle:CircleOverlay):int

Adds a circular overlay to the map.

Create an instance of the CircleOverlay class and pass it to this method.

This method returns the ID (an int) of the newly created overlay. Overlay IDs are managed internally, so you may keep a record of this ID number to refer back to the polyline later.

The CircleOverlay class also contains a "name" string property, which is not used internally but may be useful if you wish to add a descriptive name to overlay objects. CircleOverlays can be accessed later using this name property if desired. Names should be unique if used.

Parameters

circle:CircleOverlay — CircleOverlay The circle overlay to be added

Returns
int — int The ID of the newly created circle overlay

See also

addCustomMarkerIcon()method 
public function addCustomMarkerIcon(icon:CustomMarkerIcon):void

Adds a reference to a custom marker icon which can be used by MapMarker objects.

Create an instance of the CustomMarkerIcon class before passing it to this method.

Parameters

icon:CustomMarkerIcon — CustomMarkerIcon The custom icon to be added

See also

addMarker()method 
public function addMarker(marker:MapMarker):int

Adds a marker to the map.

Create an instance of the MapMarker class and set its options before passing it to this method.

This method returns the ID (an int) of the newly created marker. Marker IDs are managed internally, so you may keep a record of this ID number to refer back to the marker later.

The MapMarker class also contains a "name" string property, which is not used internally but may be useful if you wish to add a descriptive name to marker objects. Markers can be accessed later using this name property if desired. Names should be unique if used.

Parameters

marker:MapMarker — MapMarker The marker to be added

Returns
int — int The ID of the newly created marker

See also

addPolygon()method 
public function addPolygon(polygon:Polygon):int

Adds a polygon overlay to the map.

Create an instance of the Polygon class and pass it to this method.

This method returns the ID (an int) of the newly created overlay. Overlay IDs are managed internally, so you may keep a record of this ID number to refer back to the polyline later.

The Polygon class also contains a "name" string property, which is not used internally but may be useful if you wish to add a descriptive name to overlay objects. Polygons can be accessed later using this name property if desired. Names should be unique if used.

Parameters

polygon:Polygon — Polygon The polygon overlay to be added

Returns
int — int The ID of the newly created polygon overlay

See also

addPolyline()method 
public function addPolyline(polyline:Polyline):int

Adds a polyline overlay to the map.

Create an instance of the Polyline class and pass it to this method.

This method returns the ID (an int) of the newly created overlay. Overlay IDs are managed internally, so you may keep a record of this ID number to refer back to the polyline later.

The Polyline class also contains a "name" string property, which is not used internally but may be useful if you wish to add a descriptive name to overlay objects. Polylines can be accessed later using this name property if desired. Names should be unique if used.

Parameters

polyline:Polyline — Polyline The polyline overlay to be added

Returns
int — int The ID of the newly created polyline overlay

See also

authorisationStatus()method 
public function authorisationStatus():String

Retrieves the current authorisation status.

Returns
String

See also

clearMap()method 
public function clearMap():void

Removes all markers and overlays from the map.

createMap()method 
public function createMap(viewport:Rectangle, mapType:uint = 1, centre:LatLng = null, zoom:Number = -1):Boolean

Creates a native map object using the supplied parameters.

If not set, the mapType parameter will default to the regular NORMAL map type. See the MapType helper class for available map types.

Parameters

viewport:Rectangle — The rectangle area defining the width,height and position of the map in your air application
 
mapType:uint (default = 1) — The map type to show initially (see MapType class)
 
centre:LatLng (default = null) — The initial centre location of the map
 
zoom:Number (default = -1) — The initial zoom of the map

Returns
Boolean — true if the map was created.

See also

destroyMap()method 
public function destroyMap():void

Destroys and removes the native map object from the view

You should call this method when you change views or are finished displaying the map object.

dispatchCapturedBitmap()method 
protected function dispatchCapturedBitmap():void

dispose()method 
public function dispose():void

Disposes the extension and releases any allocated resources. Once this function has been called, a call to init is neccesary again before any of the extensions functionality will work.

drawMapToBitmapData()method 
public function drawMapToBitmapData():BitmapData

This method is deprecated.

You should use the requestMapBitmapData() method and wait for the NativeMapBitmapEvent.READY event to retrieve the bitmap data.

Returns a new BitmapData object of the current map view frame

NOTE: This is only available on iOS. Not supported on Android.

Returns
BitmapData — BitmapData A new bitmap data object containing data from the map view
getAllMarkerIDs()method 
public function getAllMarkerIDs():Array

Retrieves an array of all current marker IDs

Returns
Array — Array An array of integers representing all current valid marker IDs
getAltitude()method 
public function getAltitude():Number

Returns the current altitude of the map camera

Supported platforms: iOS only

Returns
Number — Number The current map camera altitude in metres
getBearing()method 
public function getBearing():Number

Returns the current bearing orientation of the map.

Supported platforms: Android and iOS

Returns
Number — Number The current bearing orientation
getBounds()method 
public function getBounds():LatLngBounds

Returns the current visible area of the map as a LatLngBounds object

Returns
LatLngBounds — LatLngBounds The current bounds object of the map view or null if not available

See also

getCentre()method 
public function getCentre():LatLng

Returns the current centre position of the map as a LatLng object.

Returns
LatLng — LatLng The current centre position of the map

See also

getCircleOverlay()method 
public function getCircleOverlay(circleId:uint):CircleOverlay

Retrieves a CircleOverlay object with the specified ID, or null if none exists.

Also useful for checking if an overlay exists before performing operations.

Parameters

circleId:uint — int - The circle ID to get

Returns
CircleOverlay — CircleOverlay The circle overlay if found, or null
getCircleOverlayByName()method 
public function getCircleOverlayByName(name:String):CircleOverlay

Retrieves a CircleOverlay object with the given name, or null if no overlay exists with that name.

Parameters

name:String — String - The name of the circle to retrieve

Returns
CircleOverlay — CircleOverlay The circle overlay, if found, or null
getCircleOverlayIdByName()method 
public function getCircleOverlayIdByName(name:String):int

Retrieves a circle overlay's ID number with the given name or -1 if no overlay was found

Parameters

name:String — String - The name of the circle overlay to retrieve

Returns
int — int The circle's ID or -1 if none was found
getCustomIconById()method 
public function getCustomIconById(id:String):CustomMarkerIcon

Returns a custom marker icon for the specified ID

Parameters

id:String — String The ID of the custom icon to retrieve

Returns
CustomMarkerIcon — CustomMarkerIcon The custom icon object if found, otherwise null
getGooglePlayLegalNotice()method 
public function getGooglePlayLegalNotice():String

Returns the Google Play Services attribution text which is required to be shown on Android applications utilising the Google Maps service.

Availble and required only on Android

See: https://developers.google.com/maps/documentation/android/intro#attribution_requirements

Returns
String — The Google Play legal notice which must be displayed in Android apps
getMapOpenPlaceString()method 
protected function getMapOpenPlaceString(place:*):String

Parameters

place:*

Returns
String
getMarker()method 
public function getMarker(markerId:uint):MapMarker

Retrieves a MapMarker object with the specified ID, or null if none exists.

Also useful for checking if a marker exists before performing operations.

Parameters

markerId:uint — int - The marker ID to get

Returns
MapMarker — MapMarker The map marker if found, or null
getMarkerByName()method 
public function getMarkerByName(name:String):MapMarker

Retrieves a MapMarker object with the given name, or null if no marker exists with that name.

Parameters

name:String — String - The name of the marker to retrieve

Returns
MapMarker — MapMarker The map marker if found, or null
getMarkerIdByName()method 
public function getMarkerIdByName(name:String):int

Retrieves a marker's ID number with the given name or -1 if no marker was found

Parameters

name:String — String - The name of the marker to retrieve

Returns
int — int The marker's ID or -1 if no marker was found
getMarkerScreenPosition()method 
public function getMarkerScreenPosition(markerId:uint):Point

Gets the 2D screen coordinate positions of a map marker relative to the top-left corner of the map.

Note that the position is relative to the top left corner of the actual internal map view. If you are positioning the map view at a position other than 0, 0 (top-left of the stage), you must account for this offset yourself.

Parameters

markerId:uint

Returns
Point — Point A point object specifying the X and Y position, or 0, 0 if not available
getPolygon()method 
public function getPolygon(polygonId:uint):Polygon

Retrieves a Polygon object with the specified ID, or null if none exists.

Also useful for checking if an overlay exists before performing operations.

Parameters

polygonId:uint — int - The polygon ID to get

Returns
Polygon — Polygon The polygon overlay if found, or null
getPolygonByName()method 
public function getPolygonByName(name:String):Polygon

Retrieves a Polygon object with the given name, or null if no overlay exists with that name.

Parameters

name:String — String - The name of the polygon to retrieve

Returns
Polygon — Polygon The polygon overlay, if found, or null
getPolygonIdByName()method 
public function getPolygonIdByName(name:String):int

Retrieves a polygon overlay's ID number with the given name or -1 if no overlay was found

Parameters

name:String — String - The name of the polygon to retrieve

Returns
int — int The polygon's ID or -1 if none was found
getPolyline()method 
public function getPolyline(polylineId:uint):Polyline

Retrieves a Polyline object with the specified ID, or null if none exists.

Also useful for checking if an overlay exists before performing operations.

Parameters

polylineId:uint — int - The polyline ID to get

Returns
Polyline — Polyline The polyline overlay if found, or null
getPolylineByName()method 
public function getPolylineByName(name:String):Polyline

Retrieves a Polyline object with the given name, or null if no overlay exists with that name.

Parameters

name:String — String - The name of the polyline to retrieve

Returns
Polyline — Polyline The polyline overlay, if found, or null
getPolylineIdByName()method 
public function getPolylineIdByName(name:String):int

Retrieves a polyline overlay's ID number with the given name or -1 if no overlay was found

Parameters

name:String — String - The name of the polyline to retrieve

Returns
int — int The polylines's ID or -1 if none was found
getTilt()method 
public function getTilt():Number

Returns the current tilt level of the map.

Supported platforms: Android and iOS

Returns
Number — Number The current tilt level
getUrlForMapOpen()method 
protected function getUrlForMapOpen(options:MapApplicationOpenOptions):String

Parameters

options:MapApplicationOpenOptions

Returns
String
getZoom()method 
public function getZoom():Number

Returns the current zoom level of the map.

Returns
Number — Number The current zoom level
hasAuthorisation()method 
public function hasAuthorisation():Boolean

Checks the authorisation status of the application, to see if the user has previously denied access to location services.

This will return true, if the user has allowed access, either only while in use or always. If the user has not yet been asked to grant permission, or if the user has previously denied access it will return false.

Returns
Boolean — true if the user has granted access and false otherwise

See also

hideInfoWindow()method 
public function hideInfoWindow(markerId:uint):void

Manually closes the info window for the specified marker

NOTE: This method overrides the "infoWindowEnabled" property of a marker.

Parameters

markerId:uint — ID number of the marker to close the info window for

hideMap()method 
public function hideMap():Boolean

Hides the map view, if it exists.

This does not destroy or remove the map from memory, it simply hides the view. To remove the map completely, call destroyMap().

Returns
Booleantrue on success

See also

init()method 
public static function init(key:String):void
Deprecated: You no longer need to use an application key

Initialises the extension class for use with the provided developer key.

Parameters

key:String

isRetinaDisplay()method 
public function isRetinaDisplay():Boolean

Returns true or false depending on whether the current device has a retina display

Returns
Boolean — Boolean
mapExists()method 
public function mapExists():Boolean

Returns true or false if the map has been created

Returns
Boolean — Boolean True or false depending on whether the map exists and has been created
openMapsApplicationWithOptions()method 
public function openMapsApplicationWithOptions(options:MapApplicationOpenOptions):void

Opens the native OS maps application, showing details about a location or directions.

Parameters

options:MapApplicationOpenOptions — The specified options to pass to the Map application

See also

prepareViewOrder()method 
public function prepareViewOrder():void

Android only

Prepares the view before a map is created. This is required on most versions of Android because of the way Android renders GL surfaces. Without this method being called, the map layer may not be visible or may behave strangely on some versions of Android.

NOTE: Calling this method will usually result in a quick flash of a black screen, which is unavoidable for now. It's suggested that you call this method quickly after startup, or at a convenient time when the flash of a black screen will be least noticeable by the user.

NOTE: If not manually called, this method will be automatically triggered before a map is created the first time.

removeCircleOverlay()method 
public function removeCircleOverlay(circleId:uint):void

Removes a circle overlay from the map.

Parameters

circleId:uint — ID number of the circle overlay to be removed.

removeCustomMarkerIcon()method 
public function removeCustomMarkerIcon(id:String):Boolean

Removes and destroys an existing custom marker icon

Parameters

id:String — String The ID of the custom icon to remove

Returns
Boolean — Boolean True if the custom icon was found and removed, otherwise false
removeMarker()method 
public function removeMarker(markerId:uint):void

Removes a marker from the map.

Parameters

markerId:uint — ID number of the map marker to be removed.

removePolygon()method 
public function removePolygon(polygonId:uint):void

Removes a polygon overlay from the map.

Parameters

polygonId:uint — ID number of the polygon overlay to be removed.

removePolyline()method 
public function removePolyline(polylineId:uint):void

Removes a polyline overlay from the map.

Parameters

polylineId:uint — ID number of the polyline to be removed.

requestAuthorisation()method 
public function requestAuthorisation(status:String):Boolean

Request access to location services. Performs a simple operation to force the display of the permission dialog.

Note on iOS this will only be shown if the authorisation status is currently NOT_DETERMINED

This allows you to control when the permission dialog is presented.

Parameters

status:String (default = NaN)

Returns
Boolean
requestMapBitmapData()method 
public function requestMapBitmapData():void

Requests a new BitmapData object of the current map view frame

After this is called, a NativeMapBitmapEvent.READY event will be fired when the bitmap data is available.

If the bitmap data was not retrievable, a NativeMapBitmapEvent.FAILED event will be dispatched.

See also

setAltitude()method 
public function setAltitude(altitude:Number, animated:Boolean = true):void

Sets the altitude of the map camera with optional animation

The altitude must not be less than 0

Supported platforms: iOS

Parameters

altitude:Number — The new altitude of the map camera in metres (must be > 0)
 
animated:Boolean (default = true) — Optional, whether to animate the change. Defaults to true.

setBearing()method 
public function setBearing(bearing:Number, animated:Boolean = true, duration:uint = 1000):void

Sets the bearing orientation of the map with optional animation and duration.

The bearing value should be between 0 and 360

Supported platforms: Android and iOS

Parameters

bearing:Number — The new bearing orientation value to change to, should be between 0 and 360
 
animated:Boolean (default = true) — Optional, whether to animate the bearing change. Defaults to true.
 
duration:uint (default = 1000) — Length of animation in milliseconds, defaults to 1000 (1 second) uration is only supported on Android

setBounds()method 
public function setBounds(bounds:LatLngBounds, padding:int = 0, animated:Boolean = true):void

Repositions and zooms the map to fit a specific bounding area with optional padding and animation.

Parameters

bounds:LatLngBounds — LatLngBounds object representing the desired bounding area
 
padding:int (default = 0) — int Optional padding distance in pixels to apply around the edges of the new span area
 
animated:Boolean (default = true) — Optional, whether to animate the movement. Defaults to true.

See also

setCentre()method 
public function setCentre(position:LatLng, zoom:Number = -1, animated:Boolean = true, duration:int = 2000):void

Moves the map to the given centre coordinate with optional zoom, animation and duration values.

Setting the zoom property will also zoom the map to the given zoom level.

Setting the animation property to true or false defines whether the map smoothly animates to the new position, or moves instantly.

Setting the duration property allows you to specify the time in milliseconds the animation should take.

Parameters

position:LatLng — The new centre position for the map to centre on.
 
zoom:Number (default = -1) — Optional new zoom level to change to, or -1 to keep the current zoom level
 
animated:Boolean (default = true) — Optional value to animate the movement. Defaults to true.
 
duration:int (default = 2000) — Time in milliseconds for move animation to take. Defaults to 2000 (2 seconds). Not supported on iOS, only on Android.

See also

setLayout()method 
public function setLayout(width:uint, height:uint, x:uint = 0, y:uint = 0):void

Resizes and repositions the native map object in the view

Parameters

width:uint — The width in pixels of the map frame
 
height:uint — The height in pixels of the map frame
 
x:uint (default = 0) — The X position of the map on the stage
 
y:uint (default = 0) — The Y position of the map on the stage

setMapOptions()method 
public function setMapOptions(options:MapOptions):void

Applies all map option settings to the map.

The MapOptions class contains many settings for different available options. Some options are available only on specific platforms (iOS or Android) so please refer to the MapOptions class reference for this information.

The same options may be used for cross-platform maps, however unsupported options will have no effect on the map for some settings.

Parameters

options:MapOptions — MapOptions class instance to be applied.

See also

setMapStyle()method 
public function setMapStyle(style:MapStyleOptions):Boolean

Parameters

style:MapStyleOptions

Returns
Boolean
setMapType()method 
public function setMapType(mapType:uint):void

Sets the type of map to be drawn.

Available map types are:

Parameters

mapType:uint — The map type to be used.

See also

setTilt()method 
public function setTilt(tilt:Number, animated:Boolean = true, duration:uint = 1000):void

Sets the tilt level of the map with optional animation and duration.

The tilt defines the camera's position on an arc between directly over the map's center position and the surface of the Earth, measured in degrees from the nadir (the direction pointing directly below the camera). When you change the viewing angle, the map appears in perspective, with far-away features appearing smaller, and nearby features appearing larger.

The value in this property may be clamped to a maximum value to maintain map readability. There is no fixed maximum value, though, because the actual maximum value is dependent on the current altitude of the camera.

Supported platforms: Android and iOS

Parameters

tilt:Number — The new tilt level to change to, should be between 0 and 30
 
animated:Boolean (default = true) — Optional, whether to animate the tilt change. Defaults to true.
 
duration:uint (default = 1000) — Length of animation in milliseconds, defaults to 1000 (1 second) (Duration is only supported on Android)

setUserFollowMode()method 
public function setUserFollowMode(userTrackingMode:uint):void

Sets the current user tracking mode for iOS maps.

Availble only on iOS, not supported on Android.

Parameters

userTrackingMode:uint

See also

setZoom()method 
public function setZoom(zoom:Number, animated:Boolean = true, duration:uint = 1000):void

Sets the zoom level of the map with optional animation.

Zoom level should be between 1 and 18, where 1 is the most zoomed out.

Parameters

zoom:Number — The new zoom level to change to
 
animated:Boolean (default = true) — Optional, whether to animate the zoom change. Defaults to true.
 
duration:uint (default = 1000) — Length of animation in milliseconds, defaults to 1000 (1 second) uration is only supported on Android

showBuildings()method 
public function showBuildings(value:Boolean):void

Sets whether to show 3D buildings the map.

Availble only on iOS, not supported on Android.

Parameters

value:Boolean — True or false to show buildings on the map. This defaults to TRUE.

showInfoWindow()method 
public function showInfoWindow(markerId:uint):void

Manually opens the info window for the specified marker

NOTE: This method overrides the "infoWindowEnabled" property of a marker.

Parameters

markerId:uint — ID number of the marker to open the info window for

showMap()method 
public function showMap():Boolean

Shows the map view if it is hidden.

Returns
Booleantrue on success

See also

showMarker()method 
public function showMarker(markerId:uint, shown:Boolean = true):void

Hides or shows a marker on the map.

Parameters

markerId:uint — ID number of the target map marker
 
shown:Boolean (default = true) — Boolean True or false to show or hide the marker, respectively

showPointsOfInterest()method 
public function showPointsOfInterest(value:Boolean):void

Sets whether to show points of interest on the map for iOS.

From the iOS documentation:

When this property is set to YES, the map displays icons and labels for restaurants, schools, and other relevant points of interest.

Availble only on iOS, not supported on Android.

Parameters

value:Boolean — True or false to show points of interest on the map. This defaults to TRUE.

showUserLocation()method 
public function showUserLocation(show:Boolean = true):void

Enables and shows the user's location marker and any associated UI controls on the map.

Parameters

show:Boolean (default = true) — Whether to turn on or off the user location UI and marker.

stopAnimation()method 
public function stopAnimation():void

Stops any movement or panning animation of the map.

updateCircleOverlay()method 
public function updateCircleOverlay(circleId:uint):void

Updates and redraws a Circle overlay with any new data.

You should call this is if you modify any properties of the circle after it has been created.

Parameters

circleId:uint — ID number of the polyline to be update.

updateMarker()method 
public function updateMarker(idNameOrMarker:*):void

Updates the properties of an existing map marker.

You can pass any of the following values to specify the marker to be updated:

Markers can be accessed directly through other available methods. If you update a marker's properties, be sure to call this method with the marker object to apply the new values.

Parameters

idNameOrMarker:* — ID number or name reference of marker, or MapMarker object to be updated

See also

updatePolygon()method 
public function updatePolygon(polygonId:uint):void

Updates and redraws a Polygon with any new data.

You should call this is if you modify any properties of the polygon after it has been created.

Parameters

polygonId:uint — ID number of the polygon to be update.

updatePolyline()method 
public function updatePolyline(polylineId:uint):void

Updates and redraws a Polyline with any new data.

You should call this is if you modify any properties of the polyline after it has been created.

Parameters

polylineId:uint — ID number of the polyline to be update.

zoomIn()method 
public function zoomIn():void

Zooms the map in by one level

zoomOut()method 
public function zoomOut():void

Zooms the map out by one level

Constant Detail
EXT_CONTEXT_IDConstant
public static const EXT_CONTEXT_ID:String = com.distriqt.NativeMaps

VERSIONConstant 
public static const VERSION:String = 6.0.0