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.

Custom Markers

Add Custom Marker

Call this method to add a Custom Marker to HyperTrackMapFragment.

Pass instance of MarkerOptions defining the Marker properties. Refer to Google MarkerOptions documentation for more info.

htMapFragment.addCustomMarker(MarkerOptions markerOptions);

Remove Custom Marker

Call this method to remove a Custom Marker added to HyperTrackMapFragment.

Returns true if all custom markers are removed, false if Map is null.

htMapFragment.removeCustomMarker(Marker marker);

Clear all Custom Marker

Call this method to clear all custom markers from HyperTrackMapFragment.

Returns true if all custom markers are removed, false if Map is null.

htMapFragment.clearCustomMarkers();

Get Custom Marker

Method to get Custom Marker for a given MarkerID added to HyperTrackMapFragment

Returns the custom marker for the given MarkerId if it exists, null otherwise.

htMapFragment.getCustomMarker(String markerID);

Get All Custom Marker

Method to get a list of all Custom Marker added to HyperTrackMapFragment

Returns a list of custom markers if they exist, null otherwise.

htMapFragment.getAllCustomMarkers();

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.

htMapFragment.disableMapBounds();

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.

htMapFragment.resetMapBounds();

[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 ""