Skip to content

software-mansion/kmp-maps

Repository files navigation

KMP Maps by Software Mansion

Kotlin License Maven Central

kmp-maps provides a unified map component for Compose Multiplatform applications, offering seamless integration with native map APIs on both Android and iOS platforms.

🎯 See It in Action

Check out the sample project in the /sample directory for complete usage examples.

iOS (Apple Maps) Android (Google Maps)
Map view with circles, polygon, polylines and markers on iOS Map view with circles, polygon, polylines and markers on Android

✨ Features

  • Cross-platform compatibility - Single API for both Android and iOS
  • Native performance - Uses Google Maps SDK on Android and Apple Maps (MapKit) on iOS
  • Compose Multiplatform - Built with Compose Multiplatform for modern UI development
  • Rich functionality - Support for markers, circles, polygons, polylines, and custom styling
  • Interactive callbacks - Handle user interactions like clicks, camera movements, and gestures
  • Location services - Built-in location permission handling and user location display

🚀 Usage

@Composable
fun MyMapScreen() {
    Map(
        modifier = Modifier.fillMaxSize(),
        properties = MapProperties(
            isMyLocationEnabled = true,
            mapType = MapType.NORMAL,
        ),
        uiSettings = MapUISettings(
            myLocationButtonEnabled = true,
            compassEnabled = true
        ),
        cameraPosition = CameraPosition(
            coordinates = Coordinates(latitude = 50.0619, longitude = 19.9373),
            zoom = 13f
        ),
        markers = listOf(
            Marker(
                coordinates = Coordinates(latitude = 50.0486, longitude = 19.9654),
                title = "Software Mansion",
                androidSnippet = "Software house"
            )
        ),
        onMarkerClick = { marker ->
            println("Marker clicked: ${marker.title}")
        },
        onMapClick = { coordinates ->
            println("Map clicked at: ${coordinates.latitude}, ${coordinates.longitude}")
        }
    )
}

📦 Installation

For installation instructions, platform setup, and configuration details, visit our dedicated document.

📚 API Reference

Check out our dedicated documentation page for API reference.

🤝 Contributing

We welcome contributions! Please feel free to submit a Pull Request.

KMP Maps is created by Software Mansion

swm

Since 2012 Software Mansion is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – Hire us.

Made by @software-mansion and community 💛