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.
Before you start
Get an API key
Issue an API key from the MapTiler Cloud dashboard. There is a free tier.
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.
https://github.com/MapConductor/ios-for-maptiler
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"),
]
),
]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.
// Per view MapTilerMapView(state: mapViewState, apiKey: "YOUR_MAPTILER_API_KEY")
<!-- Fallback, used when the view's apiKey is nil --> <key>MapTilerAPIKey</key> <string>YOUR_MAPTILER_API_KEY</string>
VERIFY
What you should see
The setup is complete when the map and its marker render.
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.
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.