Class VectorTileClickInfo

java.lang.Object
com.massifmaps.ui.VectorTileClickInfo

public class VectorTileClickInfo extends Object
A container class that provides information about a click performed on vector tile feature.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if this object is equal to the specified object.
    Returns the click info.
    Returns the click position.
    int
    Returns the click type.
    Returns the clicked feature.
    Returns the position on the clicked feature, that is close to the click position.
    For points it will always be the center position, for lines it will be the closest point
    on the line, for billboards it will be the anchor point and for polygons it's equal to
    getClickPos().
    long
    Returns the id of the clicked feature.
    Returns the name of the layer of the clicked feature.
    Note that this is the layer name in the tile, not the name of style layer.
    Returns the position of the clicked feature.

    For a MultiPoint this is the point that was clicked, not the centre of the whole set -
    which getFeatureClickPos deliberately does not cover, and which a caller otherwise has
    to reconstruct from getFeaturePosIndex plus a downcast.
    int
    In case of MultiPoint PointGeometry this will return the index of the clicked position
    Returns the layer of the vector tile.
    Returns the tile id of the clicked feature.
    int
    Returns the hash value of this object.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • getClickType

      public int getClickType()
      Returns the click type.
      Returns:
      The type of the click performed.
    • getClickInfo

      public ClickInfo getClickInfo()
      Returns the click info.
      Returns:
      The attributes of the click.
    • getClickPos

      public MapPos getClickPos()
      Returns the click position.
      Returns:
      The click position in the coordinate system of the data source.
    • getFeatureClickPos

      public MapPos getFeatureClickPos()
      Returns the position on the clicked feature, that is close to the click position.
      For points it will always be the center position, for lines it will be the closest point
      on the line, for billboards it will be the anchor point and for polygons it's equal to
      getClickPos().
      Returns:
      The feature click position in the coordinate system of the data source.
    • getFeaturePos

      public MapPos getFeaturePos()
      Returns the position of the clicked feature.

      For a MultiPoint this is the point that was clicked, not the centre of the whole set -
      which getFeatureClickPos deliberately does not cover, and which a caller otherwise has
      to reconstruct from getFeaturePosIndex plus a downcast.
      Returns:
      The feature position, in the coordinate system of the data source.
    • getMapTile

      public MapTile getMapTile()
      Returns the tile id of the clicked feature.
      Returns:
      The tile id of the clicked feature.
    • getFeatureId

      public long getFeatureId()
      Returns the id of the clicked feature.
      Returns:
      The id of the clicked feature.
    • getFeaturePosIndex

      public int getFeaturePosIndex()
      In case of MultiPoint PointGeometry this will return the index of the clicked position
      Returns:
      The index
    • getFeature

      public VectorTileFeature getFeature()
      Returns the clicked feature.
      Returns:
      The feature on which the click was performed.
    • getFeatureLayerName

      public String getFeatureLayerName()
      Returns the name of the layer of the clicked feature.
      Note that this is the layer name in the tile, not the name of style layer.
      Returns:
      The name of the layer of the clicked feature.
    • getLayer

      public Layer getLayer()
      Returns the layer of the vector tile.
      Returns:
      The layer of the vector tile.