| java.lang.Object | ||
| ↳ | com.mapbox.mapboxsdk.maps.MapView | |
| ↳ | com.steerpath.sdk.maps.SteerpathMapView | |
The SteerpathMapView extends the MapView provided by Mapbox in order to implement features
that relate to indoor positoning.
In order to control the SteerpathMapView, the SteerpathMap should be used. It is the controller
for this view. In order to obtain a reference to the controller SteerpathMap, you should use
the method getMapAsync(OnMapReadyCallback).
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| interface | SteerpathMapView.LocateMeButtonListener | Application may interrupt LocateMe-button clicks with this callback. | |||||||||
| @interface | SteerpathMapView.LocateMeButtonMode | ||||||||||
| interface | SteerpathMapView.OnPermissionsNotGrantedListener | OnMissingPermissionsListener notifies if runtime permission are not granted and it blocks usage of SteerpathMapView. | |||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | BEHAVIOR_ROTATE_CAMERA | Cone is pointed upwards and camera is rotated. | |||||||||
| int | BEHAVIOR_ROTATE_CONE | Cone is pointing where user is looking at and camera not rotated. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
SteerpathMapView(Context context)
Create a new SteerpathMapView.
| |||||||||||
|
SteerpathMapView(Context context, AttributeSet attrs)
Create a new SteerpathMapView.
| |||||||||||
|
SteerpathMapView(Context context, AttributeSet attrs, int defStyleAttr)
Create a new SteerpathMapView.
| |||||||||||
|
SteerpathMapView(Context context, MapboxMapOptions options)
Create a new SteerpathMapView.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
acceptRoute(RouteOptionsFactory factory)
Exits "overview map" mode and starts actual navigation.
| ||||||||||
| void |
acceptRoute()
Exits "overview map" mode and starts actual navigation.
| ||||||||||
| void |
addCustomView(View view)
Adds View below LocateMe-button.
| ||||||||||
| final void |
enableFollowMeButton(boolean isEnabled)
Show or hide FollowMe button.
| ||||||||||
| final void |
enableLevelPicker(boolean isEnabled)
Show or hide LevelPickerView.
| ||||||||||
| void |
getMapAsync(OnMapReadyCallback callback)
Sets a callback object which will be triggered when the
MapboxMap instance is ready to be used. | ||||||||||
| MetaFeature |
getRenderedMetaFeature(LatLng point)
Queries rendered (mapbox) Features and returns (Steerpath) Feature in response.
| ||||||||||
| void |
hideBottomSheet()
Hide BottomSheetView with animation.
| ||||||||||
| boolean |
isInRoutePreviewMode()
Checks if
previewRoute(RoutePlan, RouteListener) has been called but
acceptRoute() has not been yet called. | ||||||||||
| boolean |
isNavigating()
Checks if navigation was previously started with previewRoute() or navigateTo().
| ||||||||||
| void |
launchCompassCalibrationDialog()
Convenience method to launch in-built compass calibration dialog.
| ||||||||||
| void |
navigateTo(RoutePlan plan, RouteListener listener)
Draws a route line and starts navigation with "snap-to-path".
| ||||||||||
| void |
navigateTo(Waypoint waypoint)
Continues navigation to Waypoint.
| ||||||||||
| void |
navigateTo(RoutePlan plan, RouteOptionsFactory factory, RouteListener listener)
Draws a route line and starts navigation with "snap-to-path".
| ||||||||||
| void | nextWaypoint(Waypoint currentWaypoint) | ||||||||||
| void |
notifyDirectionSheetCanceled()
update(Context, DirectionSheet.Data)} is not called anymore until DirectionSheet is shown again. | ||||||||||
| void |
onCreate(Bundle savedInstanceState)
You must call this method from the parent's | ||||||||||
| void |
onDestroy()
You must call this method from the parent's
onDestroy() or onDestroy(). | ||||||||||
| void |
onLowMemory()
You must call this method from the parent's
onLowMemory() or onLowMemory(). | ||||||||||
| void | onPause() | ||||||||||
| void |
onResume()
You must call this method from the parent's
onResume() or onResume(). | ||||||||||
| void |
onSaveInstanceState(Bundle outState)
You must call this method from the parent's
onSaveInstanceState(Bundle)
or onSaveInstanceState(Bundle). | ||||||||||
| void | onStart() | ||||||||||
| void | onStop() | ||||||||||
| void |
pauseNavigation()
Pauses ongoing navigation.
| ||||||||||
| void |
previewRoute(RoutePlan plan, RouteListener listener)
Calculate route to destination and show "overview map" before starting actual navigation.
| ||||||||||
| void |
previewRoute(RoutePlan plan, RouteOptionsFactory factory, RouteListener listener)
Calculate route to destination and show "overview map" before starting actual navigation.
| ||||||||||
| void |
removeCustomView(View view)
Removes View that was previously added with addCustomView().
| ||||||||||
| void |
resumeNavigation()
Resumes previously paused navigation.
| ||||||||||
| void |
setBlueDotHeadingModeBehavior(int behavior)
Change the way how map and heading cone works in BlueDotMode.HEADING mode.
| ||||||||||
| void |
setBottomSheetCallback(BottomSheetCallback callback)
Registers a callback and notifies whne BottomSheet state changes.
| ||||||||||
| void |
setBottomSheetContent(View content)
Put your custom View into BottomSheet.
| ||||||||||
| void |
setBottomSheetPeekSize(int peekSize)
Set peek area height.
| ||||||||||
| void |
setCompassCalibrationDialogEnabled(boolean isEnabled)
When going to BlueDotMode.HEADING, SDK may automatically prompt Compass Calibration Dialog.
| ||||||||||
| void |
setCompassCalibrationRecommendedListener(CompassUtils.Listener listener)
Listens Compass calibration recommended -events.
| ||||||||||
| void |
setDirectionSheet(DirectionSheet sheet)
Set custom renderer for contents of "directions list".
| ||||||||||
| void |
setLocateMeButtonListener(SteerpathMapView.LocateMeButtonListener listener)
With LocateMeButtonListener, app may intercept LocateMe-button clicks.
| ||||||||||
| void |
setLocateMeButtonModes(int[] toggleModes)
Add or remove toggleable states for LocateMe-button.
| ||||||||||
| void | setMarkerBottomSheetContentProvider(MarkerBottomSheetContentProvider markerBottomSheetContentProvider) | ||||||||||
| void |
setOnMapClickListener(OnMapClickListener onMapClickListener)
Set the listener for receiving map clicks.
| ||||||||||
| void |
setOnMarkerClickListener(OnMarkerClickListener onMarkerClickListener)
Set the listener for marker clicks.
| ||||||||||
| void |
setOnPermissionsNotGrantedListener(SteerpathMapView.OnPermissionsNotGrantedListener listener)
User of SteerpathMapView must make sure that proper permissions are granted.
| ||||||||||
| void |
setRoutePreviewHolder(RoutePreviewHolder holder)
Set custom renderer for route preview badge in BottomSheet.
| ||||||||||
| void |
setRouteStepViewHolder(RouteStepViewHolder holder)
Set custom renderer for contents of step-by-step routing bagde in BottomSheet.
| ||||||||||
| void |
setWaypointViewHolder(WaypointViewHolder holder)
Set custom renderer for Waypoint badge in BottomSheet
| ||||||||||
| void |
showWaypointViewHolder(Waypoint waypoint)
Updates BottomSheet component with WaypointViewHolder.
| ||||||||||
| void |
stopNavigation()
Stops navigation that was previously started with navigateTo().
| ||||||||||
| void |
updateRoutePlan(RoutePlan plan)
If
onReRouteRecommended(RoutePlan)} returns true, app can give new RoutePlan and continue
navigation with that. | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Cone is pointed upwards and camera is rotated.
Cone is pointing where user is looking at and camera not rotated.
Create a new SteerpathMapView.
| context | the context in which this map view is created. |
|---|
Create a new SteerpathMapView.
| context | the context in which this map view is created. |
|---|---|
| attrs | attributeset for this view |
Create a new SteerpathMapView.
| context | the context in which this map view is created. |
|---|---|
| attrs | attribute set for this view |
| defStyleAttr | default style attribute |
Create a new SteerpathMapView.
| context | the context in which this map view is created. |
|---|---|
| options | the options to be used for this map instance |
Exits "overview map" mode and starts actual navigation. Valid after previewRoute(RoutePlan, RouteListener)
or previewRoute(RoutePlan, RouteOptionsFactory, RouteListener).
Deprecated: use routeOptionsFactory(RouteOptionsFactory) instead of override default appearance.
| factory | customize route line appearance |
|---|
Exits "overview map" mode and starts actual navigation. Valid after previewRoute(RoutePlan, RouteListener)
or previewRoute(RoutePlan, RouteOptionsFactory, RouteListener).
Adds View below LocateMe-button. Parent ViewGroup is LinearLayout (vertical).
Show or hide FollowMe button. Enabled by default.
Show or hide LevelPickerView. Enabled by default.
Sets a callback object which will be triggered when the MapboxMap instance is ready to be used.
| callback | The callback object that will be triggered when the map is ready to be used. |
|---|
Queries rendered (mapbox) Features and returns (Steerpath) Feature in response.
Hide BottomSheetView with animation.
Checks if previewRoute(RoutePlan, RouteListener) has been called but
acceptRoute() has not been yet called.
Checks if navigation was previously started with previewRoute() or navigateTo().
Convenience method to launch in-built compass calibration dialog.
Draws a route line and starts navigation with "snap-to-path". Does not have "overview map" mode.
Call is valid after getMapAsync(OnMapReadyCallback). If navigateTo() is called while previous navigation is still in progress,
the first request will be stopped automatically and replaced with the second request.
Draws a route line and starts navigation with "snap-to-path". Does not have "overview map" mode.
Call is valid after getMapAsync(OnMapReadyCallback). If navigateTo() is called while previous navigation is still in progress,
the first request will be stopped automatically and replaced with the second request.
Deprecated: use routeOptionsFactory(RouteOptionsFactory) instead of override default appearance.
| factory | customize route line appearance |
|---|
update(Context, DirectionSheet.Data)} is not called anymore until DirectionSheet is shown again.
You must call this method from the parent's onCreate(Bundle) or
onCreate(Bundle).
| savedInstanceState | Pass in the parent's savedInstanceState. |
|---|
You must call this method from the parent's onDestroy() or onDestroy().
Stops MapServer and nullifies SteerpathMap. If fake location was enabled, it will be disabled now.
You must call this method from the parent's onLowMemory() or onLowMemory().
You must call this method from the parent's onSaveInstanceState(Bundle)
or onSaveInstanceState(Bundle).
| outState | Pass in the parent's outState. |
|---|
Pauses ongoing navigation. Does following: - hides BottomSheet - disables rerouting
Calculate route to destination and show "overview map" before starting actual navigation. Call is valid after getMapAsync(OnMapReadyCallback).
To start navigation, call acceptRoute() or acceptRoute(RouteOptionsFactory).
To cancel, call stopNavigation().
If origin and destination are in different buildings, route line is drawn "globally" ignoring selected building and floor.
Calculate route to destination and show "overview map" before starting actual navigation. Call is valid after getMapAsync(OnMapReadyCallback).
To start navigation, call acceptRoute() or acceptRoute(RouteOptionsFactory).
To cancel, call stopNavigation().
If origin and destination are in different buildings, route line is drawn "globally" ignoring selected building and floor.
Deprecated: Deprecated: use previewRouteOptionsFactory(RouteOptionsFactory) instead of override default appearance.
| factory | customize route line appearance |
|---|
Removes View that was previously added with addCustomView().
Resumes previously paused navigation. Does following: - Shows BottomSheet - enables rerouting
Change the way how map and heading cone works in BlueDotMode.HEADING mode. Default value is BEHAVIOR_ROTATE_CAMERA.
Registers a callback and notifies whne BottomSheet state changes.
Put your custom View into BottomSheet. It can be taller that R.dimens.bottom_bar_peek because BottomSheetView scrolls vertically.
Set peek area height. Floating Action Buttons and FloorSwitcher will be pushed upwards accordingly.
When going to BlueDotMode.HEADING, SDK may automatically prompt Compass Calibration Dialog. Enables or disabled this feature.
Listens Compass calibration recommended -events. To show default dialog, call launchCompassCalibrationDialog()
or show some other dialog.
Set custom renderer for contents of "directions list". List will be displayed when step-by-step routing badge is clicked.
With LocateMeButtonListener, app may intercept LocateMe-button clicks. SDK internally handles permissions, disabled Bluetooth configuration etc before click events are delivered to the application.
Add or remove toggleable states for LocateMe-button.
This does not affect toggleMapMode(), setMapMode(SteerpathMap.MapMode)},
toggleBlueDotMode() or setBlueDotMode(SteerpathMap.BlueDotMode).
These methods can be still called and they will have effect even if corresponding LocateMeButtonMode
value is not declared in setLocateMeButtonModes().
Duplicate LocateMeButtonModes are silently ignored.
Default configuration is:
SteerpathMapView.LocateMeButtonMode.NORMAL
SteerpathMapView.LocateMeButtonMode.FOLLOW_USER
SteerpathMapView.LocateMeButtonMode.HEADING
If device does not have compass, SteerpathMapView.LocateMeButtonMode.HEADING will be ignored.
| toggleModes | list of LocateMeButtonMode values in order they should be toggled |
|---|
| IllegalArgumentException | if param toggles is null or empty |
|---|---|
| IllegalArgumentException | if first @LocateMeButtonMode is not LocateMeButtonMode.NORMAL |
Set the listener for receiving map clicks. This interface overrides the one provided by MapboxMapView in order to support normal SteerpathMap behavior.
| onMapClickListener | the listener which should get notified when the map is clicked |
|---|
Set the listener for marker clicks. This interface overrides the one provided by MapboxMapView in order to support normal SteerpathMap behavior.
| onMarkerClickListener | the listener which should get notified if markers are clicked. |
|---|
User of SteerpathMapView must make sure that proper permissions are granted. Calling setOnPermissionsNotGrantedListener
enables permission checking and error indicator.
After granting permissions, FusedLocationProviderApi.Api.get().refreshLocationSources() must be called.
Set custom renderer for route preview badge in BottomSheet.
Set custom renderer for contents of step-by-step routing bagde in BottomSheet.
Set custom renderer for Waypoint badge in BottomSheet
Updates BottomSheet component with WaypointViewHolder.
Stops navigation that was previously started with navigateTo(). Removes existing route line. This method is called internally from onDestroy()
If onReRouteRecommended(RoutePlan)} returns true, app can give new RoutePlan and continue
navigation with that.