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. |
ClusterizedPlacemarkCollection | addClusterizedPlacemarkCollection(@NonNull ClusterListener clusterListener) | Creates a new nested collection of clusterized placemarks. |
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. |
List< PlacemarkMapObject > | addEmptyPlacemarks(@NonNull List< Point > points) | Creates new empty placemarks and adds them 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 placemark with animated icon and adds it to the current collection. |
PlacemarkMapObject | addPlacemark(@NonNull Point point, @NonNull AnimatedModelProvider animatedModel, @NonNull ModelStyle style) | Creates a new placemark with animated model and adds it to the current collection. |
List< PlacemarkMapObject > | addPlacemarks(@NonNull List< Point > points, @NonNull ImageProvider image, @NonNull IconStyle style) | Creates new placemarks and adds them 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 | traverse(@NonNull MapObjectVisitor mapObjectVisitor) | Traverses through the collection with a visitor object. |
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. |
ClusterizedPlacemarkCollection | addClusterizedPlacemarkCollection(@NonNull ClusterListener clusterListener) | Creates a new nested collection of clusterized placemarks. |
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. |
List< PlacemarkMapObject > | addEmptyPlacemarks(@NonNull List< Point > points) | Creates new empty placemarks and adds them 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 placemark with animated icon and adds it to the current collection. |
PlacemarkMapObject | addPlacemark(@NonNull Point point, @NonNull AnimatedModelProvider animatedModel, @NonNull ModelStyle style) | Creates a new placemark with animated model and adds it to the current collection. |
List< PlacemarkMapObject > | addPlacemarks(@NonNull List< Point > points, @NonNull ImageProvider image, @NonNull IconStyle style) | Creates new placemarks and adds them 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 | 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.
addClusterizedPlacemarkCollection
public ClusterizedPlacemarkCollection addClusterizedPlacemarkCollection (@NonNull ClusterListener clusterListener)
Creates a new nested collection of clusterized placemarks.
clusterListener | Listener that controls cluster appearance once they are added to the map. |
clusterListener | Listener that controls cluster appearance once they are added to the map. |
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.
Hint: to add a large amount of empty placemarks use addEmptyPlacemarks method.addEmptyPlacemarks
public List< PlacemarkMapObject > addEmptyPlacemarks (@NonNull List< Point > points)
Creates new empty placemarks and adds them to the current collection.
Relevant for Android: this method provides better performance for adding a large number of empty placemarks than multiple calls of addEmptyPlacemark.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.
Hint: to add a large amount of placemarks use addPlacemarks method.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 placemark with animated icon and adds it to the current collection.
addPlacemark
public PlacemarkMapObject addPlacemark (@NonNull Point point, @NonNull AnimatedModelProvider animatedModel, @NonNull ModelStyle style)
Creates a new placemark with animated model and adds it to the current collection.
addPlacemarks
public List< PlacemarkMapObject > addPlacemarks (@NonNull List< Point > points, @NonNull ImageProvider image, @NonNull IconStyle style)
Creates new placemarks and adds them to the current collection.
Relevant for Android: this method provides better performance for adding a large number of placemarks than multiple calls of addPlacemark.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.
traverse
public void traverse (@NonNull MapObjectVisitor mapObjectVisitor)
Traverses through the collection with a visitor object.
Used for iteration over map objects in the collection.