Class AggregateGeoElement

java.lang.Object
com.esri.arcgisruntime.mapping.reduction.AggregateGeoElement
All Implemented Interfaces:
GeoElement

public final class AggregateGeoElement extends Object implements GeoElement
A GeoElement that represents aggregated geoelement on the map, for example a cluster of features or graphics.

Based on aggregation properties defined in AggregationFeatureReduction, geoelements are aggregated dynamically as the scale of the map changes. The attributes are the summary statistics defined at the time of configuring aggregation on a FeatureLayer. The geometry is a GeometryType.POINT representing the centroid of the aggregated geoelement. By default, AggregateGeoElement has a cluster_count attribute. Aggregated geoelements only have access to the fields listed in AggregationFeatureReduction.getAggregateFields(). The fields from the feature layer are not accessible for use in popups, labels, or renderers for aggregated geoelements.

You can select or unselect aggregate geoelements using the selectedProperty() property. Call geoElementsAsync() to get the collection of geoelements represented by the aggregate geoelement.

Since:
200.2.0
See Also:
  • Property Details

    • selected

      public BooleanProperty selectedProperty
      True if the aggregate geoelement is selected, false otherwise.

      Selecting an AggregateGeoElement adds a temporary visual selection halo around the aggregate geoelement. Selected aggregate geoelements are rendered according to the GeoView.selectionPropertiesProperty().

      As a user navigates the map, aggregate geoelements update dynamically depending on the map's scale and extent. When aggregate geoelements are re-created, new aggregate geoelements are drawn. This clears selection halos of any previously referenced AggregateGeoElement. However, properties of the previous referenced aggregate geoelements, such as their geometry, attributes, and associated underlying geoelements can still be accessed.

      Note that the selection halo that highlights an aggregate geoelement is transient. In addition to the map's scale and extent changes, changes to underlying properties of AggregationFeatureReduction also result in aggregate geoelements being re-created and re-drawn. When this happens, the existing selection halos on aggregate geoelements are cleared.

      Since:
      200.4.0
      See Also:
  • Method Details

    • selectedProperty

      public BooleanProperty selectedProperty()
      True if the aggregate geoelement is selected, false otherwise.

      Selecting an AggregateGeoElement adds a temporary visual selection halo around the aggregate geoelement. Selected aggregate geoelements are rendered according to the GeoView.selectionPropertiesProperty().

      As a user navigates the map, aggregate geoelements update dynamically depending on the map's scale and extent. When aggregate geoelements are re-created, new aggregate geoelements are drawn. This clears selection halos of any previously referenced AggregateGeoElement. However, properties of the previous referenced aggregate geoelements, such as their geometry, attributes, and associated underlying geoelements can still be accessed.

      Note that the selection halo that highlights an aggregate geoelement is transient. In addition to the map's scale and extent changes, changes to underlying properties of AggregationFeatureReduction also result in aggregate geoelements being re-created and re-drawn. When this happens, the existing selection halos on aggregate geoelements are cleared.

      Returns:
      the selected property
      Since:
      200.4.0
      See Also:
    • isSelected

      public boolean isSelected()
      Gets the value of the selected property.
      Property description:
      True if the aggregate geoelement is selected, false otherwise.

      Selecting an AggregateGeoElement adds a temporary visual selection halo around the aggregate geoelement. Selected aggregate geoelements are rendered according to the GeoView.selectionPropertiesProperty().

      As a user navigates the map, aggregate geoelements update dynamically depending on the map's scale and extent. When aggregate geoelements are re-created, new aggregate geoelements are drawn. This clears selection halos of any previously referenced AggregateGeoElement. However, properties of the previous referenced aggregate geoelements, such as their geometry, attributes, and associated underlying geoelements can still be accessed.

      Note that the selection halo that highlights an aggregate geoelement is transient. In addition to the map's scale and extent changes, changes to underlying properties of AggregationFeatureReduction also result in aggregate geoelements being re-created and re-drawn. When this happens, the existing selection halos on aggregate geoelements are cleared.

      Returns:
      the value of the selected property
      Since:
      200.4.0
      See Also:
    • setSelected

      public void setSelected(boolean isSelected)
      Sets the value of the selected property.
      Property description:
      True if the aggregate geoelement is selected, false otherwise.

      Selecting an AggregateGeoElement adds a temporary visual selection halo around the aggregate geoelement. Selected aggregate geoelements are rendered according to the GeoView.selectionPropertiesProperty().

      As a user navigates the map, aggregate geoelements update dynamically depending on the map's scale and extent. When aggregate geoelements are re-created, new aggregate geoelements are drawn. This clears selection halos of any previously referenced AggregateGeoElement. However, properties of the previous referenced aggregate geoelements, such as their geometry, attributes, and associated underlying geoelements can still be accessed.

      Note that the selection halo that highlights an aggregate geoelement is transient. In addition to the map's scale and extent changes, changes to underlying properties of AggregationFeatureReduction also result in aggregate geoelements being re-created and re-drawn. When this happens, the existing selection halos on aggregate geoelements are cleared.

      Parameters:
      isSelected - the value for the selected property
      Since:
      200.4.0
      See Also:
    • geoElementsAsync

      public ListenableFuture<List<GeoElement>> geoElementsAsync()
      Gets the collection of geoelements represented by this aggregate geoelement.

      For an aggregate geoelement on a feature layer, this method returns a collection of features. For a graphics overlay, it returns a collection of graphics.

      As a user navigates the map, aggregate geoelements update dynamically depending on the map's scale and extent. When aggregate geoelements are re-created, new aggregate geoelements are drawn. References to AggregateGeoElement instances that are no longer drawn on the map retain their association to the geoelements they aggregated.

      Returns:
      a ListenableFuture that returns an ObservableList containing GeoElement types
      Since:
      200.4.0
    • getAttributes

      public Map<String,Object> getAttributes()
      Description copied from interface: GeoElement
      Gets the attributes of the GeoElement as a collection of name/value pairs.

      Attribute values are returned as Object instances, but the underlying value type is based on the Field.Type.

      Specified by:
      getAttributes in interface GeoElement
      Returns:
      the attributes of the GeoElement as a collection of name/value pairs
    • getGeometry

      public Geometry getGeometry()
      Description copied from interface: GeoElement
      Gets the geometry which defines the shape and location of the GeoElement.
      Specified by:
      getGeometry in interface GeoElement
      Returns:
      the geometry defines the shape and location of the GeoElement, or null if none
    • setGeometry

      public void setGeometry(Geometry geometry)
      Description copied from interface: GeoElement
      Sets the geometry defines the shape and location of the GeoElement.
      Specified by:
      setGeometry in interface GeoElement
      Parameters:
      geometry - the geometry defines the shape and location of the GeoElement
    • computeCalloutLocation

      public Point computeCalloutLocation(Point tapLocation, MapView mapView)
      Specified by:
      computeCalloutLocation in interface GeoElement
      Parameters:
      tapLocation - location used to compute the callout location, can be null
      mapView - if specified and if a marker symbol is displayed for this GeoElement, the leader offset of the marker symbol will be used in this computation; can be null
      Returns:
      the computed location to place the callout
      • if tapLocation is null, computed location will be based on geometry alone
      • if tapLocation is not-null and inside geometry, then the computed location is same as the tapLocation
      • if tapLocation is not-null and outside geometry, then the computed location is the nearest point on the geometry from the tapLocation