Working with maps
One of the most useful components in mobile apps is a map. Delphi comes with the cross-platform TMapView
component that makes it easy to embed a map in an app.
On Android, it uses the Google Maps Android API and on iOS it uses the Map Kit Framework. On Android, it is necessary to first obtain the Google Maps API key. There are different possible view types on each platform. A map can be displayed as Normal
, Satellite
, or Hybrid
. On Android there is also an additional Terrain
view mode.
Let's build a simple app to try out different TMapView
features. Create a new multi-device, blank Delphi app. Save the main form as uFormMap
and the project as MapApp
. Change the Name
property of the form to FormMap
. Drop TToolbar
on the form and a TMapView
component. Align to Client
.
Drop the TComboBox
component onto the toolbar. Rename it as cmbbxMapType
and add five items to its Items
property that corresponds to five possible map types.

MapType choices in the items property of the cmbbxMapType...