-
- All Implemented Interfaces:
public interface MapViewMapView is our primary class to show Map and Navigation information on the map. Beside the basic map/traffic functionality, there are: * Annotation Rendering, which can be used to show point of interest on map * Vehicle rendering and follow Vehicle Camera * Copyright reserved by telenav 2020.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMapView.MapViewListenerMapViewListener class, use to receive the map view event
public classMapView.MapViewException* MapView Exception class, which will be throw if anything unexpected happened around map view operation. Such as: remove non-existing annotation, change the zoom level to unsupported number
public classMapView.MapViewDataThe MapView data class
public interfaceMapView.SnapshotReadyCallback* Interface for snapshot generation callback
-
Method Summary
Modifier and Type Method Description abstract voidinitialize(@NonNull() MapViewInitConfig config)Provide all important components to initialize the map and engine stuff. abstract MapSubViewcreateSubView(@NonNull() SubViewInitParams config)This function creates a subview of the map. abstract booleanisFinishedLoading(int featureCategoryMask)Check the engine initialization status for specified features abstract voidsetOnCurrentRenderModeChangedListener(@Nullable() CurrentRenderModeChangeListener currentRenderModeChangeListener)* sets the listener for the current rendering mode changes(between 2D and 3D) abstract voidsetOnTargetRenderModeChangedListener(@Nullable() TargetRenderModeChangeListener targetRenderModeChangedListener)* sets the listener for the target rendering mode changes(between 2D and 3D) abstract voidonPause()Lifecycle hooks, call from owning fragment or activity abstract voidonResume()Lifecycle hooks, call from owning fragment or activity abstract voidsetFPS(int fps)Set the preferred frames-per-second for the MapView renderer. abstract voidsetActiveGestures(@Nullable() Set<GestureType> activeGestures)* Set active gestures for the view. abstract voidsetOnTouchListener(@NonNull() TouchListener listener)Register touch event callback abstract voidsetOnViewTouchListener(@Nullable() ViewTouchListener listener)Register the touch listener abstract voidsetOnAnnotationTouchListener(@Nullable() AnnotationTouchListener listener)Register annotation touch event callback abstract voidsetOnRouteTouchListener(@Nullable() RouteTouchListener listener)Register route touch event callback abstract voidsetOnPOITouchListener(@Nullable() POITouchListener poiTouchListener)Register POI touch event callback abstract voidsetOnMapElementTouchListener(@Nullable() MapElementTouchListener listener)Register map element touch event callback abstract voidaddMapViewListener(@NonNull() MapView.MapViewListener listener)Register the mapView listener abstract voidremoveMapViewListener(@NonNull() MapView.MapViewListener listener)Remove the mapView listener abstract VehicleControllervehicleController()* Warning! abstract RoutesControllerroutesController()* Warning! abstract AnnotationsControllerannotationsController()* Warning! abstract CameraControllercameraController()* Warning! abstract FeaturesControllerfeaturesController()Warning! abstract ShapesControllershapesController()Warning! abstract ThemeControllerthemeController()* Warning! abstract LayoutControllerlayoutController()* Warning! abstract SearchControllersearchController()* Warning! abstract MapDiagnosismapDiagnosis()* This method is used to return the object used to diagnose MapView abstract voidgenerateSnapshot(@NonNull() MapView.SnapshotReadyCallback callback)* Generate a bitmap image of the MapView abstract voidgenerateOffscreenSnapshot(@NonNull() OffscreenSnapshotInitParams config)It generates an offscreen snapshot of the current page. -
-
Method Detail
-
initialize
@MainThread() abstract void initialize(@NonNull() 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 a `MapView`.
-
createSubView
@Nullable() abstract MapSubView createSubView(@NonNull() SubViewInitParams config)
This function creates a subview of the map.
- Parameters:
config- SubViewInitConfig
-
isFinishedLoading
abstract boolean isFinishedLoading(int featureCategoryMask)
Check the engine initialization status for specified features
- Parameters:
featureCategoryMask- represents the features of the render engine that are required to be loaded(features are describe above)
-
setOnCurrentRenderModeChangedListener
abstract void setOnCurrentRenderModeChangedListener(@Nullable() 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
abstract void setOnTargetRenderModeChangedListener(@Nullable() 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
-
onPause
abstract void onPause()
Lifecycle hooks, call from owning fragment or activity
-
onResume
abstract void onResume()
Lifecycle hooks, call from owning fragment or activity
-
setFPS
abstract void setFPS(int fps)
Set the preferred frames-per-second for the MapView renderer. Current default is 30fps
- Parameters:
fps- the preferred frames-per-second
-
setActiveGestures
abstract void setActiveGestures(@Nullable() Set<GestureType> activeGestures)
* Set active gestures for the view. An empty or null list will turn off all gestures. All gestures are enabled by default.
- Parameters:
activeGestures- the gestures that will be active on the view GestureType
-
setOnTouchListener
abstract void setOnTouchListener(@NonNull() TouchListener listener)
Register touch event callback
- Parameters:
listener- The press event listener TouchListener
-
setOnViewTouchListener
abstract void setOnViewTouchListener(@Nullable() ViewTouchListener listener)
Register the touch listener
- Parameters:
listener- The touch listener ViewTouchListener
-
setOnAnnotationTouchListener
abstract void setOnAnnotationTouchListener(@Nullable() AnnotationTouchListener listener)
Register annotation touch event callback
- Parameters:
listener- The annotation press event listener AnnotationTouchListener
-
setOnRouteTouchListener
abstract void setOnRouteTouchListener(@Nullable() RouteTouchListener listener)
Register route touch event callback
- Parameters:
listener- The route press event listener RouteTouchListener
-
setOnPOITouchListener
abstract void setOnPOITouchListener(@Nullable() POITouchListener poiTouchListener)
Register POI touch event callback
- Parameters:
poiTouchListener- The POI press event listener POITouchListener
-
setOnMapElementTouchListener
abstract void setOnMapElementTouchListener(@Nullable() MapElementTouchListener listener)
Register map element touch event callback
- Parameters:
listener- The map element press event listener MapElementTouchListener
-
addMapViewListener
abstract void addMapViewListener(@NonNull() MapView.MapViewListener listener)
Register the mapView listener
- Parameters:
listener- The mapView listener MapViewListener
-
removeMapViewListener
abstract void removeMapViewListener(@NonNull() MapView.MapViewListener listener)
Remove the mapView listener
- Parameters:
listener- The mapThe mapView listener MapViewListener
-
vehicleController
abstract VehicleController vehicleController()
* Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate the vehicle representation for the MapView VehicleController
-
routesController
abstract RoutesController routesController()
* Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate routes for the MapView RoutesController
-
annotationsController
abstract AnnotationsController annotationsController()
* Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate annotations for the MapView AnnotationsController
-
cameraController
abstract CameraController cameraController()
* Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate the point of focus for the MapView CameraController
-
featuresController
abstract FeaturesController featuresController()
Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate renderable features for the MapView FeaturesController
-
shapesController
abstract ShapesController shapesController()
Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate API-fed shape data for rendering on the MapView ShapesController
-
themeController
abstract ThemeController themeController()
* Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate the MapView theme ThemeController
-
layoutController
abstract LayoutController layoutController()
* Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to manipulate the layout of the MapView LayoutController
-
searchController
abstract SearchController searchController()
* Warning! Using Controllers before the MapViewReadyListener notification will result in a crash This method is used to return the object used to show POI on MapView. TnMapSubView is not supported this function. SearchController
-
mapDiagnosis
abstract MapDiagnosis mapDiagnosis()
* This method is used to return the object used to diagnose MapView
-
generateSnapshot
abstract void generateSnapshot(@NonNull() MapView.SnapshotReadyCallback callback)
* Generate a bitmap image of the MapView
- Parameters:
callback- callback to receive bitmap
-
generateOffscreenSnapshot
abstract void generateOffscreenSnapshot(@NonNull() OffscreenSnapshotInitParams config)
It generates an offscreen snapshot of the current page. NOTE: Only call from the parent MapView, not from children MapSubViews. Calling from a MapSubView will result in a no-op and null MapSubView returned NOTE: The client is not responsible for closing out the resulting MapSubView, it is only returned for styling purposes if the client has passed in a readyListener
- Parameters:
config- OffscreenSnapshotInitConfig
-
-
-
-