@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
38 lines (37 loc) • 2.73 kB
TypeScript
/**
* Helps you find closest facilities around any location (incident) on a network.
*
* When finding closest facilities, you can specify various [parameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ClosestFacilityParameters/)
* including how many to facilities to find and whether the direction of
* travel is toward or away from them. Once you've found the closest facilities, you can display
* the best route to or from them, return the travel cost for each route, and display directions
* to each facility using the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ClosestFacilitySolveResult/).
*
* You can also specify a cutoff cost beyond which ArcGIS Network Analyst should not search for a
* facility. For instance, you can set up a closest facility problem to search for hospitals
* within a 15-minute drive time of the site of an accident. Any hospitals that take longer than
* 15 minutes to reach will not be included in the results.
*
* Parameters must be defined using [ClosestFacilityParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ClosestFacilityParameters/)
* and input to the [solve()](https://developers.arcgis.com/javascript/latest/references/core/rest/closestFacility/#solve) method.
*
* @since 4.19
* @see [ClosestFacilityParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ClosestFacilityParameters/)
* @see [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ClosestFacilitySolveResult/)
*/
import type ClosestFacilityParameters from "./support/ClosestFacilityParameters.js";
import type ClosestFacilitySolveResult from "./support/ClosestFacilitySolveResult.js";
import type { RequestOptions } from "../request/types.js";
/**
* Solves the closest facility.
*
* @param url - URL to the ArcGIS Server REST resource that represents a network analysis service.
* @param params - Defines the parameters of the closest facility analysis.
* @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/references/core/request/#request) to be used for the data request.
* @returns When resolved, returns an instance of [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ClosestFacilitySolveResult/).
* @example
* solve(url, params).then(function(solveResult){
* // Do something with the solveResults here
* });
*/
export function solve(url: string, params: ClosestFacilityParameters, requestOptions: RequestOptions | null | undefined): Promise<ClosestFacilitySolveResult>;