public abstract class

MapViewModel

extends ViewModel
java.lang.Object
   ↳ androidx.lifecycle.ViewModel
     ↳ com.sap.cloud.mobile.fiori.maps.MapViewModel

Class Overview

An abstract data class for the toolbar. This class should not be used directly but instead implemented in a map specific class.

See Also

Summary

Constants
String LEGEND_DISPLAYED_BUNDLE
Public Constructors
MapViewModel()
Public Methods
boolean addLegendItemIfNecessary(LegendItemSource source, Context context)
void clearData()
Clear the data members.
String getLegendTitle()
Get the title for the legend.
FioriMarkerOptions getSelectedMarkerOptions()
boolean isLegendDisplayed()
Indicates if the legend is displayed.
boolean isLocationDisplayed()
Gets the state of whether the current location is being displayed.
void setLegendDisplayed(boolean legendDisplayed)
Set the legends displayed state.
void setLocationDisplayed(boolean isLocationDisplayed)
Save the state of whether the current location is being displayed.
void setSelectedMarkerOptions(FioriMarkerOptions selectedMarkerOptions)
[Expand]
Inherited Methods
From class androidx.lifecycle.ViewModel
From class java.lang.Object

Constants

public static final String LEGEND_DISPLAYED_BUNDLE

Constant Value: "sap:fiori:maps:legend:displayed"

Public Constructors

public MapViewModel ()

Public Methods

public boolean addLegendItemIfNecessary (LegendItemSource source, Context context)

public void clearData ()

Clear the data members.

public String getLegendTitle ()

Get the title for the legend.

Returns
  • The title for the legend.

public FioriMarkerOptions getSelectedMarkerOptions ()

public boolean isLegendDisplayed ()

Indicates if the legend is displayed. Useful for maintaining UI state when the activity has a configuration change, for example a device rotation. When the activity is recreated the legend can be redisplayed if it was visible before the rotation.

Returns
  • true if the legend is displayed.

public boolean isLocationDisplayed ()

Gets the state of whether the current location is being displayed.

public void setLegendDisplayed (boolean legendDisplayed)

Set the legends displayed state.

Parameters
legendDisplayed true if the legend is currently displayed.

public void setLocationDisplayed (boolean isLocationDisplayed)

Save the state of whether the current location is being displayed.

public void setSelectedMarkerOptions (FioriMarkerOptions selectedMarkerOptions)