Package globus.glmap

Class GLMapDrawable

Direct Known Subclasses:
GLMapBalloon, GLMapImage, GLMapLabel, GLMapVectorLayer

public abstract class GLMapDrawable extends GLMapDrawObject
GLMapDrawable is a bridge class that displays single object on map. This can be image, text or vector object.
  • Method Details

    • hitTest

      public boolean hitTest(@NonNull GLMapViewRenderer mapView, float screenX, float screenY, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom)
      Tests if point is inside of image
      mapView - mapView where image is displayed
      screenX - x coordinate of point to check
      screenY - y coordinate of point to check
      paddingLeft - left padding
      paddingRight - right padding
      paddingTop - top padding
      paddingBottom - bottom padding
      `true` if point is inside image
    • setPosition

      public void setPosition(@NonNull MapPoint position)
      Sets position of image on map. image.setPosition(GLMapView.convertGeoToInternal(new MapPoint(-74.0, 40.7))); //New York
      position - position coordinates in internal format of GLMapView
      See Also:
    • getPosition

      public MapPoint getPosition()
      Position of image
      position of image in internal coordinates of GLMapView
    • setScale

      public void setScale(double scale)
      Scale of vector object
      scale - new scale for vector object
    • getScale

      public double getScale()
      Scale of vector object
      scale of vector object
    • setAngle

      public void setAngle(float angle)
      Sets angle of image. image.setAngle(45);
      angle - angle to set
    • getAngle

      public float getAngle()
      Angle of image
      angle of image in degrees.
    • getWidth

      public int getWidth()
      Loaded image width.
      width of image in pixels.
    • getHeight

      public int getHeight()
      Loaded image height.
      height of image in pixels.
    • setRotatesWithMap

      public void setRotatesWithMap(boolean rotate)
      Sets whether image rotates with the map.
      rotate - true to rotate with map
    • isRotatesWithMap

      public boolean isRotatesWithMap()
      Whether image rotates with the map
      true if image rotates with the map
    • setOffset

      public void setOffset(int offsetX, int offsetY)
      Image offset from position. When offset is (0,0), bottom left corner of image is displayed at position image.setOffset(bmp.getWidth()/2, bmp.getHeight()/2); // image center displayed at position
      offsetX - x offset of image
      offsetY - y offset of image
      See Also:
    • setTransformMode

      public void setTransformMode(int transformMode)
      If drawable contains vector object and you will use position and scale to transform vector object, then set this to TransformMode.Custom.
      transformMode - mode of transforming position and scale
    • getOffset

      @NonNull public MapPoint getOffset()
      Offset of image
      offset of image in pixels