Fly To Area
This example demonstrates how to search for a landmark and fly the camera to its geographic area. The app runs a text search for a fixed landmark (the Statue of Liberty), animates the camera to frame the landmark's area within the visible map, and highlights the area's contour. The map remains fully interactive, supporting pan, pinch-zoom, rotate and tilt.
Triggering the Search
The search runs once the worldwide road map is confirmed up to date. The callback is cleared immediately so it fires only once, then searchByFilter is called with the query and a reference point. The coordinates passed to searchByFilter only bias result relevance; they are not required for the search to work.
searchByFilter returns an error code immediately. A non-NoError value means the search never started, so the onCompleted callback won't fire to clear the progress bar - the error is therefore surfaced here, hiding the progress bar and showing a status message.
Handling the Search Result
When the search completes, the first result is passed to flyTo. The progress bar and status messages reflect the search state, and any error is surfaced to the user.
Flying to the Landmark's Area
flyTo reads the landmark's geographicArea and animates the camera to frame it with centerOnRectArea. The animation's onStarted and onCompleted callbacks update the status text, and the landmark's area contour is highlighted on the map with a mapView.activateHighlightLandmarks call.
The camera is framed into a rectangle rather than the full surface so the landmark's area is never hidden behind the toolbar or the status text overlay. getFreeScreenRect() builds that rectangle from the toolbar position, the window insets, the status panel and a fixed margin.

