-
routeServiceUrl
String
Route 服務的 REST 端點的 URL。
默認情況下,DirectionsViewModel 將使用全局路由服務(參見config.routeServiceUrl)。
如果連接到Portal,您可以使用在門戶的helper services 上公布的路由服務,如下所示。
例子:
// Create Directions using the route service advertised on the portal const portal = Portal.getDefault(); const directions = new Directions({ routeServiceUrl: portal.helperServices.route.url, view: view });
// Create Directions using a defined route service with an apiKey const portal = Portal.getDefault(); const directions = new Directions({ apiKey: "YOUR_API_KEY", routeServiceUrl: "https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World", view: view });
基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/widgets/Directions"], (Directions) => { /* code goes here */ });
ESM:
import Directions from "@arcgis/core/widgets/Directions";
類:
esri/widgets/Directions
繼承: Directions > Widget > Accessor
自從:用於 JavaScript 4.6 的 ArcGIS API
用法說明
Directions.routeServiceUrl
函數(或屬性)的定義如下:
相關用法
- JavaScript ArcGIS Directions.visible用法及代碼示例
- JavaScript ArcGIS Directions.when用法及代碼示例
- JavaScript ArcGIS Directions.apiKey用法及代碼示例
- JavaScript ArcGIS Directions.container用法及代碼示例
- JavaScript ArcGIS Directions.headingLevel用法及代碼示例
- JavaScript ArcGIS Directions.goToOverride用法及代碼示例
- JavaScript ArcGIS Directions.classes用法及代碼示例
- JavaScript ArcGIS Directions.on用法及代碼示例
- JavaScript ArcGIS Directions用法及代碼示例
- JavaScript ArcGIS DirectionPoint用法及代碼示例
- JavaScript ArcGIS DirectionLine用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurementAnalysisView3D用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurement3D.when用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurement3D.on用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurementAnalysis用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurement3D.classes用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurement3D.analysis用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurement3D.container用法及代碼示例
- JavaScript ArcGIS DirectLineMeasurement3D用法及代碼示例
- JavaScript ArcGIS DistanceMeasurement2D.unitOptions用法及代碼示例
- JavaScript ArcGIS DistanceMeasurement2D.unit用法及代碼示例
- JavaScript ArcGIS DimensionalDefinition用法及代碼示例
- JavaScript ArcGIS DistanceMeasurement2D.view用法及代碼示例
- JavaScript ArcGIS DistanceMeasurement2D用法及代碼示例
- JavaScript ArcGIS DictionaryRenderer.visualVariables用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Directions.routeServiceUrl。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。