Class PointBasedFeature

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MarkerFeature

public abstract class PointBasedFeature extends Feature
Abstract base class for features that are represented by a single point and a single coordinate.

Technically this is a Feature that uses a Point geometry for representation.

See Also:
  • Constructor Details

    • PointBasedFeature

      protected PointBasedFeature()
    • PointBasedFeature

      protected PointBasedFeature(Coordinate coordinates)
  • Method Details

    • getCoordinates

      public Coordinate getCoordinates()
      The coordinates that define where the feature is located on the map. Coordinates are returned in the map's user projection, which by default is EPSG:4326, also referred to as GPS coordinates. If the user projection has been changed using Map.setUserProjection(String), then coordinates must be specified in that projection instead.
      Returns:
      the current coordinates
    • setCoordinates

      public void setCoordinates(Coordinate coordinates)
      Sets the coordinates that define where the feature is located on the map. Coordinates must be specified in the map's user projection, which by default is EPSG:4326, also referred to as GPS coordinates. If the user projection has been changed using Map.setUserProjection(String), then coordinates must be specified in that projection instead.
      Parameters:
      coordinates - the new coordinates
    • getGeometry

      public Point getGeometry()
      The Point geometry representing this feature.
      Overrides:
      getGeometry in class Feature
      Returns:
      the current point geometry
    • setGeometry

      public void setGeometry(SimpleGeometry geometry)
      Sets the geometry representing this feature. This must be a Point geometry.
      Overrides:
      setGeometry in class Feature
      Parameters:
      geometry - the new geometry, not null
      Throws:
      IllegalArgumentException - if the geometry is not an instance of Point