Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
Delphi

Working with TMapView on iOS and Android with RAD Studio XE8

The new maps component in RAD Studio XE8 simplifies the addition of mapping functionality to mobile applications. TMapView provides map API access for iOS and Android. It makes use of the Google Maps Android API on Android and the Map Kit Framework on iOS.

The key features of the TMapView component are:

  • Four Types of Maps: Normal, Satellite, Hybrid and Terrain (Android only)
  • Gesture Control: Intuitive tilt, rotate and zoom gesture controls
  • Control the Map View: Ability to control the map properties such as the map center coordinates, the map orientation and so on
  • Custom markers: Ability to add markers to the maps

If you are using TMapView on Android, you will need to obtain a Google Maps API key.

RAD Studio XE8 ships with two maps sample applications for Object Pascal and C++.

Object Pascal:

  • C:UsersPublicDocumentsEmbarcaderoStudio16.0SamplesObject PascalMobile SamplesDevice Sensors and ServicesMaps
  • C:UsersPublicDocumentsEmbarcaderoStudio16.0SamplesObject PascalMobile SamplesDevice Sensors and ServicesMap Type Selector

C++:

  • C:UsersPublicDocumentsEmbarcaderoStudio16.0SamplesCPPMobile SamplesDevice Sensors and ServicesMaps
  • C:UsersPublicDocumentsEmbarcaderoStudio16.0SamplesCPPMobile SamplesDevice Sensors and ServicesMap Type Selector

I created a small demo project that uses the Spitcast REST API, REST component framework, FDMemTable and TMapView to display surf locations on my map based on the longitude, latitude and spot name information returned from the REST service. A custom marker graphic in the shape of a surfboard fin is used to indicate the locations on the map.

You can download my demo project here. 

Here is a code snippet from the demo project:

Here is the app running on my iPad:

mapsgraphicipadsurf_5f00_zpsec1pm7je-5177400

Here is a quick code snippet on how to clear the markers on the map:

Do you want to create an app for iOS, and Android? Try the Cross-Platform Development tool, which can help you create apps in the Delphi or C++ environments.
Try it out and make the most of it. Request a Product Demo here.
See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Director of Product Management, Developer Tools Idera, Inc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES