Fly To Coordinates
This example demonstrates how to fly the camera to a fixed pair of coordinates and highlight a landmark there. A Landmark is created from a latitude/longitude pair, the camera is animated to centre on it, and the landmark is highlighted on the map with a search-result pin. The map remains fully interactive, supporting pan, pinch-zoom, rotate and tilt.
Creating the Landmark and Flying to It
Once the worldwide road map is confirmed up to date, the callback is cleared so it fires only once, then a Landmark is built from a name and a latitude/longitude pair and passed to highlightLandmarkOnMap.
Centering and Highlighting
highlightLandmarkOnMap clears any previous highlight, assigns the search-result pin image to the landmark, centres the camera on its coordinates with centerOnCoordinates, and then highlights it with activateHighlightLandmarks. The camera is centred on the middle of the free-space rectangle so the pin is not hidden behind the toolbar or the system bars.
The camera is centred on a rectangle rather than the full surface so the landmark is never hidden behind the toolbar or the system bars. getFreeSpaceRect() builds that rectangle from the toolbar position, the window insets and the system bars.
