Docs / Setup / Android / MapTiler

MapTiler setup

How to drive MapTiler's official Android SDK (com.maptiler:maptiler-sdk-kotlin) through MapConductor, picking MapTiler Cloud reference styles by name.

MODULE
com.mapconductor:for-maptiler
API KEY
Required
VIEW
MapTilerMapView
TIME
10 min
Same provider, other platformsiOSReact

Before you start

An Android development environment (Android Studio)
A MapTiler Cloud account and API key
STEP 01

Get an API key

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

STEP 02

Add the dependencies

The MapTiler SDK is available from Maven Central.

app/build.gradle.ktsKotlin
dependencies {
    // MapTiler Android SDK
    implementation("com.maptiler:maptiler-sdk-kotlin:2.1.0")

    // MapConductor BOM pins every module below
    implementation(platform("com.mapconductor:mapconductor-bom:1.2.0"))

    implementation("com.mapconductor:core")
    implementation("com.mapconductor:for-maptiler")
}
STEP 03

Hand over the API key

The module reads the key from a manifest meta-data entry — use a placeholder if you route it through the Secrets Gradle Plugin. You can also set it in code.

AndroidManifest.xmlXML
<manifest>
    <uses-permission android:name="android.permission.INTERNET" />

    <application>
        <meta-data
            android:name="MAPTILER_API_KEY"
            android:value="${MAPTILER_API_KEY}" />
    </application>
</manifest>
MainActivity.ktKotlin
// Alternative: set it in code before the first map is shown
com.maptiler.maptilersdk.MTConfig.apiKey = "YOUR_MAPTILER_API_KEY"
CAUTION
Never commit secrets.properties. Add it to .gitignore so it cannot slip in, and feed the value through environment variables (or another secure channel) in CI.

VERIFY

What you should see

Pick a style and render the map. Tiles loading means you are done.

TestMapTiler.ktJetpack Compose
@Composable
fun TestMapTiler(modifier: Modifier = Modifier) {
    val mapState = rememberMapTilerMapViewState(
        mapDesign = MapTilerDesign.Streets,
        cameraPosition = MapCameraPosition(
            position = GeoPoint(35.6812, 139.7671),
            zoom = 11.0,
        ),
    )

    // If the map appears, the setup is correct.
    MapTilerMapView(state = mapState, modifier = modifier)
}

Map designs

MapTilerDesign enumerates the MapTiler Cloud reference styles as they are.

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 the manifest's MAPTILER_API_KEY actually resolved to a value.
  • Confirm the key is active in MapTiler Cloud and you are within your quota.
  • Confirm the INTERNET permission is present.

The build fails

  • Check that the map SDK coordinates and version match what your version catalog declares.
  • Make sure the repository is declared in settings.gradle.kts — with repositoriesMode set to FAIL_ON_PROJECT_REPOS, per-module repositories blocks are ignored.
  • If several map SDKs are present at once, look for dependency clashes with ./gradlew :app:dependencies.

Next

Markers, polylines, polygons, circles, ground images, raster layers and info bubbles all work through the shared API. Because MapTiler's Android SDK runs MapLibre GL JS in a WebView, shapes are added to the style as GeoJSON sources with fill and line layers — geodesic interpolation and hole handling come from the shared core, so the result matches the other providers.