Map Selection
This example demonstrates how to select different elements on the map by tapping them and show the relevant details for each. A demo route from London to Paris is computed at startup, and the user can tap a route, the current-position marker, a POI (either a simple point POI or one with a geographic contour), a speed camera or a traffic event. Tapping inspects whatever is under the cursor and reacts accordingly: it centers on the selection and shows a details panel, or opens a web preview for elements that have one. The map is fully 3D and interactive, supporting pan, pinch-zoom, rotate and tilt.
Computing the Demo Route
So that routes are available to select, a route is computed once the worldwide road map is ready. Two Landmark waypoints (London as the departure, Paris as the destination) are passed to the RoutingService. calculateRoute returns an error code immediately: if it is not GemError.NoError the computation never started - so onCompleted will not fire - and the error is reported directly here.
When the routing completes without error, the computed routes are displayed on the map, the first route is selected, and the details of the selected route are shown.
Selecting Elements on Tap
The heart of the example is the map's onTouch handler. After setting cursorScreenPosition so the cursor selection APIs are accurate, it inspects the map in priority order and stops at the first match:
- A route (
cursorSelectionRoutes) - make it the main route and center on it. - The current-position marker (
cursorSelectionSceneObject, matched against the default position tracker) - show "My position" details and highlight it. - A traffic event (
cursorSelectionTrafficEvents) - open its preview page in the web view. - A landmark or overlay (
cursorSelectionLandmarks/cursorSelectionOverlayItems) - safety overlays such as speed cameras open their own preview page; any other landmark or overlay is turned into aLandmark, whose details are shown and which is highlighted on the map.
Selecting a Route
selectRoute shows the route's details panel (summary, distance and time) and sets it as the main route to highlight it. Depending on the presentRoutes flag it either presents all alternative routes together (so they all fit in the visible area) or simply centers on the existing routes - both framed into the free map area left by the toolbar, system bars and details panel.
Highlighting a Selected Landmark
highlightLandmarkOnMap handles a simple POI and a contour POI differently. After clearing previous highlights and assigning the search-result pin image, it checks for a geographic contour: landmarks that have one (parks, buildings, regions, …) are centered with centerOnRectArea and drawn with their contour, while point landmarks are centered on their coordinate with centerOnCoordinates. Finally the landmark is highlighted with activateHighlightLandmarks.
Long Press: Selecting the Closest Street
In addition to single taps, a long press selects the closest street to the press point (cursorSelectionStreets) and shows its details, highlighting it the same way as any other landmark.





