-
- 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 classMapView.Companionpublic interfaceMapView.MapViewListenerMapViewListener class, use to receive the map view event
public final classMapView.MapViewExceptionMapView 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 final classMapView.MapViewDataThe MapView data class
public interfaceMapView.SnapshotReadyCallbackInterface for snapshot generation callback
-
Method Summary
Modifier and Type Method Description abstract Unitinitialize(@NonNull() MapViewInitConfig config)Provide all important components to initialize the map and engine stuff. abstract MapSubViewcreateSubView(SubViewInitParams config)This function creates a subview of the map. abstract BooleanisFinishedLoading(Integer featureCategoryMask)Check the engine initialization status for specified features abstract UnitsetOnCurrentRenderModeChangedListener(CurrentRenderModeChangeListener currentRenderModeChangeListener)abstract UnitsetOnTargetRenderModeChangedListener(TargetRenderModeChangeListener targetRenderModeChangedListener)abstract UnitonPause()Lifecycle hooks, call from owning fragment or activity abstract UnitonResume()Lifecycle hooks, call from owning fragment or activity abstract UnitsetFPS(Integer fps)Set the preferred frames-per-second for the MapView renderer. abstract BooleansetActiveGestures(Set<GestureType> activeGestures)abstract UnitsetOnTouchListener(TouchListener listener)Register touch event callback abstract UnitsetOnViewTouchListener(ViewTouchListener listener)Register the touch listener abstract UnitsetOnAnnotationTouchListener(AnnotationTouchListener listener)Register annotation touch event callback abstract UnitsetOnRouteTouchListener(RouteTouchListener listener)Register route touch event callback abstract UnitsetOnPOITouchListener(POITouchListener poiTouchListener)Register POI touch event callback abstract UnitsetOnMapElementTouchListener(MapElementTouchListener listener)Register map element touch event callback abstract UnitsetOnStreetParkingTouchListener(OnStreetParkingTouchListener listener)register the on-street parking touch listener abstract UnitaddMapViewListener(MapView.MapViewListener listener)Register the mapView listener abstract UnitremoveMapViewListener(MapView.MapViewListener listener)Remove the mapView listener abstract VehicleControllergetVehicleController()abstract RoutesControllergetRoutesController()abstract AnnotationsControllergetAnnotationsController()abstract CameraControllergetCameraController()abstract FeaturesControllergetFeaturesController()This method is used to return the object used to manipulate renderable features for the MapView FeaturesController abstract ShapesControllergetShapesController()This method is used to return the object used to manipulate API-fed shape data for rendering on the MapView ShapesController abstract ThemeControllergetThemeController()abstract LayoutControllergetLayoutController()abstract OnStreetParkingControllergetOnStreetParkingController()This method is used to return the object used to manipulate the on street parking of the MapView OnStreetParkingController abstract SearchControllergetSearchController()abstract DynamicPOISearchControllergetDynamicPOISearchController()This method is used to return the object used to manipulate dynamic POI search on MapView. abstract MapDiagnosismapDiagnosis()abstract UnitgenerateSnapshot(MapView.SnapshotReadyCallback callback)abstract UnitgenerateOffscreenSnapshot(OffscreenSnapshotInitParams config)It generates an offscreen snapshot of the current page. IntegergetViewWidth()IntegergetViewHeight()UnitonDestroy()-
-
Method Detail
-
initialize
@MainThread() abstract Unit 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 aMapView.
-
createSubView
abstract MapSubView createSubView(SubViewInitParams config)
This function creates a subview of the map.
- Parameters:
config- SubViewInitConfig
-
isFinishedLoading
abstract Boolean isFinishedLoading(Integer 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 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
abstract 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
abstract 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
abstract Boolean setActiveGestures(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 Unit setOnTouchListener(TouchListener listener)
Register touch event callback
- Parameters:
listener- The press event listener TouchListener
-
setOnViewTouchListener
abstract Unit setOnViewTouchListener(ViewTouchListener listener)
Register the touch listener
- Parameters:
listener- The touch listener ViewTouchListener
-
setOnAnnotationTouchListener
abstract Unit setOnAnnotationTouchListener(AnnotationTouchListener listener)
Register annotation touch event callback
- Parameters:
listener- The annotation press event listener AnnotationTouchListener
-
setOnRouteTouchListener
abstract Unit setOnRouteTouchListener(RouteTouchListener listener)
Register route touch event callback
- Parameters:
listener- The route press event listener RouteTouchListener
-
setOnPOITouchListener
abstract Unit setOnPOITouchListener(POITouchListener poiTouchListener)
Register POI touch event callback
- Parameters:
poiTouchListener- The POI press event listener POITouchListener
-
setOnMapElementTouchListener
abstract Unit setOnMapElementTouchListener(MapElementTouchListener listener)
Register map element touch event callback
- Parameters:
listener- The map element press event listener MapElementTouchListener
-
setOnStreetParkingTouchListener
abstract Unit setOnStreetParkingTouchListener(OnStreetParkingTouchListener listener)
register the on-street parking touch listener
- Parameters:
listener- the on-street parking press event listener OnStreetParkingTouchListener
-
addMapViewListener
abstract Unit addMapViewListener(MapView.MapViewListener listener)
Register the mapView listener
- Parameters:
listener- The mapView listener MapViewListener
-
removeMapViewListener
abstract Unit removeMapViewListener(MapView.MapViewListener listener)
Remove the mapView listener
- Parameters:
listener- The mapThe mapView listener MapViewListener
-
getVehicleController
abstract VehicleController getVehicleController()
This method is used to return the object used to manipulate the vehicle representation for the MapView VehicleController
-
getRoutesController
abstract RoutesController getRoutesController()
This method is used to return the object used to manipulate routes for the MapView RoutesController
-
getAnnotationsController
abstract AnnotationsController getAnnotationsController()
This method is used to return the object used to manipulate annotations for the MapView AnnotationsController
-
getCameraController
abstract CameraController getCameraController()
This method is used to return the object used to manipulate the point of focus for the MapView CameraController
-
getFeaturesController
abstract FeaturesController getFeaturesController()
This method is used to return the object used to manipulate renderable features for the MapView FeaturesController
-
getShapesController
abstract ShapesController getShapesController()
This method is used to return the object used to manipulate API-fed shape data for rendering on the MapView ShapesController
-
getThemeController
abstract ThemeController getThemeController()
This method is used to return the object used to manipulate the MapView theme ThemeController
-
getLayoutController
abstract LayoutController getLayoutController()
This method is used to return the object used to manipulate the layout of the MapView LayoutController
-
getOnStreetParkingController
abstract OnStreetParkingController getOnStreetParkingController()
This method is used to return the object used to manipulate the on street parking of the MapView OnStreetParkingController
-
getSearchController
abstract SearchController getSearchController()
This method is used to return the object used to show POI on MapView. TnMapSubView is not supported this function. SearchController
-
getDynamicPOISearchController
abstract DynamicPOISearchController getDynamicPOISearchController()
This method is used to return the object used to manipulate dynamic POI search on MapView.
-
mapDiagnosis
abstract MapDiagnosis mapDiagnosis()
This method is used to return the object used to diagnose MapView
-
generateSnapshot
abstract Unit generateSnapshot(MapView.SnapshotReadyCallback callback)
Generate a bitmap image of the MapView
- Parameters:
callback- callback to receive bitmap
-
generateOffscreenSnapshot
abstract Unit generateOffscreenSnapshot(OffscreenSnapshotInitParams config)
It generates an offscreen snapshot of the current page.
- Parameters:
config- OffscreenSnapshotInitConfig
-
getViewWidth
Integer getViewWidth()
Returns current MapView's width
-
getViewHeight
Integer getViewHeight()
Returns current MapView's height
-
-
-
-