Interface MapObjectCollection

com.yandex.mapkit.map

public interface MapObjectCollection extends MapObject

All Superinterfaces:
MapObject

A collection of map objects that can hold any set of MapObject items, including nested collections.

Methods

CircleMapObject addCircle(@NonNull Circle circle, int strokeColor, float strokeWidth, int fillColor)

Creates a new circle with the specified style and adds it to the current collection.

MapObjectCollection addCollection()

Creates a new nested collection of map objects.

ColoredPolylineMapObject addColoredPolyline(@NonNull Polyline polyline)

Creates a new colored polyline and adds it to the current collection.

ColoredPolylineMapObject addColoredPolyline()

Creates a new colored polyline with an empty geometry and adds it to the current collection.

PlacemarkMapObject addEmptyPlacemark(@NonNull Point point)

Creates a new empty placemark and adds it to the current collection.

void addListener(@NonNull MapObjectCollectionListener collectionListener)

Adds a listener to track notifications of changes to the collection.

PlacemarkMapObject addPlacemark(@NonNull Point point)

Creates a new placemark with the default icon and style, and adds it to the current collection.

PlacemarkMapObject addPlacemark(@NonNull Point point, @NonNull ImageProvider image)

Creates a new placemark with the default style and adds it to the current collection.

PlacemarkMapObject addPlacemark(@NonNull Point point, @NonNull ImageProvider image, @NonNull IconStyle style)

Creates a new placemark and adds it to the current collection.

PlacemarkMapObject addPlacemark(@NonNull Point point, @NonNull ViewProvider view)

Creates a new view placemark with default style and adds it to the current collection.

PlacemarkMapObject addPlacemark(@NonNull Point point, @NonNull ViewProvider view, @NonNull IconStyle style)

Creates a new view placemark and adds it to the current collection.

PlacemarkMapObject addPlacemark(@NonNull Point point, @NonNull AnimatedImageProvider animatedImage, @NonNull IconStyle style)

Creates a new animated placemark and adds it to the current collection.

PolygonMapObject addPolygon(@NonNull Polygon polygon)

Creates a new polygon and adds it to the current collection.

PolylineMapObject addPolyline(@NonNull Polyline polyline)

Creates a new polyline and adds it to the current collection.

void clear()

Removes all map objects from the collection.

PlacemarksStyler placemarksStyler()

A styler for all placemarks in this collection, including placemarks in child collections.

void remove(@NonNull MapObject mapObject)

Removes the given map object from the collection.

void setConflictResolvingMode(@NonNull ConflictResolvingMode mode)

Sets conflict resolving mode for placemarks in this collection.

void traverse(@NonNull MapObjectVisitor mapObjectVisitor)

Traverses through the collection with a visitor object.

Method Detail

addCircle

public CircleMapObject addCircle (@NonNull Circle circle, int strokeColor, float strokeWidth, int fillColor)

Creates a new circle with the specified style and adds it to the current collection.

addCollection

public MapObjectCollection addCollection ()

Creates a new nested collection of map objects.

addColoredPolyline

public ColoredPolylineMapObject addColoredPolyline (@NonNull Polyline polyline)

Creates a new colored polyline and adds it to the current collection.

addColoredPolyline

public ColoredPolylineMapObject addColoredPolyline ()

Creates a new colored polyline with an empty geometry and adds it to the current collection.

addEmptyPlacemark

public PlacemarkMapObject addEmptyPlacemark (@NonNull Point point)

Creates a new empty placemark and adds it to the current collection.

addListener

public void addListener (@NonNull MapObjectCollectionListener collectionListener)

Adds a listener to track notifications of changes to the collection.

addPlacemark

public PlacemarkMapObject addPlacemark (@NonNull Point point)

Creates a new placemark with the default icon and style, and adds it to the current collection.

addPlacemark

public PlacemarkMapObject addPlacemark (@NonNull Point point, @NonNull ImageProvider image)

Creates a new placemark with the default style and adds it to the current collection.

addPlacemark

public PlacemarkMapObject addPlacemark (@NonNull Point point, @NonNull ImageProvider image, @NonNull IconStyle style)

Creates a new placemark and adds it to the current collection.

addPlacemark

public PlacemarkMapObject addPlacemark (@NonNull Point point, @NonNull ViewProvider view)

Creates a new view placemark with default style and adds it to the current collection.

addPlacemark

public PlacemarkMapObject addPlacemark (@NonNull Point point, @NonNull ViewProvider view, @NonNull IconStyle style)

Creates a new view placemark and adds it to the current collection.

addPlacemark

public PlacemarkMapObject addPlacemark (@NonNull Point point, @NonNull AnimatedImageProvider animatedImage, @NonNull IconStyle style)

Creates a new animated placemark and adds it to the current collection.

addPolygon

public PolygonMapObject addPolygon (@NonNull Polygon polygon)

Creates a new polygon and adds it to the current collection.

addPolyline

public PolylineMapObject addPolyline (@NonNull Polyline polyline)

Creates a new polyline and adds it to the current collection.

clear

public void clear ()

Removes all map objects from the collection.

placemarksStyler

public PlacemarksStyler placemarksStyler ()

A styler for all placemarks in this collection, including placemarks in child collections.

remove

public void remove (@NonNull MapObject mapObject)

Removes the given map object from the collection.

setConflictResolvingMode

public void setConflictResolvingMode (@NonNull ConflictResolvingMode mode)

Sets conflict resolving mode for placemarks in this collection.

Child collections inherit value of this property, but can override it. Default value is Ignore.

traverse

public void traverse (@NonNull MapObjectVisitor mapObjectVisitor)

Traverses through the collection with a visitor object.

Used for iteration over map objects in the collection.