Packagecom.afcomponents.umap.display.routemanager
Classpublic class MapQuestService
InheritanceMapQuestService Inheritance DefaultRouteService Inheritance flash.events.EventDispatcher
Implementsflash.events.IEventDispatcher, IRouteService



Public Properties
 PropertyDefined by
 InheritedrouteResults : RouteResults
Returns route results obtained by previous doRoute operation.
DefaultRouteService
Protected Properties
 PropertyDefined by
 Inherited_loader : URLLoader
DefaultRouteService
 Inherited_options : Object
Default route options.
DefaultRouteService
 Inherited_results : RouteResults
DefaultRouteService
Public Methods
 MethodDefined by
  
MapQuestService(options:Object = null)
Creates new MapQuest Route service object.
MapQuestService
 Inherited
dispose():void
Releases all the resources accuired by the service.
DefaultRouteService
  
doRoute(locations:Array, options:Object = null):Boolean
Request a route between 2 or more locations.
MapQuestService
Protected Methods
 MethodDefined by
 Inherited
copyOptions(options:Object):void
Copies all properties from the specified options Object to the default options Object.
DefaultRouteService
 Inherited
mergeOptions(options:Object):Object
Adds properties from the default options Object to the target options Object, only if they are are not specified in the target options Object.
DefaultRouteService
  
parseData(data:String):void
Parse the request data that was loaded by the service.
MapQuestService
 Inherited
sendRequest(request:*):Boolean
Processes request specified as a URI String or URLRequest object.
DefaultRouteService
Public Constants
 ConstantDefined by
  LANGUAGE_BRITISH_ENGLISH : String = "British English"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_DANISH : String = "Danish"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_DUTCH : String = "Dutch"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_ENGLISH : String = "English"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_FRENCH : String = "French"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_GERMAN : String = "German"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_IBERIAN_PORTUGUESE : String = "Iberian Portuguese"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_IBERIAN_SPANISH : String = "Iberian Spanish"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_ITALIAN : String = "Italian"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_NORWEGIAN : String = "Norwegian"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_SPANISH : String = "Spanish"
[static] Defines the value of the langauge property.
MapQuestService
  LANGUAGE_SWEDISH : String = "Swedish"
[static] Defines the value of the langauge property.
MapQuestService
  NARRATIVE_DISTANCE_UNIT_KILOMETERS : int = 1
[static] Defines the value of the narrativeDistanceUnitType property.
MapQuestService
  NARRATIVE_DISTANCE_UNIT_MILES : int = 0
[static] Defines the value of the narrativeDistanceUnitType property.
MapQuestService
  NARRATIVE_TYPE_DEFAULT : int = 0
[static] Defines the value of the narrativeType property.
MapQuestService
  NARRATIVE_TYPE_HTML : int = 1
[static] Defines the value of the narrativeType property.
MapQuestService
  NARRATIVE_TYPE_NONE : int = -1
[static] Defines the value of the narrativeType property.
MapQuestService
  RESULT_INVALID_LOCATION : int = 1
[static] Defines the value of the resultCode property of the RouteEvent object.
MapQuestService
  RESULT_NO_DATASET_FOUND : int = 3
[static] Defines the value of the resultCode property of the RouteEvent object.
MapQuestService
  RESULT_NOT_SPECIFIED : int = -1
[static] Defines the value of the resultCode property of the RouteEvent object.
MapQuestService
  RESULT_ROUTE_FAILURE : int = 2
[static] Defines the value of the resultCode property of the RouteEvent object.
MapQuestService
  RESULT_SUCCESS : uint = 0
[static] Defines the value of the resultCode property of the RouteEvent object.
MapQuestService
  ROUTE_TYPE_FASTEST : int = 0
[static] Defines the value of the routeType property.
MapQuestService
  ROUTE_TYPE_OPTIMIZED : int = 3
[static] Defines the value of the routeType property.
MapQuestService
  ROUTE_TYPE_PEDESTRIAN : int = 2
[static] Defines the value of the routeType property.
MapQuestService
  ROUTE_TYPE_SELECT_DATASET_ONLY : int = 4
[static] Defines the value of the routeType property.
MapQuestService
  ROUTE_TYPE_SHORTEST : int = 1
[static] Defines the value of the routeType property.
MapQuestService
Constructor detail
MapQuestService()constructor
public function MapQuestService(options:Object = null)

Creates new MapQuest Route service object. Specify default options in the constructor parameter.

In the following table you can see the list of route options, together with default values.

Parameter Values Default Description
routeType ROUTE_TYPE_/td> ROUTE_TYPE_SHORTEST Type of route to calculate
narrativeType NARRATIVE_TYPE_/td> NARRATIVE_TYPE_HTML Narrative type, that will be generated for each maneuver.
narrativeDistanceUnitType NARRATIVE_DISTANCE_UNIT_/td> NARRATIVE_IDSTANCE_UNIT_MILES Distance uints displayed in route narrative.
maxShape 0..int 50 The maximum number of shape points to return for each maneuver. If zero, no shape data is returned.
language LANGUAGE_/td> LANGUAGE_ENGLISH Language to use in the narrative.
rawRouteOptions XML <RouteOptions><option1/><option2></RouteOptions> null Additional options in XML format.
url String http://route.dev.mapquest.com/mq/mqserver.dll?e=5& URL of the map quest routing server
requestMethod URLRequestMethod.GET, URLRequestMethod.POST URLRequestMethod.POST Request method to use for the doRoute() opration.

Parameters
options:Object (default = null) — Defines default service options.
Method detail
doRoute()method
public override function doRoute(locations:Array, options:Object = null):Boolean

Request a route between 2 or more locations. Locations can be specified as GeoAddress objects, LatLng objects or GeoAddress in MapQuest XML format. Additional options should be sepcified in the second parameter.

Parameters
locations:Array — Array of 2 or more locations.
 
options:Object (default = null) — Additonal options.

Returns
Boolean — A value of true if a request has been accepted, and is being processed; false if it is not.

See also

parseData()method 
protected override function parseData(data:String):void

Parse the request data that was loaded by the service. As a result of this operation service should create a Route object, and send it in a RouteEvent.READY.

Parameters
data:String — String which contains the data.
Constant detail
LANGUAGE_BRITISH_ENGLISHconstant
public static const LANGUAGE_BRITISH_ENGLISH:String = "British English"

Defines the value of the langauge property. Use this value to get narrative in British English.

LANGUAGE_DANISHconstant 
public static const LANGUAGE_DANISH:String = "Danish"

Defines the value of the langauge property. Use this value to get narrative in Danish.

LANGUAGE_DUTCHconstant 
public static const LANGUAGE_DUTCH:String = "Dutch"

Defines the value of the langauge property. Use this value to get narrative in Dutch.

LANGUAGE_ENGLISHconstant 
public static const LANGUAGE_ENGLISH:String = "English"

Defines the value of the langauge property. Use this value to get narrative in English.

LANGUAGE_FRENCHconstant 
public static const LANGUAGE_FRENCH:String = "French"

Defines the value of the langauge property. Use this value to get narrative in French.

LANGUAGE_GERMANconstant 
public static const LANGUAGE_GERMAN:String = "German"

Defines the value of the langauge property. Use this value to get narrative in German.

LANGUAGE_IBERIAN_PORTUGUESEconstant 
public static const LANGUAGE_IBERIAN_PORTUGUESE:String = "Iberian Portuguese"

Defines the value of the langauge property. Use this value to get narrative in Iberian Portuguese.

LANGUAGE_IBERIAN_SPANISHconstant 
public static const LANGUAGE_IBERIAN_SPANISH:String = "Iberian Spanish"

Defines the value of the langauge property. Use this value to get narrative in Iberian Spanish.

LANGUAGE_ITALIANconstant 
public static const LANGUAGE_ITALIAN:String = "Italian"

Defines the value of the langauge property. Use this value to get narrative in Italian.

LANGUAGE_NORWEGIANconstant 
public static const LANGUAGE_NORWEGIAN:String = "Norwegian"

Defines the value of the langauge property. Use this value to get narrative in Norwegian.

LANGUAGE_SPANISHconstant 
public static const LANGUAGE_SPANISH:String = "Spanish"

Defines the value of the langauge property. Use this value to get narrative in Spanish.

LANGUAGE_SWEDISHconstant 
public static const LANGUAGE_SWEDISH:String = "Swedish"

Defines the value of the langauge property. Use this value to get narrative in Swedish.

NARRATIVE_DISTANCE_UNIT_KILOMETERSconstant 
public static const NARRATIVE_DISTANCE_UNIT_KILOMETERS:int = 1

Defines the value of the narrativeDistanceUnitType property. Use this value to get distance in kilometers.

NARRATIVE_DISTANCE_UNIT_MILESconstant 
public static const NARRATIVE_DISTANCE_UNIT_MILES:int = 0

Defines the value of the narrativeDistanceUnitType property. Use this value to get distance in miles.

NARRATIVE_TYPE_DEFAULTconstant 
public static const NARRATIVE_TYPE_DEFAULT:int = 0

Defines the value of the narrativeType property. Use this value to get standard text narrative.

NARRATIVE_TYPE_HTMLconstant 
public static const NARRATIVE_TYPE_HTML:int = 1

Defines the value of the narrativeType property. Use this value to get text narrative with some HTML tags: e.g. bold road names.

NARRATIVE_TYPE_NONEconstant 
public static const NARRATIVE_TYPE_NONE:int = -1

Defines the value of the narrativeType property. Use this value to cancel narrative generation.

RESULT_INVALID_LOCATIONconstant 
public static const RESULT_INVALID_LOCATION:int = 1

Defines the value of the resultCode property of the RouteEvent object.

RESULT_NO_DATASET_FOUNDconstant 
public static const RESULT_NO_DATASET_FOUND:int = 3

Defines the value of the resultCode property of the RouteEvent object.

RESULT_NOT_SPECIFIEDconstant 
public static const RESULT_NOT_SPECIFIED:int = -1

Defines the value of the resultCode property of the RouteEvent object.

RESULT_ROUTE_FAILUREconstant 
public static const RESULT_ROUTE_FAILURE:int = 2

Defines the value of the resultCode property of the RouteEvent object.

RESULT_SUCCESSconstant 
public static const RESULT_SUCCESS:uint = 0

Defines the value of the resultCode property of the RouteEvent object.

ROUTE_TYPE_FASTESTconstant 
public static const ROUTE_TYPE_FASTEST:int = 0

Defines the value of the routeType property. Use this value to get the quickest drive time route.

ROUTE_TYPE_OPTIMIZEDconstant 
public static const ROUTE_TYPE_OPTIMIZED:int = 3

Defines the value of the routeType property. Use this value to get the route with the shortest drive time that includes all intermediate locations. The intermediate locations are reordered to show the optimal order to visit each location.

ROUTE_TYPE_PEDESTRIANconstant 
public static const ROUTE_TYPE_PEDESTRIAN:int = 2

Defines the value of the routeType property. Use this value to get the walking route (avoids limited access roads, ignores turn restrictions).

ROUTE_TYPE_SELECT_DATASET_ONLYconstant 
public static const ROUTE_TYPE_SELECT_DATASET_ONLY:int = 4

Defines the value of the routeType property. Does not compute a route, but performs route data selection. Provides a method of querying which data coverage will be used.

ROUTE_TYPE_SHORTESTconstant 
public static const ROUTE_TYPE_SHORTEST:int = 1

Defines the value of the routeType property. Us this value to get the shortest driving distance route.