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.
Collection<LegendItem> getLegendItems()
Get the collection of legend items for the toolbar.
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.
boolean setLegendItemVisibility(String layer, boolean visible)
Given the name of the layer, this function updates the corresponding lengendItem.
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 Collection<LegendItem> getLegendItems ()

Get the collection of legend items for the toolbar.

Returns
  • The collection of legend items for the toolbar.

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 boolean setLegendItemVisibility (String layer, boolean visible)

Given the name of the layer, this function updates the corresponding lengendItem.

Parameters
layer name of the layer
visible true or false indicating the visibility to be set
Returns
  • boolean value indicating visibility is set or not

public void setLocationDisplayed (boolean isLocationDisplayed)

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

public void setSelectedMarkerOptions (FioriMarkerOptions selectedMarkerOptions)