/tripkit/TripKitAndroidUI/com.skedgo.tripkit.ui.utils/MapUtils
MapUtils
\ object MapUtils
Functions
Name | Summary |
---|---|
animateMarkerToPosition | fun animateMarkerToPosition(marker: Marker, toPosition: LatLng, duration: Long = 1000) Animates a marker from its current position to a target position. |
animatePulseOverlay | fun animatePulseOverlay(overlay: GroundOverlay?, zoomLevel: Float, baseMinSize: Float = 150.0f, baseMaxSize: Float = 350.0f, duration: Long = 2500) Animates a GroundOverlay to create a pulsing effect by changing its dimensions. |
calculateAgeFactor | fun calculateAgeFactor(ageInSeconds: Long, startFadeDuration: Int = 120, maxFadeDuration: Int = 180): Float Calculates the age factor based on the elapsed time. |
calculateFadeFromAgeFactor | fun calculateFadeFromAgeFactor(ageFactor: Float, minFade: Float = 0.3f): Float Calculates the fade level based on the age factor. |
formatElapsedTime | fun formatElapsedTime(ageInSeconds: Long, vehicle: RealTimeVehicle? = null): String Formats elapsed time into a human-readable string (e.g., "15 seconds ago" or "1 minute and 15 seconds ago"). |
getBitmapFromDrawable | fun getBitmapFromDrawable(context: Context, drawableRes: Int, width: Int, height: Int, color: Int): Bitmap Converts a drawable resource to a bitmap with specified width, height, and color. |
hidePulseOverlay | fun hidePulseOverlay(overlay: GroundOverlay?, duration: Long = 500) Animates hiding of a GroundOverlay by fading out and then removing it. |
updateMarkerOpacity | fun updateMarkerOpacity(marker: Marker?, fadeLevel: Float) Updates the marker's opacity based on the fade level. |
updateOverlayTransparency | fun updateOverlayTransparency(overlay: GroundOverlay?, fadeLevel: Float) Updates the overlay's transparency based directly on the fade level. |