Warning

This feature is available in the Full MapKit SDK version

YMKAssetsProvider

protocol YMKAssetsProvider : NSObjectProtocol

Interface for providing images, image sizes and icon styles to the search layer. Call with static_cast(PlacemarkIconType) in all methods.

Summary

Instance methods

func image(withSearchResult searchResult: YMKSearchResultItem,
                       placemarkIconType: Int) -> UIImage
Returns an image for certain placemark type with given search result

This method will be called on a background thread

func size(withSearchResult searchResult: YMKSearchResultItem,
                      placemarkIconType: Int) -> YMKSize
Returns the size of the icon of certain placemark type with given search result

This method may be called on any thread

func iconStyle(withSearchResult searchResult: YMKSearchResultItem,
                           placemarkIconType: Int) -> YMKIconStyle
Returns the icon style for certain placemark type with given search result

func canProvideLabels(withSearchResult searchResult: YMKSearchResultItem) -> Bool
Returns true if provider is able to provide images for given search result and placemark types of LabelShortLeft, LabelShortRight, LabelDetailedLeft and LabelDetailedRight

Instance methods

image(withSearchResult:placemarkIconType:)

func image(withSearchResult searchResult: YMKSearchResultItem,
                       placemarkIconType: Int) -> UIImage

Returns an image for certain placemark type with given search result

This method will be called on a background thread.


size(withSearchResult:placemarkIconType:)

func size(withSearchResult searchResult: YMKSearchResultItem,
                      placemarkIconType: Int) -> YMKSize

Returns the size of the icon of certain placemark type with given search result

This method may be called on any thread. Its implementation must be thread-safe.


iconStyle(withSearchResult:placemarkIconType:)

func iconStyle(withSearchResult searchResult: YMKSearchResultItem,
                           placemarkIconType: Int) -> YMKIconStyle

Returns the icon style for certain placemark type with given search result. If obtainAdIcons mode is enabled, IconStyle.anchor will be replaced for advertisement pins

This method may be called on any thread. Its implementation must be thread-safe.


canProvideLabels(withSearchResult:)

func canProvideLabels(withSearchResult searchResult: YMKSearchResultItem) -> Bool

Returns true if provider is able to provide images for given search result and placemark types of LabelShortLeft, LabelShortRight, LabelDetailedLeft and LabelDetailedRight. If false is returned then no label would be shown for this search result.

This method may be called on any thread. Its implementation must be thread-safe.