core-globe

A standalone Kotlin Multiplatform library that renders an interactive 3D globe inside a WebView using Three.js. Exposes a single GlobeView composable that any Android app can drop in.
Screenshots
Features
Usage
GlobeView(
markers = listOf(
GlobeMarker(id = "sfo", lat = 37.77, lng = -122.41, style = MarkerStyle.Current),
GlobeMarker(id = "tyo", lat = 35.68, lng = 139.69, style = MarkerStyle.Destination),
GlobeMarker(id = "hnl", lat = 21.30, lng = -157.85, style = MarkerStyle.Destination),
),
arcs = listOf(
GlobeArc(
from = Coordinates(, -),
to = Coordinates(, ),
)
),
onMarkerTapped = { marker -> Log.d(, ) },
modifier = Modifier.fillMaxSize()
)
Configuration
GlobeView(
config = GlobeConfig(
globeColor = "#0C1E3C",
gridColor = "#142D62",
atmosphereColor = "#1A4088",
currentDotColor = "#4A9EFF",
destinationDotColor = "#F5A623",
arcColor = "#4A9EFF",
backgroundColor = "#020B18",
showGrid = true,
showAtmosphere = ,
showStars = ,
showBorders = ,
borderColor = ,
autoRotate = ,
autoRotateSpeed = ,
cameraDistance = ,
)
)
Setup
Maven Central (recommended)
Add the dependency to your app module:
dependencies {
implementation("io.github.advait8:core-globe-android:0.1.0")
}
Make sure mavenCentral() is in your repository list (it is by default in new projects):
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
}
}
Local module
include(":core-globe")
dependencies {
implementation(project(":core-globe"))
}
Add internet permission if loading anything remotely, and hardware acceleration on the Activity (required for WebView WebGL):
<activity
android:name=".MainActivity"
android:hardwareAccelerated="true" />
Stack
V2 Roadmap
flyTo(Coordinates) — animated camera rotation to a target
- iOS actual (
WKWebView) — expect/actual skeleton already in place
- Arc
animationProgress — animated draw-on effect
- Cluster markers at high zoom-out