We rolled out a new and better SDK for you.
You can initiate the map in two ways with the Maps SDK:
- Map initialization using Storyboard – allows you to visualize/prototype the map display in the user interface of your app with Storyboards.
- Map initialization from the code using TTMapConfiguration – makes it possible to set the map configuration options from the code. Also, the TomTom logo placement can only be defined with TTMapConfiguration.
You can find both ways described in this page.
1. Map initialization using Storyboard
The main class that represents a Map is a
TTMapView is an interactive world map
that pans and zooms in response to gestures. Use its methods to receive map-related update messages
in your application as long as they conform to the TTMapViewDelegate protocol.
To initialize a map using storyboards:
- Drop the
UIViewobject from the Library into your storyboard.
- In the Class field, set the class to
- Add the values
TrafficKeyto the User Defined Runtime
- Set the value type for these keys as String.
- Enter your service keys into the fields.
Map initialization using Storyboard
2. Map initialization using TTMapConfigurationBuilder
The basic steps for adding a map are:
- Set up your project as it is described in DOWNLOADS.
- Create the object 'TTMapView'.
- Obtain the keys to the constructor class.
- Use the 'TTMapView' object to set the map properties.
[Optional] Create the TTMapConfiguration object and pass it to the MapView init method. The TTMapConfiguration object allows you to configure the initial viewport and TomTom logo position.
Map configuration is an extra parameter that can be used to init a 'TTMapView'.
The service key is added by entering it into the class constructor.
When using the Maps SDK for iOS, it is required that the TomTom logo is always visible. By default, the TomTom logo is located at the bottom-left corner of the map. However, you can easily customize its position to meet your app design by passing the TTLogoPosition object to your map configuration object.
If you want to init a 'TTMapView' centered on specific place with a custom bearing and pitch, you should check the TTViewportTransform param of TTMapConfiguration.