Package com.yandex.mapkit.map

Interface PolygonMapObject

All Superinterfaces:

MapObject

interface PolygonMapObject extends MapObject

A polygon displayed on the map.

Summary

Methods

Type and modifiers

Method and Description

Polygon

getGeometry()

void

setGeometry(@NonNull Polygon geometry)

int

getStrokeColor()
Sets the stroke color.

void

setStrokeColor(int strokeColor)

float

getStrokeWidth()
Sets the stroke width in units.

void

setStrokeWidth(float strokeWidth)

int

getFillColor()
Sets the fill color.

void

setFillColor(int fillColor)

boolean

isGeodesic()
The object geometry can be interpreted in two different ways:

  • If the object mode is 'geodesic', the object geometry is defined on a sphere.
  • Otherwise, the object geometry is defined in projected space.
Default: false.

void

setGeodesic(boolean geodesic)

void

setPattern(@NonNull AnimatedImageProvider animatedImage,
           float scale)

Sets pattern to fill polygon.

void

setPattern(@NonNull ImageProvider image,
           float scale)

Sets pattern to fill polygon.

void

resetPattern()
Removes pattern.

Methods

getGeometry

@NonNull
Polygon getGeometry()


setGeometry

void setGeometry(@NonNull Polygon geometry)


getStrokeColor

int getStrokeColor()

Sets the stroke color.

Default: hexademical RGBA code 0x0066FFFF. Setting the stroke color to any transparent color (for example, RGBA code 0x00000000) effectively disables the stroke.


setStrokeColor

void setStrokeColor(int strokeColor)


getStrokeWidth

float getStrokeWidth()

Sets the stroke width in units.

Default: 5. The size of a unit is equal to the size of a pixel at the current zoom when the camera position's tilt is equal to 0 and the scale factor is equal to 1.


setStrokeWidth

void setStrokeWidth(float strokeWidth)


getFillColor

int getFillColor()

Sets the fill color.

Default: hexademical RGBA code 0x0066FF99.

Note

Fill color is ignored if a pattern is set.


setFillColor

void setFillColor(int fillColor)


isGeodesic

boolean isGeodesic()

The object geometry can be interpreted in two different ways:

  • If the object mode is 'geodesic', the object geometry is defined on a sphere.
  • Otherwise, the object geometry is defined in projected space.
Default: false.


setGeodesic

void setGeodesic(boolean geodesic)


setPattern

void setPattern(@NonNull AnimatedImageProvider animatedImage,
                float scale)

Sets pattern to fill polygon.

@attention Original linear sizes of pattern should be equal to power of 2. @attention Fill color is ignored if a pattern is set.


setPattern

void setPattern(@NonNull ImageProvider image,
                float scale)

Sets pattern to fill polygon.

@attention Original linear sizes of pattern should be equal to power of 2. @attention Fill color is ignored if pattern is set.


resetPattern

void resetPattern()

Removes pattern.