Class MapImageOverlay

    • Constructor Summary

      Constructors 
      Constructor Description
      MapImageOverlay​(Point2D viewCoordinates, MapImage image)
      Creates an instance of an overlay at given view coordinates, represented by specified image.
      MapImageOverlay​(Point2D viewCoordinates, MapImage image, Anchor2D anchor)
      Creates an instance of an overlay at given view coordinates, represented by specified image, with anchor point specifying how the image is positioned relative to the overlay's view coordinates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Anchor2D getAnchor()
      Gets current anchor point for the overlay image.
      int getDrawOrder()
      Gets draw order of this MapImageOverlay.
      MapImage getImage()
      Gets currently used map image.
      Point2D getViewCoordinates()
      Gets the view point in pixels on the map viewport where the overlay is drawn.
      void setAnchor​(Anchor2D value)
      Sets anchor point of the overlay image which specifies the position offset relative to the overlay's view coordinates.
      void setDrawOrder​(int value)
      Sets draw order of this MapImageOverlay.
      void setImage​(MapImage value)
      Sets the image overlayed on map.
      void setViewCoordinates​(Point2D value)
      Sets the view point in pixels on the map viewport where the overlay is drawn.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapImageOverlay

        public MapImageOverlay​(@NonNull
                               Point2D viewCoordinates,
                               @NonNull
                               MapImage image)

        Creates an instance of an overlay at given view coordinates, represented by specified image.

        Parameters:
        viewCoordinates -

        The overlay's view coordinates in pixels.

        image -

        The image to draw on the map.

      • MapImageOverlay

        public MapImageOverlay​(@NonNull
                               Point2D viewCoordinates,
                               @NonNull
                               MapImage image,
                               @NonNull
                               Anchor2D anchor)

        Creates an instance of an overlay at given view coordinates, represented by specified image, with anchor point specifying how the image is positioned relative to the overlay's view coordinates.

        The anchor is a way of specifying position offset relative to image's dimensions on the view. For example, (0, 0) places the top-left corner of the image at the overlay's view coordinates. (1, 1) would place the bottom-right corner of the image at the overlay's view coordinates. (0.5, 0.5) which is the default value would center the image at the overlay's view coordinates.

        Values outside the 0..1 range are also allowed, for example (0.5, 2) would display the image centered horizontally with its bottom edge above the overlay's view coordinates at the distance in pixels that is equal to the height of the image.

        Parameters:
        viewCoordinates -

        The overlay's view coordinates in pixels.

        image -

        The image to draw on the map.

        anchor -

        The anchor point for the overlay image which specifies the position offset relative to the overlay's view coordinates.

    • Method Detail

      • getViewCoordinates

        @NonNull
        public Point2D getViewCoordinates()

        Gets the view point in pixels on the map viewport where the overlay is drawn.

        Returns:

        The view point in pixels on the map viewport where the map overlay is drawn.

      • setViewCoordinates

        public void setViewCoordinates​(@NonNull
                                       Point2D value)

        Sets the view point in pixels on the map viewport where the overlay is drawn.

        Parameters:
        value -

        The view point in pixels on the map viewport where the map overlay is drawn.

      • getDrawOrder

        public int getDrawOrder()

        Gets draw order of this MapImageOverlay. The default value is 0.

        Returns:

        Draw order of this MapImageOverlay.

      • setDrawOrder

        public void setDrawOrder​(int value)

        Sets draw order of this MapImageOverlay.

        Overlays with higher draw order value are drawn on top of overlays with lower draw order.

        In case multiple overlays have the same draw order value then the order in which they were added to the scene matters. Last added overlay is drawn on top.

        Allowed range is [0, 1023]. Values outside this range will be clamped.

        Parameters:
        value -

        Draw order of this MapImageOverlay.

      • getImage

        @NonNull
        public MapImage getImage()

        Gets currently used map image.

        Returns:

        Image overlayed on the map.

      • setImage

        public void setImage​(@NonNull
                             MapImage value)

        Sets the image overlayed on map.

        Parameters:
        value -

        Image overlayed on the map.

      • getAnchor

        @NonNull
        public Anchor2D getAnchor()

        Gets current anchor point for the overlay image.

        Returns:

        The anchor point for the overlay image which specifies the position offset relative to the overlay's view coordinates.

      • setAnchor

        public void setAnchor​(@NonNull
                              Anchor2D value)

        Sets anchor point of the overlay image which specifies the position offset relative to the overlay's view coordinates.

        For example, (0, 0) places the top-left corner of the image at the overlay's view coordinates. (1, 1) would place the bottom-right corner of the image at the overlay's view coordinates. (0.5, 0.5) which is the default value would center the image at the overlay's view coordinates.

        Values outside the 0..1 range are also allowed, for example (0.5, 2) would display the image centered horizontally with its bottom edge above the overlay's view coordinates at the distance in pixels that is equal to the height of the image.

        Parameters:
        value -

        The anchor point for the overlay image which specifies the position offset relative to the overlay's view coordinates.