MapScale Docs
Integration guides

Add a MapScale map to Android

Render MapScale tiles in a Kotlin Android app with MapLibre Native.

Beginner

Add the MapLibre dependency

Add MapLibre Native to your app module.

Add the MapLibre dependency
dependencies {
	implementation("org.maplibre.gl:android-sdk:11.8.2")
}

Allow internet access

The map loads style, glyph, sprite, and tile requests over HTTPS.

Allow internet access
<uses-permission android:name="android.permission.INTERNET" />

Create a map activity

Set the style URL after the map is ready, then move the camera to Bangkok.

Create a map activity
class MapActivity : AppCompatActivity() {
	private lateinit var mapView: MapView
	private val key = "pk_test_your_key_here"

	override fun onCreate(savedInstanceState: Bundle?) {
		super.onCreate(savedInstanceState)
		mapView = MapView(this)
		setContentView(mapView)
		mapView.onCreate(savedInstanceState)

		mapView.getMapAsync { map ->
			map.setStyle("https://api.mapscale.io/styles/v1/streets?key=$key") {
				map.cameraPosition = CameraPosition.Builder()
					.target(LatLng(13.7563, 100.5018))
					.zoom(11.0)
					.build()
			}
		}
	}
}

On this page