Skip To Content ArcGIS for Developers Sign In Dashboard

ClosestFacilityTask QML Type

A task to find a closest facility route between facilities and incidents. More...

Import Statement: import Esri.ArcGISRuntime 100.6
Since: Esri.ArcGISRuntime 100.1
Inherits:

Object

Properties

Signals

Methods

Detailed Description

The closest facility task class uses a transportation network to measure the cost of traveling between incidents and facilities and determines which are nearest to one other in terms of cost. When finding closest facilities, you can specify how many to find and whether the direction of travel is toward or away from them. You can also provide impedance attributes to be considered when calculating route cost. ClosestFacilityTask is executed asynchronously. A successful execution returns a ClosestFacilityResult instance with details about the closest facility route.

The closest facility task works in an online connected scenario by using a transportation network that is published to ArcGIS Server as an online Network Analyst closest facility service. Esri also provides ready-to-use services, such as the Directions and Routing Services, which requires authentication with an ArcGIS organizational account. In connected scenarios, provide a URL to the REST endpoint of the service, along with any necessary credentials.

An example of an online ClosestFacilityTask:

ClosestFacilityTask {
    id: onlineClosestFacilityTask
    url: "http://www.myServer.com/arcgis/rest/services/routing/NAServer/Closest%20Facility"
}

This QML type supports the following default properties. A default property is the property to which a value is assigned if an object of a specific QML type is declared within another object's declaration without declaring it as a value for a particular property.

See also Cancelable, Loadable, RemoteResource, and Closest Facility REST API documentation.

Property Documentation

closestFacilityTaskInfo : ClosestFacilityTaskInfo

Returns ClosestFacilityTaskInfo about the ClosestFacilityTask (read-only).

Wait until the ClosestFacilityTask is loaded before attempting to obtain the ClosestFacilityTaskInfo.


createDefaultParametersResult : ClosestFacilityParameters

Results from createDefaultParameters(), giving access to the default ClosestFacilityParameters (read-only).

Obtain this property after the createDefaultParametersStatusChanged signal emits, and the createDefaultParametersStatus is complete.


createDefaultParametersStatus : Enums.TaskStatus

Returns the current status of the createDefaultParameters method (read-only).

Wait until the createDefaultParametersStatus is Enums.TaskStatusComplete before obtaining the createDefaultParametersResult.

See also Enums.TaskStatus.


[default] credential : Credential

The Credential for authenticating against a secured service.

Only applicable if using an online service that is secured.


error : Error

Returns the error object (read-only).

See also Loadable and Error.


loadError : Error

Returns the load error (read-only).

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable.


loadStatus : Enums.LoadStatus

Returns the load status (read-only).

See also Loadable and Enums.LoadStatus.


networkName : string

The network dataset's name in the mobile geodatabase.

Note: This property is only used for offline routing.

This QML property was introduced in Esri.ArcGISRuntime 100.2.


[default] requestConfiguration : RequestConfiguration

The configuration parameters used for network requests sent by this task.


solveClosestFacilityResult : ClosestFacilityResult

Results from solveClosestFacility, giving access to the output ClosestFacilityResult (read-only).

Obtain this property after the solveClosestFacilityStatusChanged signal emits, and the solveClosestFacilityStatus is complete.


solveClosestFacilityStatus : Enums.TaskStatus

Returns the current status of the solveClosestFacility method (read-only).

Wait until the solveClosestFacilityStatus is Enums.TaskStatusComplete before obtaining the solveClosestFacilityResult.

See also Enums.TaskStatus.


transportationNetworkDataset : TransportationNetworkDataset

The transportation network dataser in the mobile geodatabase.

Note: This property is only used for offline routing.

This QML property was introduced in Esri.ArcGISRuntime 100.2.


url : url

The URL to the REST endpoint of the service or a local path to a mobile geodatabase.


Signal Documentation

closestFacilityTaskInfoChanged()

Emitted when the closestFacilityTaskInfo property of this ClosestFacilityTask changes.


createDefaultParametersStatusChanged()

Emitted when the createDefaultParametersStatus property of this ClosestFacilityTask changes.


credentialChanged()

Emitted when the credential property of this ClosestFacilityTask changes.


loadErrorChanged()

Emitted when the loadError property of this ClosestFacilityTask changes.

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable and Object.


loadStatusChanged()

Emitted when the loadStatus property of this ClosestFacilityTask changes.

See also Loadable.


networkNameChanged()

Emitted when the networkName property of this ClosestFacilityTask changes.

This QML signal was introduced in Esri.ArcGISRuntime 100.2.


requestConfigurationChanged()

Emitted when the requestConfiguration property changes.


solveClosestFacilityStatusChanged()

Emitted when the solveClosestFacilityStatus property of this ClosestFacilityTask changes.


transportationNetworkDatasetChanged()

Emitted when the transportationNetworkDataset property changes.

This QML signal was introduced in Esri.ArcGISRuntime 100.2.


urlChanged()

Emitted when the url property of this ClosestFacilityTask changes.


Method Documentation

void cancelLoad()

See also Loadable.


bool cancelTask(string taskId)

See also Cancelable.


void createDefaultParameters()

Creates default closest facility parameters from the service.

The createDefaultParametersStatusChanged signal will emit once the operation is complete, giving access to the createDefaultParametersResult.


void load()

See also Loadable.


void retryLoad()

See also Loadable.


string solveClosestFacility(ClosestFacilityParameters closestFacilityParameters)

Solves a closest facility with the given closestFacilityParameters.

The solveClosestFacilityStatusChanged signal will emit when the operation is complete, giving access to the solveClosestFacilityResult.



Feedback on this topic?