SurfaceCallbackConfig
Central configuration object for MSDKSurfaceCallback.
Every opinionated behavior in the SurfaceCallback has a configurable parameter with a sensible default matching the standard navigation app behavior. Clients can customize any aspect without subclassing.
Design Principles
Defaults match standard behavior: Zero-config usage produces a working navigation experience.
Nullable = disableable: Setting a strategy/provider to null disables that behavior entirely.
Progressive disclosure: Simple use cases need minimal configuration; advanced customization is available but not required.
Usage
// Minimal config (all defaults)
val config = SurfaceCallbackConfig()
// Custom overlay + adjusted zoom
val config = SurfaceCallbackConfig(
overlayProvider = MySpeedLimitOverlayProvider(),
zoomButtonStep = 0.5,
zoomToRectInsets = ZoomToRectInsets(left = 0.15f, right = 0.15f)
)
// Disable gestures and vehicle repositioning
val config = SurfaceCallbackConfig(
gestureConfig = GestureConfig(scrollEnabled = false, scaleEnabled = false),
vehiclePositionStrategy = null
)See also
Constructors
Properties
Default zoom level used when centering the map on the cached initial position.
Configuration for gesture handling (pan, zoom, fling).
Maximum number of retry attempts for MapView creation.
Delay in milliseconds between MapView creation retry attempts.
Delay in milliseconds between Navigation.detachMapView() and MapView.onDestroy().
Maximum allowed zoom level for the map.
Custom overlay view provider for drawing on top of the MapView.
Strategy for positioning the vehicle icon on the map.
Zoom level change per zoom button tap (one full map tile level).
Fractional insets for fitting geographic bounding boxes within the visible area.