Group Search Results
- UIKit
- SwiftUI
This example demonstrates how to use GEMKit in a UIKit application to display and center the results of a text search on the map as Highlights, with grouping enabled and a custom pin image.
Check the full implementation on GitHub.

UI and Map Integration
The layout stacks a search field (with an activity indicator), a map container, a results table, and a "Center Results" button. MapViewController is embedded inside the tagged mapContainer view and pinned to its edges:
Performing Search and Setting a Custom Pin Image
performSearch(text:) clears previous results, sets a rectangular location hint around Amsterdam, then calls searchContext.search(withQuery:location:). Each returned LandmarkObject receives a custom pin image via setImage(_:) before being added to the landmarks array. After the search completes, presentHighlights(_:settings:highlightId:) renders all results on the map:
Center on Highlight Area and Highlight Settings
Tapping a row in the table centers the map on that result's coordinates. The "Center Results" button calls getHighlightArea(_:) to retrieve the bounding area of all highlights and then uses center(onArea:zoomLevel:animationDuration:) to fit them all in view. getHighlightSettings() configures grouping, landmark display, and text/image sizes:
This example demonstrates how to use GEMKit in a SwiftUI application to display and center the results of a text search on the map as Highlights, with grouping enabled and a custom pin image.
Check the full implementation on GitHub.

UI and Map Integration
The following code outlines the search result item structure and the map view with a simple search field:
Performing Search and setting Custom Pin Image
The following code demonstrates how to perform a search with a location hint and set a custom pin image for the search results:
Center on Highlight Area and Helper Methods
The following code demonstrates how to center the map on the area of the search results and includes helper methods for highlight settings and map insets: