Package globus.glmap

Class GLMapScaleRuler


public class GLMapScaleRuler extends GLMapDrawObject
Draws a scale ruler overlay on the map.
  • Constructor Details

    • GLMapScaleRuler

      public GLMapScaleRuler(int drawOrder)
      Default constructor
      Parameters:
      drawOrder - draw order of object
  • Method Details

    • setPlacement

      public void setPlacement(int placement, int paddingX, int paddingY, double maxWidth)
      Set style of scale ruler.
      
       scaleRuler.setPlacement(GLMapViewRenderer.GLMapPlacement.BottomCenter, 10, 10, 200);
       
      Parameters:
      placement - placement on screen
      paddingX - horizontal padding in screen points (dp)
      paddingY - vertical padding in screen points (dp)
      maxWidth - maximum ruler width in screen points (dp)
    • setBottomText

      public void setBottomText(@Nullable String text)
      Sets text that will be displayed under scale ruler.
      Parameters:
      text - text to display
    • hitTestBottomText

      public boolean hitTestBottomText(float screenX, float screenY)
      Tests whether a screen point is inside the bottom text bounding box.
      Parameters:
      screenX - x coordinate in screen pixels
      screenY - y coordinate in screen pixels
      Returns:
      true if the point is inside the bottom text bounding box
    • setBottomTextStyle

      public void setBottomTextStyle(GLMapVectorStyle style)
      Sets the style of the text at the bottom of the ruler. The default is "{font-size:11; text-color:black; fill-color:#000000B2; font-stroke-width:2pt; font-stroke-color:#FFFFFF99;}".
      Parameters:
      style - style of the text