Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<Templates> | Returns one or more suggested default popupTemplates for a given layer's FeatureReductionCluster configuration. more details | clusters |
Method Details
-
Returns one or more suggested default popupTemplates for a given layer's FeatureReductionCluster configuration. The cluster popup will contain information describing features in the cluster, including the number of features in the cluster and summary statistics based on fields and expressions used in the layer's renderer.
ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
SpecificationThe point layer that is or will be clustered.
renderer RendereroptionalSpecify the renderer to be used on the layer when
featureReduction
is enabled if it will be different than the renderer already set on the layer.ReturnsType Description Promise<Templates> Returns an object containing suggested primary and secondary PopupTemplates for the input layer's featureReduction
property.Example// Sets a suggested popupTemplate on the layer's clusters clusterPopupTemplateCreator.getTemplates({ layer: featureLayer, renderer: featureLayer.renderer }).then(function(popupTemplateResponse){ const featureReduction = featureLayer.featureReduction.clone(); featureReduction.popupTemplate = popupTemplateResponse.primaryTemplate.value; featureLayer.featureReduction = featureReduction; }).catch(function(error){ console.error(error); });