
Ready-to-ship template automating library build, docs, demo and release pipelines — publishes README as homepage, generates API docs, hosts live demo, builds downloadable sample executables and CI/CD.
Location picker dialog for Compose Multiplatform (Android / iOS / Desktop / Web) built on top of cmp-webview.
Add the dependency (replace version as needed):
implementation("io.github.aryapreetam:cmp-locationpicker:0.0.3")Note: the library UI itself uses only compose.foundation/compose.ui (no compose.material3 dependency in :cmp-locationpicker).
@Composable
fun Example(show: Boolean, onDismiss: () -> Unit, onPicked: (io.github.aryapreetam.cmplocationpicker.model.LatLng) -> Unit) {
if (!show) return
io.github.aryapreetam.cmplocationpicker.ui.LocationPickerDialog(
onDismiss = onDismiss,
onLocationPicked = onPicked
)
}The library ships with English defaults. Apps should pass localized strings:
strings = io.github.aryapreetam.cmplocationpicker.ui.LocationPickerStrings(
title = "Pick location",
selectButton = "Select",
closeContentDescription = "Close",
loadingMap = "Loading map…",
searchPlaceholder = "Search location…",
noResults = "No results",
searchError = "Search error",
)options = io.github.aryapreetam.cmplocationpicker.ui.LocationPickerOptions(
searchLanguageTag = "en",
countryCodes = "in",
suggestionsLimit = 5
)On dialog start, v0 performs a best-effort IP-based lookup (default endpoint: https://ipapi.co/json/).
The default provider expects a JSON response containing latitude and longitude.
You can override or disable it:
ipLocationProvider = object : io.github.aryapreetam.cmplocationpicker.provider.IpLocationProvider {
override suspend fun getBestEffortLatLng(): io.github.aryapreetam.cmplocationpicker.model.LatLng =
io.github.aryapreetam.cmplocationpicker.model.LatLng(20.5937, 78.9629)
}You can also provide a custom MapProvider if you want different HTML/assets or to avoid remote CDNs.
The default v0 implementation may perform network requests to third parties:
https://ipapi.co/json/ (best-effort initial center)https://unpkg.com/... (Leaflet assets)https://{s}.basemaps.cartocdn.com/... (map tiles)https://nominatim.openstreetmap.org/search (search suggestions)If your app must not contact these services, provide your own IpLocationProvider and/or MapProvider.
If you ship the default v0 provider in production, make sure you comply with attribution requirements:
© OpenStreetMap contributors and © CARTO.From a checkout that includes the composite builds:
./gradlew :cmp-locationpicker:testDebugUnitTest./gradlew :sample:composeApp:jvmTest./gradlew :sample:androidApp:connectedAndroidTestThe Desktop WebView interop test is opt-in because it requires a real desktop UI environment:
CMP_LOCATIONPICKER_RUN_DESKTOP_IT=true ./gradlew :sample:composeApp:jvmTestDownload and try the sample app on your platform without building from source:
| Platform | Download Link |
|---|---|
| 🍏 macOS (Intel) | |
| 🍎 macOS (Apple Silicon) | |
| 🪟 Windows | |
| 🐧 Linux | |
| 🤖 Android | |
| 🌐 Web (Wasm) | |
| iOS Simulator |
For instructions on how to install and run the pre-built executables or build and run the sample application from source code, please refer to the How to Run the Sample App guide.
Automated WebView interop UI tests are currently not feasible on iOS/WASM (Compose interop container limitations). Use the checklist in Manual QA Checklist.
During development, this repo is typically used as a composite build alongside a local checkout of cmp-webview.
See settings.gradle.kts for the includeBuild("../cmp-webview") + dependency substitution setup.
MIT License © 2025 aryapreetam. See LICENSE for details.
Location picker dialog for Compose Multiplatform (Android / iOS / Desktop / Web) built on top of cmp-webview.
Add the dependency (replace version as needed):
implementation("io.github.aryapreetam:cmp-locationpicker:0.0.3")Note: the library UI itself uses only compose.foundation/compose.ui (no compose.material3 dependency in :cmp-locationpicker).
@Composable
fun Example(show: Boolean, onDismiss: () -> Unit, onPicked: (io.github.aryapreetam.cmplocationpicker.model.LatLng) -> Unit) {
if (!show) return
io.github.aryapreetam.cmplocationpicker.ui.LocationPickerDialog(
onDismiss = onDismiss,
onLocationPicked = onPicked
)
}The library ships with English defaults. Apps should pass localized strings:
strings = io.github.aryapreetam.cmplocationpicker.ui.LocationPickerStrings(
title = "Pick location",
selectButton = "Select",
closeContentDescription = "Close",
loadingMap = "Loading map…",
searchPlaceholder = "Search location…",
noResults = "No results",
searchError = "Search error",
)options = io.github.aryapreetam.cmplocationpicker.ui.LocationPickerOptions(
searchLanguageTag = "en",
countryCodes = "in",
suggestionsLimit = 5
)On dialog start, v0 performs a best-effort IP-based lookup (default endpoint: https://ipapi.co/json/).
The default provider expects a JSON response containing latitude and longitude.
You can override or disable it:
ipLocationProvider = object : io.github.aryapreetam.cmplocationpicker.provider.IpLocationProvider {
override suspend fun getBestEffortLatLng(): io.github.aryapreetam.cmplocationpicker.model.LatLng =
io.github.aryapreetam.cmplocationpicker.model.LatLng(20.5937, 78.9629)
}You can also provide a custom MapProvider if you want different HTML/assets or to avoid remote CDNs.
The default v0 implementation may perform network requests to third parties:
https://ipapi.co/json/ (best-effort initial center)https://unpkg.com/... (Leaflet assets)https://{s}.basemaps.cartocdn.com/... (map tiles)https://nominatim.openstreetmap.org/search (search suggestions)If your app must not contact these services, provide your own IpLocationProvider and/or MapProvider.
If you ship the default v0 provider in production, make sure you comply with attribution requirements:
© OpenStreetMap contributors and © CARTO.From a checkout that includes the composite builds:
./gradlew :cmp-locationpicker:testDebugUnitTest./gradlew :sample:composeApp:jvmTest./gradlew :sample:androidApp:connectedAndroidTestThe Desktop WebView interop test is opt-in because it requires a real desktop UI environment:
CMP_LOCATIONPICKER_RUN_DESKTOP_IT=true ./gradlew :sample:composeApp:jvmTestDownload and try the sample app on your platform without building from source:
| Platform | Download Link |
|---|---|
| 🍏 macOS (Intel) | |
| 🍎 macOS (Apple Silicon) | |
| 🪟 Windows | |
| 🐧 Linux | |
| 🤖 Android | |
| 🌐 Web (Wasm) | |
| iOS Simulator |
For instructions on how to install and run the pre-built executables or build and run the sample application from source code, please refer to the How to Run the Sample App guide.
Automated WebView interop UI tests are currently not feasible on iOS/WASM (Compose interop container limitations). Use the checklist in Manual QA Checklist.
During development, this repo is typically used as a composite build alongside a local checkout of cmp-webview.
See settings.gradle.kts for the includeBuild("../cmp-webview") + dependency substitution setup.
MIT License © 2025 aryapreetam. See LICENSE for details.