Override Quick-Search Icons (iOS) Follow
This article describes how to override quick-search icons in the search sheet using the iOS SDK (v6.2 and later).
Quick-Search Icons Overview
Quick-Search Icons are buttons displayed on the search sheet in the MRMapViewController. These buttons represent a facility placemark type and will highlight all placemarks of that type on the currently visible map when tapped.
Quick-Search Icons in Search Sheet |
ATM Quick-Search Icon has been tapped |
Quick-Search Icons Override
The quick-search override functionality gives the SDK developer the ability to define which facility placemarks are shown in the search sheet. Up to eight quick-search icons can be displayed in the search sheet. You can define an array of up to eight strings that represent the facility placemark types you would like to be shown as quick-search icons.
Please note that there must be existing placemarks of the specified type(s) at the location in order for the quick-search icons to appear.
A Quick-Search Icon example will be included in the iOS Sample app with the release of SDK v6.3.
Quick-Search Icons Override Code
There are several different ways you can configure the quick-search icons by calling the method below when configuring the MRMapViewController:
- Display only specified quick-search icons
mapView.mapKey = MREditorKey(forMap: MSExampleHost.mapID(), app: MSExampleHost.appID())
// this call will display the ATM and Water Fountain placemark types as quick-search icons in the bottomsheet
// with no other default quick-search icons.
displaysSearchSheet(true, withQuickSearchPlacemarks: ["atm", "water_fountain"], hideDefaultQuickSearchIcons: true) - Display specified quick-search icons prepended to default quick-search icons
mapView.mapKey = MREditorKey(forMap: MSExampleHost.mapID(), app: MSExampleHost.appID())
// this call will display the ATM and Water Fountain placemark types as quick-search icons in the bottomsheet
// prepended to default quick-search icons.
displaysSearchSheet(true, withQuickSearchPlacemarks: ["atm", "water_fountain"], hideDefaultQuickSearchIcons: false) - Display only default quick-search icons
mapView.mapKey = MREditorKey(forMap: MSExampleHost.mapID(), app: MSExampleHost.appID())
// this call will display default quick-search icons.
displaysSearchSheet(true, withQuickSearchPlacemarks: nil, hideDefaultQuickSearchIcons: false) - Display search sheet with no quick-search icons
mapView.mapKey = MREditorKey(forMap: MSExampleHost.mapID(), app: MSExampleHost.appID())
// this call will display default quick-search icons.
displaysSearchSheet(true, withQuickSearchPlacemarks: nil, hideDefaultQuickSearchIcons: true)
Facility Placemark Types
|
|
|
|
Comments
0 comments
Please sign in to leave a comment.