Material 3 extensions
The controls that the base library draws take their colors from a fixed palette that reads over any basemap, because Compose Foundation carries no theme. This module replaces them with versions that read your Material 3 color scheme and typography.
To get started, add the dependency to your project:
[libraries]maplibre-composeMaterial3 = { module = "org.maplibre.compose:maplibre-compose-material3", version = "0.14.0" }commonMain.dependencies { implementation(libs.maplibre.composeMaterial3)}MapOverlay.Material3 draws the same controls as MapOverlay.Default in the
same places, so switching to it is one parameter:
MaplibreMap(overlay = MapOverlay.Material3)Arrange the controls yourself
Section titled “Arrange the controls yourself”Each control is also a composable you can place in a MapOverlay of your own.
See Map controls for how the overlay lays out.
MaplibreMap( overlay = MapOverlay { ScaleBar( cameraState.viewport?.metersPerDpAtTarget ?: 0.0, modifier = Modifier.align(Alignment.TopStart), ) // (1)! CompassButton(cameraState, modifier = Modifier.align(Alignment.TopEnd)) MaplibreLogo(Modifier.align(Alignment.BottomStart)) ExpandingAttributionButton( cameraState = cameraState, styleState = styleState, modifier = Modifier.align(Alignment.BottomEnd), contentAlignment = Alignment.BottomEnd, ) })ScaleBarandCompassButtonstay on screen. TheDisappearingversions thatMapOverlay.Material3uses fade in when the zoom or the orientation changes, and fade out once it settles.