Docs / Setup / iOS / MapTiler

MapTiler setup

How to render MapTiler Cloud styles through MapConductor. The iOS provider renders with MapLibre Native and lets you pick MapTiler reference styles by name.

PACKAGE
ios-for-maptiler
API KEY
Required
MIN iOS
15.1
VIEW
MapTilerMapView
Same provider, other platformsAndroidReact

Before you start

Xcode 15 or newer
A MapTiler Cloud account and API key
A deployment target of iOS 15.1 or later
STEP 01

Get an API key

Issue an API key from the MapTiler Cloud dashboard. There is a free tier.

STEP 02

Add it with Swift Package Manager

Use File > Add Package Dependencies in Xcode and paste the package URL. MapLibre Native, which does the rendering, comes in automatically.

Package URLSwift Package Manager
https://github.com/MapConductor/ios-for-maptiler
Package.swiftSwift
dependencies: [
    .package(url: "https://github.com/MapConductor/ios-sdk-core", from: "1.1.4"),
    .package(url: "https://github.com/MapConductor/ios-for-maptiler", from: "1.0.0"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "MapConductorCore", package: "ios-sdk-core"),
            .product(name: "MapConductorForMapTiler", package: "ios-for-maptiler"),
        ]
    ),
]
STEP 03

Hand over the API key

Pass it per view, or put it in Info.plist — the plist is the fallback used when the view's apiKey is nil. This mirrors the Android module reading MAPTILER_API_KEY from the manifest.

ContentView.swiftSwift
// Per view
MapTilerMapView(state: mapViewState, apiKey: "YOUR_MAPTILER_API_KEY")
Info.plistXML
<!-- Fallback, used when the view's apiKey is nil -->
<key>MapTilerAPIKey</key>
<string>YOUR_MAPTILER_API_KEY</string>
CAUTION
Rather than hard-coding the key, inject it at build time from an xcconfig or environment variable.

VERIFY

What you should see

The setup is complete when the map and its marker render.

ContentView.swiftSwiftUI
import SwiftUI
import MapConductorCore
import MapConductorForMapTiler

struct ContentView: View {
    @StateObject private var mapViewState = MapTilerViewState(
        cameraPosition: MapCameraPosition(
            position: GeoPoint(latitude: 35.6762, longitude: 139.6503),
            zoom: 11
        )
    )

    var body: some View {
        MapTilerMapView(state: mapViewState) {
            Marker(
                position: GeoPoint(latitude: 35.6762, longitude: 139.6503),
                icon: DefaultMarkerIcon(label: "Tokyo")
            )
        }
    }
}

Map designs

MapTilerDesign covers the MapTiler Cloud reference styles.

MapTilerDesign
Notes
Streets / StreetsDark / StreetsLight
The standard road map plus light and dark variants
Basic / Bright
Pared-back styles
Satellite
Satellite imagery
Outdoor / Winter / Topo
Outdoor, winter and topographic
Toner / Dataviz / Backdrop
Backdrops for your own data
Ocean / Landscape / Aquarelle / OpenStreetMap
Further themed styles

Troubleshooting

The map stays blank

  • Check either the view's apiKey or Info.plist's MapTilerAPIKey actually holds a value.
  • Confirm the key is active in MapTiler Cloud and you are within your quota.

The build fails

  • Clean the build folder (Cmd+Shift+K).
  • Delete ~/Library/Developer/Xcode/DerivedData and rebuild.
  • Refresh the Swift Package Manager dependencies, and avoid mixing in CocoaPods.

Next

Because the iOS provider renders with MapLibre Native, markers, polygons and the other overlays all work through the shared API.