-
apiKey
String
- 自从:ArcGIS 适用于 JavaScript 4.21 的 API
用于访问资源或服务的授权字符串。 API keys 在 ArcGIS Developer dashboard 中生成和管理。 API key 明确绑定到ArcGIS 帐户;它还用于监视服务使用情况。在特定类上设置细粒度 API key 会覆盖 global API key 。
例子:
// Compute the service area for a 2km walking distance. const url = "https://route-api.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAServer/ServiceArea_World"; const apiKey = "abcdefghijklmnopqrstuvwxyz"; const spatialReference = SpatialReference.WebMercator; const start = new Graphic({ geometry: { type: "point", x: -13039204.060165292, y: 4031816.239573444, spatialReference }, symbol: { type: "simple-marker", color: "white", size: 8 } }); const networkDescription = await fetchServiceDescription(url, apiKey); const travelMode = networkDescription.supportedTravelModes.find( (travelMode) => travelMode.name === "Walking Distance" ); const serviceAreaParameters = new ServiceAreaParameters({ apiKey, facilities: new FeatureSet({ features: [start] }), defaultBreaks: [2.5], travelMode, travelDirection: "to-facility", outSpatialReference: spatialReference, trimOuterPolygon: true }); const results = await solve(url, serviceAreaParameters);
基本信息
以下是所在类或对象的基本信息。
AMD:
require(["esri/rest/support/ServiceAreaParameters"], (ServiceAreaParameters) => { /* code goes here */ });
ESM:
import ServiceAreaParameters from "@arcgis/core/rest/support/ServiceAreaParameters";
类:
esri/rest/support/ServiceAreaParameters
继承: ServiceAreaParameters > Accessor
自从:用于 JavaScript 4.20 的 ArcGIS API
用法说明
ServiceAreaParameters.apiKey
函数(或属性)的定义如下:
相关用法
- JavaScript ArcGIS ServerInfo.hasServer用法及代码示例
- JavaScript Set add()用法及代码示例
- JavaScript ArcGIS SegmentDrawAction draw-complete事件用法及代码示例
- JavaScript Set.add()用法及代码示例
- JavaScript ArcGIS SegmentDrawAction cursor-update事件用法及代码示例
- JavaScript Search.classes用法及代码示例
- JavaScript Search.container用法及代码示例
- JavaScript Search用法及代码示例
- JavaScript ArcGIS SegmentDrawAction.on用法及代码示例
- JavaScript Set delete()用法及代码示例
- JavaScript Set forEach()用法及代码示例
- JavaScript Search search-clear事件用法及代码示例
- JavaScript Set.clear()用法及代码示例
- JavaScript Search.when用法及代码示例
- JavaScript ArcGIS SegmentDrawAction.undo用法及代码示例
- JavaScript Set clear()用法及代码示例
- JavaScript Set.entries()用法及代码示例
- JavaScript Set values()用法及代码示例
- JavaScript Set.delete()用法及代码示例
- JavaScript ArcGIS SegmentDrawAction vertex-add事件用法及代码示例
- JavaScript Search select-result事件用法及代码示例
- JavaScript ArcGIS SegmentDrawAction.mode用法及代码示例
- JavaScript Search.includeDefaultSources用法及代码示例
- JavaScript Search.on用法及代码示例
- JavaScript Search suggest-start事件用法及代码示例
注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 ServiceAreaParameters.apiKey。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。