MapKit Mobile SDK

MMKMapObjectCollection

class MMKMapObjectCollection : MMKBaseMapObjectCollection

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

Summary

Instance methods

func addPlacemark() -> MMKPlacemarkMapObject
Creates a new empty placemark and adds it to the current collection

func addPlacemark(placemarkCreatedCallback: @escaping MMKPlacemarkCreatedCallback) -> MMKPlacemarkMapObject
Creates a new empty placemark and adds it to the current collection

func addEmptyPlacemark(with point: MMKPoint) -> MMKPlacemarkMapObject
Creates a new empty placemark and adds it to the current collection

func addPlacemark(with point: MMKPoint) -> MMKPlacemarkMapObject
Creates a new placemark with the default icon and style, and adds it to the current collection

func addPlacemark(with point: MMKPoint, image: UIImage) -> MMKPlacemarkMapObject
Creates a new placemark with the default style and adds it to the current collection

func addPlacemark(with point: MMKPoint,
                       image: UIImage,
                       style: MMKIconStyle) -> MMKPlacemarkMapObject
Creates a new placemark and adds it to the current collection

func addPlacemark(with point: MMKPoint,
                        view: MRTViewProvider) -> MMKPlacemarkMapObject
Creates a new view placemark with default style and adds it to the current collection

func addPlacemark(with point: MMKPoint,
                        view: MRTViewProvider,
                       style: MMKIconStyle) -> MMKPlacemarkMapObject
Creates a new view placemark and adds it to the current collection

func addPlacemark(with point: MMKPoint,
               animatedImage: MRTAnimatedImageProvider,
                       style: MMKIconStyle) -> MMKPlacemarkMapObject
Creates a new placemark with animated icon and adds it to the current collection

func addPlacemarks(with points: [MMKPoint],
                         image: UIImage,
                         style: MMKIconStyle) -> [MMKPlacemarkMapObject]
Creates new placemarks and adds them to the current collection

func addEmptyPlacemarks(with points: [MMKPoint]) -> [MMKPlacemarkMapObject]
Creates new empty placemarks and adds them to the current collection

func addPolyline(with polyline: MMKPolyline) -> MMKPolylineMapObject
Creates a new polyline and adds it to the current collection

func addPolyline() -> MMKPolylineMapObject
Creates a new polyline with an empty geometry and adds it to the current collection

func addPolygon(with polygon: MMKPolygon) -> MMKPolygonMapObject
Creates a new polygon and adds it to the current collection

func addCircle(with circle: MMKCircle) -> MMKCircleMapObject
Creates a new circle and adds it to the current collection

func add() -> MMKMapObjectCollection
Creates a new nested collection of map objects

func addClusterizedPlacemarkCollection(with clusterListener: MMKClusterListener) -> MMKClusterizedPlacemarkCollection
Creates a new nested collection of clusterized placemarks

func placemarksStyler() -> MMKPlacemarksStyler
A styler for all placemarks in this collection, including placemarks in child collections

Instance methods

addPlacemark()

func addPlacemark() -> MMKPlacemarkMapObject

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


addPlacemark(placemarkCreatedCallback:)

func addPlacemark(placemarkCreatedCallback: @escaping MMKPlacemarkCreatedCallback) -> MMKPlacemarkMapObject

Creates a new empty placemark and adds it to the current collection. Callback can be used to setup placemark style and position Callback will be called before MapObjectCollectionListener#onMapObjectAdded


addEmptyPlacemark(with:)

func addEmptyPlacemark(with point: MMKPoint) -> MMKPlacemarkMapObject

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

Alert

Use addPlacemark() + setGeometry(point)


addPlacemark(with:)

func addPlacemark(with point: MMKPoint) -> MMKPlacemarkMapObject

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

Alert

Use addPlacemark() + setGeometry(point) + setIcon(your_own_blue_dot_icon). Default icon (also known as blue dot) is no longer provided.


addPlacemark(with:image:)

func addPlacemark(with point: MMKPoint, image: UIImage) -> MMKPlacemarkMapObject

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

Alert

Use addPlacemark() + setGeometry(point) + setIcon(image, style)


addPlacemark(with:image:style:)

func addPlacemark(with point: MMKPoint,
                       image: UIImage,
                       style: MMKIconStyle) -> MMKPlacemarkMapObject

Creates a new placemark and adds it to the current collection. Hint: to add a large amount of placemarks use addPlacemarks method.

Alert

Use addPlacemark() + setGeometry(point) + setIcon(image, style)


addPlacemark(with:view:)

func addPlacemark(with point: MMKPoint,
                        view: MRTViewProvider) -> MMKPlacemarkMapObject

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

Alert

Use addPlacemark() + setGeometry(point) + setView(view)


addPlacemark(with:view:style:)

func addPlacemark(with point: MMKPoint,
                        view: MRTViewProvider,
                       style: MMKIconStyle) -> MMKPlacemarkMapObject

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

Alert

Use addPlacemark() + setGeometry(point) + setView(view, style)


addPlacemark(with:animatedImage:style:)

func addPlacemark(with point: MMKPoint,
               animatedImage: MRTAnimatedImageProvider,
                       style: MMKIconStyle) -> MMKPlacemarkMapObject

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

Alert

Use addPlacemark() + setGeometry(point) + useAnimation() + setIcon(animatedImage, style)


addPlacemarks(with:image:style:)

func addPlacemarks(with points: [MMKPoint],
                         image: UIImage,
                         style: MMKIconStyle) -> [MMKPlacemarkMapObject]

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.

Alert

Use ClusterizedPlacemarkCollection


addEmptyPlacemarks(with:)

func addEmptyPlacemarks(with points: [MMKPoint]) -> [MMKPlacemarkMapObject]

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.

Alert

Use ClusterizedPlacemarkCollection


addPolyline(with:)

func addPolyline(with polyline: MMKPolyline) -> MMKPolylineMapObject

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


addPolyline()

func addPolyline() -> MMKPolylineMapObject

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


addPolygon(with:)

func addPolygon(with polygon: MMKPolygon) -> MMKPolygonMapObject

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


addCircle(with:)

func addCircle(with circle: MMKCircle) -> MMKCircleMapObject

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


add()

func add() -> MMKMapObjectCollection

Creates a new nested collection of map objects.


addClusterizedPlacemarkCollection(with:)

func addClusterizedPlacemarkCollection(with clusterListener: MMKClusterListener) -> MMKClusterizedPlacemarkCollection

Creates a new nested collection of clusterized placemarks.

The class does not retain the object in the 'clusterListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

clusterListener

Listener that controls cluster appearance once they are added to the map.


placemarksStyler()

func placemarksStyler() -> MMKPlacemarksStyler

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