ClosestFacilityTask QML Type

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

Import Statement: import Esri.ArcGISRuntime 100.15
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: "https://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 ApiKeyResource, Cancelable, Loadable, RemoteResource, and Closest Facility REST API documentation.

Property Documentation

apiKey : string

Returns the API key.

This property was introduced in Esri.ArcGISRuntime 100.10.

See also ApiKeyResource.


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 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 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

apiKeyChanged()

Emitted when the apiKey property changes.

Note: The corresponding handler is onApiKeyChanged.

This signal was introduced in Esri.ArcGISRuntime 100.10.

See also ApiKeyResource.


closestFacilityTaskInfoChanged()

Emitted when the closestFacilityTaskInfo property of this ClosestFacilityTask changes.

Note: The corresponding handler is onClosestFacilityTaskInfoChanged.


createDefaultParametersStatusChanged()

Emitted when the createDefaultParametersStatus property of this ClosestFacilityTask changes.

Note: The corresponding handler is onCreateDefaultParametersStatusChanged.


credentialChanged()

Emitted when the credential property of this ClosestFacilityTask changes.

Note: The corresponding handler is onCredentialChanged.


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.

Note: The corresponding handler is onLoadErrorChanged.

See also Loadable and Object.


loadStatusChanged()

Emitted when the loadStatus property of this ClosestFacilityTask changes.

Note: The corresponding handler is onLoadStatusChanged.

See also Loadable.


networkNameChanged()

Emitted when the networkName property of this ClosestFacilityTask changes.

Note: The corresponding handler is onNetworkNameChanged.

This signal was introduced in Esri.ArcGISRuntime 100.2.


requestConfigurationChanged()

Emitted when the requestConfiguration property changes.

Note: The corresponding handler is onRequestConfigurationChanged.


solveClosestFacilityStatusChanged()

Emitted when the solveClosestFacilityStatus property of this ClosestFacilityTask changes.

Note: The corresponding handler is onSolveClosestFacilityStatusChanged.


transportationNetworkDatasetChanged()

Emitted when the transportationNetworkDataset property changes.

Note: The corresponding handler is onTransportationNetworkDatasetChanged.

This signal was introduced in Esri.ArcGISRuntime 100.2.


urlChanged()

Emitted when the url property of this ClosestFacilityTask changes.

Note: The corresponding handler is onUrlChanged.


Method Documentation

void cancelLoad()

See also Loadable.


bool cancelTask(string taskId)

Cancel the task with the ID taskId.

Returns false if the task cannot be canceled or there is no task with the specified id 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.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.