---
title: "Display a 3D terrain map - Swift SDK | Mobile sdk | Mobile sdk ios | Ios"
description: "Display 3D terrain maps on iOS using Swift SDK."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Display a 3D terrain map - Swift SDK

This example demonstrates how to create a 3D (three-dimensional) terrain map and display it on your mobile device using MapTiler.

Enhance the authenticity of your applications and data by incorporating terrain relief into your maps. This will provide a greater sense of realism and depth to your visuals.

 Your browser does not support the video tag.

  

```swift
import SwiftUI
import CoreLocation
import MapTilerSDK

struct ContentView: View {
  init() {
    // Best practice: set the MapTiler API key on app startup instead on init
    // Replace with your MapTiler API key
    Task { await MTConfig.shared.setAPIKey("MY_API_KEY") }
  }

  @State private var mapView = MTMapView(
    options: MTMapOptions(
      center: CLLocationCoordinate2D(latitude: 8.94738, longitude: 45.97812),
      zoom: 14,
      maxZoom: 14,
      pitch: 70,
      maxPitch: 85,
      bearing: -100.86,
      terrainIsEnabled: true
    )
  )

  var body: some View {
    MTMapViewContainer(map: mapView)
      .referenceStyle(.outdoor)
  }
}
```

 Your browser does not support the video tag.
