-
- All Implemented Interfaces:
-
com.telenav.map.api.ClusterMapView,com.telenav.map.api.MapTouchListeners
public final class TnClusterMapView implements ClusterMapView, MapTouchListeners
ClusterMapView is the interface for displaying map information on cluster device. It supports basic map/traffic functions, such as annotation rendering, vehicle rendering or traffic rendering.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classTnClusterMapView.Companion
-
Constructor Summary
Constructors Constructor Description TnClusterMapView()
-
Method Summary
Modifier and Type Method Description Unitinitialize(ClusterMapViewParams clusterMapViewParams)Initialize the map view with the given parameters BooleanisFinishedLoading(Integer featureCategoryMask)Lifecycle hooks, call this api when surface is first created. UnitonSurfaceCreated()Lifecycle hooks, call to pause the cluster view rendering UnitonSurfaceChanged(Integer width, Integer height)Lifecycle hooks, call to resume the cluster view rendering UnitonSurfaceChanged(Surface surface, Integer width, Integer height)Lifecycle hooks, call to destroy the cluster view instance UnitonSurfaceDestroyed()Set the preferred frames-per-second for the cluster map view renderer. UnitonPause()Register the mapView listener UnitonResume()Remove the mapView listener UnitonDestroy()Warning! UnitsetFPS(Integer fps)Warning! UnitaddMapViewListener(MapView.MapViewListener listener)Warning! UnitremoveMapViewListener(MapView.MapViewListener listener)Warning! TnVehicleControllervehicleController()Warning! TnRoutesControllerroutesController()Warning! TnAnnotationsControllerannotationsController()Warning! TnCameraControllercameraController()Warning! TnFeaturesControllerfeaturesController()This method is used to return the object used to diagnose ClusterMapView TnShapesControllershapesController()Please avoid do some heavy action here, it will block map render thread or build thread TnThemeControllerthemeController()to check the zoom level change TnLayoutControllerlayoutController()Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate the layout of the ClusterMapView {@link LayoutController} MapDiagnosismapDiagnosis()This is not supported for cluster map view MapGestureProvidergestureProvider()to check the mapframe update UnitsetOnTouchListener(TouchListener listener)Sets the touch listener on this view. UnitsetOnViewTouchListener(ViewTouchListener listener)Sets the view touch listener on this view. UnitsetOnAnnotationTouchListener(AnnotationTouchListener listener)Sets the annotation touch listener on this view. UnitsetOnRouteTouchListener(RouteTouchListener listener)Sets the route touch listener on this view. UnitsetOnPOITouchListener(POITouchListener poiTouchListener)Register POI touch event callback UnitsetOnMapElementTouchListener(MapElementTouchListener listener)Sets the map element touch listener on this view. UnitsetOnStreetParkingTouchListener(OnStreetParkingTouchListener listener)Sets the street parking touch listener on this view. -
-
Method Detail
-
initialize
Unit initialize(ClusterMapViewParams clusterMapViewParams)
Initialize the map view with the given parameters
- Parameters:
clusterMapViewParams- ClusterMapViewParams
-
isFinishedLoading
Boolean isFinishedLoading(Integer featureCategoryMask)
Lifecycle hooks, call this api when surface is first created. The map will start drawing after this call
- Parameters:
featureCategoryMask- represents the features of the render engine that are required to be loaded(features are describe above)
-
onSurfaceCreated
Unit onSurfaceCreated()
Lifecycle hooks, call to pause the cluster view rendering
-
onSurfaceChanged
Unit onSurfaceChanged(Integer width, Integer height)
Lifecycle hooks, call to resume the cluster view rendering
-
onSurfaceChanged
Unit onSurfaceChanged(Surface surface, Integer width, Integer height)
Lifecycle hooks, call to destroy the cluster view instance
-
onSurfaceDestroyed
Unit onSurfaceDestroyed()
Set the preferred frames-per-second for the cluster map view renderer. Default fps is 30.
-
onPause
Unit onPause()
Register the mapView listener
-
onResume
Unit onResume()
Remove the mapView listener
-
onDestroy
Unit onDestroy()
Warning! Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate the vehicle representation for the ClusterMapView {@link VehicleController}
-
setFPS
Unit setFPS(Integer fps)
Warning! Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate routes for the ClusterMapView {@link RoutesController}
- Parameters:
fps- the preferred frames-per-second
-
addMapViewListener
Unit addMapViewListener(MapView.MapViewListener listener)
Warning! Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate annotations for the ClusterMapView {@link AnnotationsController}
- Parameters:
listener- The mapView listener MapView.MapViewListener
-
removeMapViewListener
Unit removeMapViewListener(MapView.MapViewListener listener)
Warning! Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate the point of focus for the ClusterMapView {@link CameraController}
- Parameters:
listener- The mapThe mapView listener MapView.MapViewListener
-
vehicleController
TnVehicleController vehicleController()
Warning! Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate renderable features for the ClusterMapView {@link FeaturesController}
-
routesController
TnRoutesController routesController()
Warning! Using Controllers before the {@link 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 ClusterMapView {@link ShapesController}
-
annotationsController
TnAnnotationsController annotationsController()
Warning! Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate the ClusterMapView theme {@link ThemeController}
-
cameraController
TnCameraController cameraController()
Warning! Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate the layout of the ClusterMapView {@link LayoutController}
-
featuresController
TnFeaturesController featuresController()
This method is used to return the object used to diagnose ClusterMapView
-
shapesController
TnShapesController shapesController()
Please avoid do some heavy action here, it will block map render thread or build thread
-
themeController
TnThemeController themeController()
to check the zoom level change
-
layoutController
TnLayoutController layoutController()
Using Controllers before the {@link MapViewReadyListener} notification will result in a crash This method is used to return the object used to manipulate the layout of the ClusterMapView {@link LayoutController}
-
mapDiagnosis
MapDiagnosis mapDiagnosis()
This is not supported for cluster map view
-
gestureProvider
MapGestureProvider gestureProvider()
to check the mapframe update
-
setOnTouchListener
Unit setOnTouchListener(TouchListener listener)
Sets the touch listener on this view.
- Parameters:
listener- callback interface implementation
-
setOnViewTouchListener
Unit setOnViewTouchListener(ViewTouchListener listener)
Sets the view touch listener on this view.
- Parameters:
listener- callback interface implementation
-
setOnAnnotationTouchListener
Unit setOnAnnotationTouchListener(AnnotationTouchListener listener)
Sets the annotation touch listener on this view.
- Parameters:
listener- callback interface implementation
-
setOnRouteTouchListener
Unit setOnRouteTouchListener(RouteTouchListener listener)
Sets the route touch listener on this view.
- Parameters:
listener- callback interface implementation
-
setOnPOITouchListener
Unit setOnPOITouchListener(POITouchListener poiTouchListener)
Register POI touch event callback
- Parameters:
poiTouchListener- The POI press event listener POITouchListener
-
setOnMapElementTouchListener
Unit setOnMapElementTouchListener(MapElementTouchListener listener)
Sets the map element touch listener on this view.
- Parameters:
listener- callback interface implementation
-
setOnStreetParkingTouchListener
Unit setOnStreetParkingTouchListener(OnStreetParkingTouchListener listener)
Sets the street parking touch listener on this view.
- Parameters:
listener- callback interface implementation
-
-
-
-