Customize map view

The default behavior of the Consumer SDK Map View is to auto-set bounds on the User's location and the Expected Place. This way, as the user moves closer to the Expected Place, the zoom level increases.

If your use-case requires a different behavior, you can use the following methods.

Show start location

The default behavior of the map fragment is to set the bounds with the user's location and the expected place. If you want the bounds to include start location as well, you need to enable the visibility of Source Marker by overriding showSourceMarkerForActionID method and then overriding disableDynamicZoom method of HyperTrackMapAdapter class.

With this, the start location will be visible in the bounds, along with the user's location and the expected place.

public boolean showSourceMarkerForActionID(HyperTrackMapFragment hyperTrackMapFragment, String actionID) {
  return true;

public boolean disableDynamicZoom(HyperTrackMapFragment hyperTrackMapFragment) {
  return false;

Auto-bounds for map

By default, the map view automatically re-focuses the map bounds as the location of the marker changes.

Disabling Map Auto-bounds

To disable auto-bounds, and keep the map bounds stationary when the marker moves, use the HyperTrackMapFragment's disableMapBounds method.


Reset Map Auto-bounds

To reset the map bounds to the default auto-bounds state, call HyperTrackMapFragment's resetMapBounds. If dynamicZoom is disabled, the source location will also be included in the map bounds.


[success] Customising bounds and zoom level

With this and the previous guide, you can customise the look and feel of the Consumer UI, to suit your use-case.

Was this helpful? Yes, thanks! Not really

results matching ""

    No results matching ""