
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.
v0 implementation:
LatLng only (no structured address yet)Add the dependency (replace version as needed):
implementation("io.github.aryapreetam:cmp-locationpicker:0.0.2")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…",
)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}.tile.openstreetmap.org/... (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.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 |
Option 1: Drag and Drop
Option 2: ADB Install
adb install sample-app-android-unsigned.apksample-app-wasm.zip
index.html in a web browserNote: You can also try the live demo without downloading: Try Live Demo
sample-app-ios-simulator.zip from the latest release
sample-app-ios-simulator.app
.app onto the Simulator window OR run:
xcrun simctl install booted /path/to/sample-app-ios-simulator.appDownload the DMG for your Mac architecture (Intel or Apple Silicon)
Open (mount) the DMG and drag the app to your Applications folder (or Desktop)
When you try to open the app for the first time, macOS Gatekeeper will block it since it is an open-source build signed ad-hoc (not using a paid Apple Developer account). Follow these 6 sequential steps to allow running the app:
1. Block Alert Dialog
|
2. Open System Settings
|
3. Privacy & Security Section
|
4. Click "Open Anyway"
|
5. Authenticate Security Dialog
|
6. Click "Open" to Launch
|
To allow running the app:
This is a normal security step for all open-source and CI-generated Mac executables. Apps are signed ad-hoc for internal/dev use, not with a public Apple developer ID.
Tip: Unsure about your Mac's type? Click the Apple logo → "About This Mac". If it says Intel, download x64; if it says M1, M2, or M3, download arm64.
.deb filesudo dpkg -i sample-app-linux.debsample in the terminal!Automated WebView interop UI tests are currently not feasible on iOS/WASM (Compose interop container limitations).
Use the checklist in docs/manual-qa.md.
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. See LICENSE.
Location picker dialog for Compose Multiplatform (Android / iOS / Desktop / Web) built on top of cmp-webview.
v0 implementation:
LatLng only (no structured address yet)Add the dependency (replace version as needed):
implementation("io.github.aryapreetam:cmp-locationpicker:0.0.2")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…",
)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}.tile.openstreetmap.org/... (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.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 |
Option 1: Drag and Drop
Option 2: ADB Install
adb install sample-app-android-unsigned.apksample-app-wasm.zip
index.html in a web browserNote: You can also try the live demo without downloading: Try Live Demo
sample-app-ios-simulator.zip from the latest release
sample-app-ios-simulator.app
.app onto the Simulator window OR run:
xcrun simctl install booted /path/to/sample-app-ios-simulator.appDownload the DMG for your Mac architecture (Intel or Apple Silicon)
Open (mount) the DMG and drag the app to your Applications folder (or Desktop)
When you try to open the app for the first time, macOS Gatekeeper will block it since it is an open-source build signed ad-hoc (not using a paid Apple Developer account). Follow these 6 sequential steps to allow running the app:
1. Block Alert Dialog
|
2. Open System Settings
|
3. Privacy & Security Section
|
4. Click "Open Anyway"
|
5. Authenticate Security Dialog
|
6. Click "Open" to Launch
|
To allow running the app:
This is a normal security step for all open-source and CI-generated Mac executables. Apps are signed ad-hoc for internal/dev use, not with a public Apple developer ID.
Tip: Unsure about your Mac's type? Click the Apple logo → "About This Mac". If it says Intel, download x64; if it says M1, M2, or M3, download arm64.
.deb filesudo dpkg -i sample-app-linux.debsample in the terminal!Automated WebView interop UI tests are currently not feasible on iOS/WASM (Compose interop container limitations).
Use the checklist in docs/manual-qa.md.
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. See LICENSE.