當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS FeatureReductionCluster.clusterRadius用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

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

ESM: import FeatureReductionCluster from "@arcgis/core/layers/support/FeatureReductionCluster";

類: esri/layers/support/FeatureReductionCluster

繼承: FeatureReductionCluster > Accessor

自從:用於 JavaScript 4.14 的 ArcGIS API

用法說明

FeatureReductionCluster.clusterRadius函數(或屬性)的定義如下:

clusterRadius Number autocast

來自 String|Number

定義每個區域的點(或像素,如果指定)半徑,其中多個點將被分組並可視化為單個簇。如果修改 clusterMaxSize,通常應考慮調整clusterRadius

例如,如果您希望集群圖標不重疊,那麽 clusterRadius 應該比 clusterMaxSize 大很多。

默認值:60

例子:

// enables clustering on the layer with a
// clusterRadius of 40pt
layer.featureReduction = {
  type: "cluster",
  clusterRadius: 40,
  clusterMaxSize: 24
};
// enables clustering on the layer with a
// clusterRadius of 120px
layer.featureReduction = {
  type: "cluster",
  clusterRadius: "120px",
  clusterMaxSize: "80px"
};

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 FeatureReductionCluster.clusterRadius。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。