This example app demonstrates the following features:
- Show how to change the map perspective between 2D and 3D views.
When the example app is run, the scene is viewed from above. The button toggles the map view perspective mode between 2D (looking vertically downward) and 3D (looking toward horizon).
- Create an instance of a
CTouchEventListenerto make the map interactive, enabling touch events such as pan and zoom - Create an instance of
MapViewproducing an OpenGL context using ImGUI, passing in the touch event listener, and a custom GUI function,getUiRender - The custom GUI function has a button to change the map perspective; the state is kept internally as a static bool flag, and the button toggles between
3D perspective (looking at the map toward the horizon)
gem::MVP_3Dand 2D perspective (looking vertically downward/perpendicular directly at the map)gem::MVP_2Dat each click; the map perspective is set usingmapView->preferences().setMapViewPerspective()and an optional animation in milliseconds is specified (2000 = 2 seconds).
