YMKAssetsProvider

Warning

This feature is available in the Full MapKit SDK version

@protocol YMKAssetsProvider <NSObject>

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

Summary

Instance methods

- (nonnull UIImage *)imageWithSearchResult:
                         (nonnull YMKSearchResultItem *)searchResult
                         placemarkIconType:(NSInteger)placemarkIconType;

Returns an image for certain placemark type with given search result

This method will be called on a background thread

- (nonnull YMKSize *)sizeWithSearchResult:
                         (nonnull YMKSearchResultItem *)searchResult
                        placemarkIconType:(NSInteger)placemarkIconType;

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

This method may be called on any thread

- (nonnull YMKIconStyle *)
    iconStyleWithSearchResult:(nonnull YMKSearchResultItem *)searchResult
            placemarkIconType:(NSInteger)placemarkIconType;

Returns the icon style for certain placemark type with given search result

- (BOOL)canProvideLabelsWithSearchResult:
    (nonnull YMKSearchResultItem *)searchResult;

Returns true if provider is able to provide images for given search result and placemark types of LabelShortLeft, LabelShortRight, LabelDetailedLeft and LabelDetailedRight

Instance methods

imageWithSearchResult:placemarkIconType:

- (nonnull UIImage *)imageWithSearchResult:
                         (nonnull YMKSearchResultItem *)searchResult
                         placemarkIconType:(NSInteger)placemarkIconType;

Returns an image for certain placemark type with given search result

This method will be called on a background thread.


sizeWithSearchResult:placemarkIconType:

- (nonnull YMKSize *)sizeWithSearchResult:
                         (nonnull YMKSearchResultItem *)searchResult
                        placemarkIconType:(NSInteger)placemarkIconType;

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.


iconStyleWithSearchResult:placemarkIconType:

- (nonnull YMKIconStyle *)
    iconStyleWithSearchResult:(nonnull YMKSearchResultItem *)searchResult
            placemarkIconType:(NSInteger)placemarkIconType;

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.


canProvideLabelsWithSearchResult:

- (BOOL)canProvideLabelsWithSearchResult:
    (nonnull YMKSearchResultItem *)searchResult;

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.