-
- All Implemented Interfaces:
-
androidx.car.app.SurfaceCallback,com.telenav.map.api.MapView
public final class TnAAOSMapView implements MapView, SurfaceCallback
Implementation of a MapView for Android Automotive OS.
Usage - todo
Copyright reserved by Telenav 2022.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classTnAAOSMapView.Companion
-
Constructor Summary
Constructors Constructor Description TnAAOSMapView(Context context, AAOSMapViewInitParams mapViewInitParams)TnAAOSMapView(Context context)
-
Method Summary
Modifier and Type Method Description final ContextgetContext()UnitonSurfaceAvailable(SurfaceContainer surfaceContainer)UnitonSurfaceDestroyed(SurfaceContainer surfaceContainer)UnitonStableAreaChanged(Rect stableArea)UnitonVisibleAreaChanged(Rect visibleArea)UnitonClick(Float x, Float y)UnitonFling(Float velocityX, Float velocityY)UnitonScale(Float focusX, Float focusY, Float scaleFactor)UnitonScroll(Float distanceX, Float distanceY)Unitinitialize(MapViewInitConfig config)Provide all important components to initialize the map and engine stuff. MapSubViewcreateSubView(SubViewInitParams config)This function creates a subview of the map. BooleanisFinishedLoading(Integer featureCategoryMask)Method to check if the map has finished loading the specified feature categories UnitsetOnCurrentRenderModeChangedListener(CurrentRenderModeChangeListener currentRenderModeChangeListener)sets the listener for the current rendering mode changes(between 2D and 3D) UnitsetOnTargetRenderModeChangedListener(TargetRenderModeChangeListener targetRenderModeChangedListener)sets the listener for the target rendering mode changes(between 2D and 3D) UnitonPause()Lifecycle hooks, call from owning Session UnitonResume()Lifecycle hooks, call from owning Session UnitsetFPS(Integer fps)Set the preferred frames-per-second for the MapView renderer. BooleansetActiveGestures(Set<GestureType> activeGestures)Set active gestures for the view. UnitsetOnTouchListener(TouchListener listener)Register touch event callback UnitsetOnViewTouchListener(ViewTouchListener listener)It sets the listener for the touch events on the map. UnitsetOnAnnotationTouchListener(AnnotationTouchListener listener)Sets the listener for annotation touch events. UnitsetOnRouteTouchListener(RouteTouchListener listener)Sets a listener for the route touch event. UnitsetOnPOITouchListener(POITouchListener poiTouchListener)Register POI touch event callback UnitsetOnMapElementTouchListener(MapElementTouchListener listener)Register map element touch event callback UnitsetOnStreetParkingTouchListener(OnStreetParkingTouchListener listener)register the on-street parking touch listener UnitaddMapViewListener(MapView.MapViewListener listener)Register the mapView listener UnitremoveMapViewListener(MapView.MapViewListener listener)Remove the mapView listener VehicleControllergetVehicleController()This method is used to return the object used to manipulate the vehicle representation for the MapView VehicleController RoutesControllergetRoutesController()This method is used to return the object used to manipulate routes for the MapView RoutesController AnnotationsControllergetAnnotationsController()The is method is used to return the object used to manipulate annotations for the MapView AnnotationsController CameraControllergetCameraController()This method is used to return the object used to manipulate the point of focus for the MapView CameraController FeaturesControllergetFeaturesController()This method is used to return the object used to manipulate renderable features for the MapView FeaturesController ShapesControllergetShapesController()This method is used to return the object used to manipulate API-fed shape data for rendering on the MapView ShapesController ThemeControllergetThemeController()This method is used to return the object used to manipulate the MapView theme ThemeController LayoutControllergetLayoutController()This method is used to return the object used to manipulate the layout of the MapView LayoutController OnStreetParkingControllergetOnStreetParkingController()This method is used to return the object used to manipulate the on street parking of the MapView OnStreetParkingController SearchControllergetSearchController()This method is used to return the object used to show POI on MapView SearchController DynamicPOISearchControllergetDynamicPOISearchController()This method is used to return the object used to search POI dynamically on MapView DynamicPOISearchController MapDiagnosismapDiagnosis()This method is used to return the object used to diagnose MapView UnitgenerateSnapshot(MapView.SnapshotReadyCallback callback)UnitgenerateOffscreenSnapshot(OffscreenSnapshotInitParams config)It generates an offscreen snapshot of the current page. IntegergetViewWidth()Returns the width of the current surface, obtained from SurfaceContainer IntegergetViewHeight()Returns the height of the current surface, obtained from SurfaceContainer -
-
Constructor Detail
-
TnAAOSMapView
TnAAOSMapView(Context context, AAOSMapViewInitParams mapViewInitParams)
-
TnAAOSMapView
TnAAOSMapView(Context context)
-
-
Method Detail
-
getContext
final Context getContext()
-
onSurfaceAvailable
Unit onSurfaceAvailable(SurfaceContainer surfaceContainer)
-
onSurfaceDestroyed
Unit onSurfaceDestroyed(SurfaceContainer surfaceContainer)
-
onStableAreaChanged
Unit onStableAreaChanged(Rect stableArea)
-
onVisibleAreaChanged
Unit onVisibleAreaChanged(Rect visibleArea)
-
initialize
Unit initialize(MapViewInitConfig config)
Provide all important components to initialize the map and engine stuff.
- Parameters:
config- is a data class that holds the context, dpi, default location, and ready listener for aMapView.
-
createSubView
MapSubView createSubView(SubViewInitParams config)
This function creates a subview of the map.
- Parameters:
config- SubViewInitConfig
-
isFinishedLoading
Boolean isFinishedLoading(Integer featureCategoryMask)
Method to check if the map has finished loading the specified feature categories
- Parameters:
featureCategoryMask- The feature category mask.
-
setOnCurrentRenderModeChangedListener
Unit setOnCurrentRenderModeChangedListener(CurrentRenderModeChangeListener currentRenderModeChangeListener)
sets the listener for the current rendering mode changes(between 2D and 3D)
- Parameters:
currentRenderModeChangeListener- the listener that will be used to notify the change
-
setOnTargetRenderModeChangedListener
Unit setOnTargetRenderModeChangedListener(TargetRenderModeChangeListener targetRenderModeChangedListener)
sets the listener for the target rendering mode changes(between 2D and 3D)
- Parameters:
targetRenderModeChangedListener- the listener that will be used to notify the change
-
setFPS
Unit setFPS(Integer fps)
Set the preferred frames-per-second for the MapView renderer. Current default is 30fps
- Parameters:
fps- the preferred frames-per-second
-
setActiveGestures
Boolean setActiveGestures(Set<GestureType> activeGestures)
Set active gestures for the view. An empty or null list will turn off all gestures.
- Parameters:
activeGestures- the gestures that will be active on the view
-
setOnTouchListener
Unit setOnTouchListener(TouchListener listener)
Register touch event callback
- Parameters:
listener- The press event listener TouchListener
-
setOnViewTouchListener
Unit setOnViewTouchListener(ViewTouchListener listener)
It sets the listener for the touch events on the map.
- Parameters:
listener- ViewTouchListener?
-
setOnAnnotationTouchListener
Unit setOnAnnotationTouchListener(AnnotationTouchListener listener)
Sets the listener for annotation touch events.
- Parameters:
listener- The listener to be set.
-
setOnRouteTouchListener
Unit setOnRouteTouchListener(RouteTouchListener listener)
Sets a listener for the route touch event.
- Parameters:
listener- The listener to be set.
-
setOnPOITouchListener
Unit setOnPOITouchListener(POITouchListener poiTouchListener)
Register POI touch event callback
- Parameters:
poiTouchListener- The POI press event listener POITouchListener
-
setOnMapElementTouchListener
Unit setOnMapElementTouchListener(MapElementTouchListener listener)
Register map element touch event callback
- Parameters:
listener- The map element press event listener MapElementTouchListener
-
setOnStreetParkingTouchListener
Unit setOnStreetParkingTouchListener(OnStreetParkingTouchListener listener)
register the on-street parking touch listener
- Parameters:
listener- the on-street parking press event listener OnStreetParkingTouchListener
-
addMapViewListener
Unit addMapViewListener(MapView.MapViewListener listener)
Register the mapView listener
- Parameters:
listener- The mapView listener MapViewListener
-
removeMapViewListener
Unit removeMapViewListener(MapView.MapViewListener listener)
Remove the mapView listener
- Parameters:
listener- The mapView listener MapViewListener
-
getVehicleController
VehicleController getVehicleController()
This method is used to return the object used to manipulate the vehicle representation for the MapView VehicleController
-
getRoutesController
RoutesController getRoutesController()
This method is used to return the object used to manipulate routes for the MapView RoutesController
-
getAnnotationsController
AnnotationsController getAnnotationsController()
The is method is used to return the object used to manipulate annotations for the MapView AnnotationsController
-
getCameraController
CameraController getCameraController()
This method is used to return the object used to manipulate the point of focus for the MapView CameraController
-
getFeaturesController
FeaturesController getFeaturesController()
This method is used to return the object used to manipulate renderable features for the MapView FeaturesController
-
getShapesController
ShapesController getShapesController()
This method is used to return the object used to manipulate API-fed shape data for rendering on the MapView ShapesController
-
getThemeController
ThemeController getThemeController()
This method is used to return the object used to manipulate the MapView theme ThemeController
-
getLayoutController
LayoutController getLayoutController()
This method is used to return the object used to manipulate the layout of the MapView LayoutController
-
getOnStreetParkingController
OnStreetParkingController getOnStreetParkingController()
This method is used to return the object used to manipulate the on street parking of the MapView OnStreetParkingController
-
getSearchController
SearchController getSearchController()
This method is used to return the object used to show POI on MapView SearchController
-
getDynamicPOISearchController
DynamicPOISearchController getDynamicPOISearchController()
This method is used to return the object used to search POI dynamically on MapView DynamicPOISearchController
-
mapDiagnosis
MapDiagnosis mapDiagnosis()
This method is used to return the object used to diagnose MapView
-
generateSnapshot
Unit generateSnapshot(MapView.SnapshotReadyCallback callback)
Generate a bitmap image of the MapView
- Parameters:
callback- callback to receive bitmap
-
generateOffscreenSnapshot
Unit generateOffscreenSnapshot(OffscreenSnapshotInitParams config)
It generates an offscreen snapshot of the current page.
- Parameters:
config- OffscreenSnapshotInitConfig
-
getViewWidth
Integer getViewWidth()
Returns the width of the current surface, obtained from SurfaceContainer
-
getViewHeight
Integer getViewHeight()
Returns the height of the current surface, obtained from SurfaceContainer
-
-
-
-