-
- All Implemented Interfaces:
public interface MapView
MapView 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 class
MapView.Companion
public interface
MapView.MapViewListener
MapViewListener class, use to receive the map view event
public final class
MapView.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 final class
MapView.MapViewData
The MapView data class
public interface
MapView.SnapshotReadyCallback
Interface for snapshot generation callback
-
Method Summary
Modifier and Type Method Description abstract Unit
initialize(@NonNull() MapViewInitConfig config)
Provide all important components to initialize the map and engine stuff. abstract MapSubView
createSubView(SubViewInitParams config)
This function creates a subview of the map. abstract Boolean
isFinishedLoading(Integer featureCategoryMask)
Check the engine initialization status for specified features abstract Unit
setOnCurrentRenderModeChangedListener(CurrentRenderModeChangeListener currentRenderModeChangeListener)
abstract Unit
setOnTargetRenderModeChangedListener(TargetRenderModeChangeListener targetRenderModeChangedListener)
abstract Unit
onPause()
Lifecycle hooks, call from owning fragment or activity abstract Unit
onResume()
Lifecycle hooks, call from owning fragment or activity abstract Unit
setFPS(Integer fps)
Set the preferred frames-per-second for the MapView renderer. abstract Boolean
setActiveGestures(Set<GestureType> activeGestures)
abstract Unit
setOnTouchListener(TouchListener listener)
Register touch event callback abstract Unit
setOnViewTouchListener(ViewTouchListener listener)
Register the touch listener abstract Unit
setOnAnnotationTouchListener(AnnotationTouchListener listener)
Register annotation touch event callback abstract Unit
setOnRouteTouchListener(RouteTouchListener listener)
Register route touch event callback abstract Unit
setOnPOITouchListener(POITouchListener poiTouchListener)
Register POI touch event callback abstract Unit
setOnMapElementTouchListener(MapElementTouchListener listener)
Register map element touch event callback abstract Unit
setOnStreetParkingTouchListener(OnStreetParkingTouchListener listener)
register the on-street parking touch listener abstract Unit
addMapViewListener(MapView.MapViewListener listener)
Register the mapView listener abstract Unit
removeMapViewListener(MapView.MapViewListener listener)
Remove the mapView listener abstract VehicleController
getVehicleController()
abstract RoutesController
getRoutesController()
abstract AnnotationsController
getAnnotationsController()
abstract CameraController
getCameraController()
abstract FeaturesController
getFeaturesController()
This method is used to return the object used to manipulate renderable features for the MapView FeaturesController abstract ShapesController
getShapesController()
This method is used to return the object used to manipulate API-fed shape data for rendering on the MapView ShapesController abstract ThemeController
getThemeController()
abstract LayoutController
getLayoutController()
abstract OnStreetParkingController
getOnStreetParkingController()
This method is used to return the object used to manipulate the on street parking of the MapView OnStreetParkingController abstract SearchController
getSearchController()
abstract MapDiagnosis
mapDiagnosis()
abstract Unit
generateSnapshot(MapView.SnapshotReadyCallback callback)
abstract Unit
generateOffscreenSnapshot(OffscreenSnapshotInitParams config)
It generates an offscreen snapshot of the current page. Integer
getViewWidth()
Integer
getViewHeight()
Unit
onDestroy()
-
-
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
-
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
-
-
-
-