当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS ClosestFacilityParameters.facilities用法及代码示例


基本信息

以下是所在类或对象的基本信息。

AMD: require(["esri/rest/support/ClosestFacilityParameters"], (ClosestFacilityParameters) => { /* code goes here */ });

ESM: import ClosestFacilityParameters from "@arcgis/core/rest/support/ClosestFacilityParameters";

类: esri/rest/support/ClosestFacilityParameters

继承: ClosestFacilityParameters > Accessor

自从:用于 JavaScript 4.20 的 ArcGIS API

用法说明

ClosestFacilityParameters.facilities函数(或属性)的定义如下:


在分析期间作为网络位置加载的设施集。

例子:

require([
  "esri/layers/GraphicsLayer", "esri/rest/support/FeatureSet", "esri/rest/support/NetworkUrl", ...
], function(GraphicsLayer, FeatureSet, NetworkUrl, ... ) {
  const facilitiesGraphicsLayer = new GraphicsLayer();

  // Specify facilities using a FeatureSet
  const facilities = new FeatureSet({
    features: facilitiesGraphicsLayer.graphics.toArray()
  });

  params.facilities = new NetworkUrl({
    url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer/" +
         "14/query?where=1%3D1&returnGeometry=true&outFields=*&f=json"
  });
});

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 ClosestFacilityParameters.facilities。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。