Documentation
Nakpath ships as a binary XCFramework (iOS) and an AAR (Android). A valid license key is required before the engine will animate.
CarAnimationKit; its types carry the CAK prefix. Binaries ship from a private GitHub repository — access comes with your license.Install
iOS 15+ — Swift Package Manager. In Xcode choose File → Add Package Dependencies and enter the repository URL (sign in with the GitHub account you gave at checkout), or add it to Package.swift:
.package(url: "https://github.com/AndroidPoet/CarAnimationKit", from: "1.0.0")
// Products: CarAnimationKit, CarAnimationAppleMapsAndroid (minSdk 24) — the repository carries a Maven folder. Clone it next to your project (or add it as a git submodule) and point Gradle at it:
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("../CarAnimationKit/android/maven") }
}
}
// app/build.gradle.kts
dependencies {
implementation("com.caranimation:kit:1.0.0")
// The map itself comes from Google's SDKs:
implementation("com.google.maps.android:maps-compose:6.4.1")
implementation("com.google.android.gms:play-services-maps:19.1.0")
}License
Initialize with your key once at launch, beforeany map or engine is created. The key is bound to your app's bundle ID / application ID and is checked on-device — no network call. Keep it out of committed source.
// iOS
import CarAnimationKit
CAKLicense.initialize(key: licenseKey)
// Android
import com.caranimation.kit.CarAnimationLicense
CarAnimationLicense.initialize(context, licenseKey)Live GPS tracking
The whole integration is one view. Hand it your stream of raw GPS fixes — Firebase, a websocket, MQTT, anything — and it draws the map with a car gliding between them. Engine, marker, camera-follow and teardown all live inside; the knobs and defaults are identical on both platforms.
// iOS — SwiftUI, Apple Maps
import CarAnimationKit
import CarAnimationAppleMaps
// driverLocations: AsyncStream<CLLocationCoordinate2D>
CAKCarTrackerMap(
locations: driverLocations,
carIcon: UIImage(named: "car"),
carSizeMeters: 7, // real-world size: scales with zoom
frameMeters: 250 // metres across to frame on the first fix
)
.ignoresSafeArea()// Android — Compose, Google Maps
import com.caranimation.kit.compose.CAKCarTrackerMap
// driverLocations: Flow<Coordinate>
CAKCarTrackerMap(
locations = driverLocations,
carIcon = carBitmap,
carSizeMeters = 7f,
frameMeters = 250.0,
modifier = Modifier.fillMaxSize()
)Google Maps on iOS: add the Sources-GoogleMaps folder from the SDK repository to your app target and use CAKGoogleCarTrackerMap — same parameters; call GMSServices.provideAPIKey(…) first.
Route playback
To drive cars along fixed polylines, use the engine directly.
// iOS
let engine = CAKAnimationEngine(
config: CAKAnimationConfig(baseDuration: 30, smoothingFactor: 0.15)
)
engine.loadRoutes([CAKRoute(id: 1, points: coordinates)])
engine.start()
@StateObject private var mapController = CAKMapController()
CAKAppleMapsView(engine: engine, controller: mapController)// Android
val engine = CarAnimationEngine(
config = AnimationConfig(baseDuration = 30.0, smoothingFactor = 0.15)
)
engine.loadRoutes(listOf(CarRoute(id = 1, points = coordinates)))
engine.start()
CAKMapView(engine = engine, carIcon = carBitmap)The SDK repository carries the full README and changelog. Questions? ranbir@androidpoet.dev