O'Reilly logo

Expert Delphi by Paweł Głowacki

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required