Class FixedPixelCircle


  • public class FixedPixelCircle
    extends Circle
    A Circle class that is always drawn with the same size in pixels.
    • Constructor Detail

      • FixedPixelCircle

        public FixedPixelCircle​(org.mapsforge.core.model.LatLong latLong,
                                float radius,
                                org.mapsforge.core.graphics.Paint paintFill,
                                org.mapsforge.core.graphics.Paint paintStroke)
        Parameters:
        latLong - the initial center point of this circle (may be null).
        radius - the initial non-negative radius of this circle in pixels.
        paintFill - the initial Paint used to fill this circle (may be null).
        paintStroke - the initial Paint used to stroke this circle (may be null).
        Throws:
        java.lang.IllegalArgumentException - if the given radius is negative or Float.NaN.
      • FixedPixelCircle

        public FixedPixelCircle​(org.mapsforge.core.model.LatLong latLong,
                                float radius,
                                org.mapsforge.core.graphics.Paint paintFill,
                                org.mapsforge.core.graphics.Paint paintStroke,
                                boolean keepAligned)
        Parameters:
        latLong - the initial center point of this circle (may be null).
        radius - the initial non-negative radius of this circle in pixels.
        paintFill - the initial Paint used to fill this circle (may be null).
        paintStroke - the initial Paint used to stroke this circle (may be null).
        keepAligned - if set to true it will keep the bitmap aligned with the map, to avoid a moving effect of a bitmap shader.
        Throws:
        java.lang.IllegalArgumentException - if the given radius is negative or Float.NaN.
    • Method Detail

      • contains

        public boolean contains​(org.mapsforge.core.model.Point center,
                                org.mapsforge.core.model.Point point)
      • getRadiusInPixels

        protected int getRadiusInPixels​(double latitude,
                                        byte zoomLevel)
        Overrides:
        getRadiusInPixels in class Circle
        Returns:
        the non-negative radius of this circle in pixels.
      • isScaleRadius

        public boolean isScaleRadius()
        Returns:
        true if it scales the radius with the combined device/user scale factor, false otherwise.
      • setScaleRadius

        public void setScaleRadius​(boolean scaleRadius)
        Parameters:
        scaleRadius - if set to true it will scale the radius with the combined device/user scale factor.