Package es.situm.wayfinding
Class SitumMap
- java.lang.Object
-
- es.situm.wayfinding.SitumMap
-
- Direct Known Subclasses:
LibraryListeners
public abstract class SitumMap extends Object
The Situm Map object. To get a SitumMap object follow just:-
Get your
SitumMapView
object instance and set aSitumMapView.OnMapReadyCallback
on it:protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_layout); SitumMapView mapView = findViewById(R.id.map_view); mapView.setOnMapReadyCallback(this); }
-
Implement the
SitumMapView.OnMapReadyCallback
methods:public void onMapReady(SitumMap situmMap) { // Stay alert of location changes: situmMap.setOnLocationChangeListener(...); ... } public void onError() { ... }
-
Remember that your activity_layout.xml file should contain a
SitumMapView
:... <es.situm.wayfinding.SitumMapView android:id="@+id/map_view" android:layout_width="match_parent" android:layout_height="match_parent" /> ...
-
-
Constructor Summary
Constructors Constructor Description SitumMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
addDirectionsRequestInterceptor(Interceptor<es.situm.sdk.directions.DirectionsRequest.Builder> interceptor)
Add aInterceptor
that will interceptDirectionsRequest
object creations.abstract void
addExternalLocation(es.situm.sdk.location.ExternalLocation externalLocation)
Add an external location for the SDK to use as it's own.abstract void
addLocationRequestInterceptor(Interceptor<es.situm.sdk.location.LocationRequest.Builder> interceptor)
Add aInterceptor
that will interceptLocationRequest
object creations.abstract void
addNavigationRequestInterceptor(Interceptor<es.situm.sdk.navigation.NavigationRequest.Builder> interceptor)
Add aInterceptor
that will interceptNavigationRequest
object creations.abstract void
addView(View view)
Add this child view.abstract void
addView(View view, int index)
Add this child view.abstract void
addView(View child, int width, int height)
Add this child view.abstract void
addView(View view, int index, ViewGroup.LayoutParams params)
Add this child view.abstract void
addView(View child, ViewGroup.LayoutParams params)
Add this child view.abstract void
centerBuilding(es.situm.sdk.model.cartography.Building building)
Center the given building in the map.abstract void
centerBuilding(es.situm.sdk.model.cartography.Building building, ActionsCallback callback)
Center the given building in the map.abstract void
centerBuilding(String buildingId, ActionsCallback callback)
Center the given building in the map.abstract void
changeGeofencesColor(Map<Integer,List<es.situm.sdk.model.cartography.Geofence>> geofences)
Change the color of the geofences that you want painted over the map.abstract void
enableOneBuildingMode()
Limit the map to the first loaded building bounds.abstract void
enableOneBuildingMode(String buildingId)
Limit the map to the given building bounds.abstract void
enableOneBuildingMode(String buildingId, ActionsCallback callback)
Limit the map to the given building bounds.abstract void
filterPoisBy(List<String> categoryIdsFilter)
Filter thePoi
s displayed using the given list ofPoiCategory
identifiers.abstract void
findRouteToLocation(es.situm.sdk.model.cartography.Floor floor, double lat, double lng)
Find a route to the given location.abstract void
findRouteToLocation(String buildingId, String floorId, double lat, double lng)
Find a route to the given location.abstract void
findRouteToPoi(es.situm.sdk.model.cartography.Poi poi)
Find a route to the given Poi.abstract CustomPoi
getCustomPoi()
abstract CustomPoi
getCustomPoi(int poiId)
abstract void
getGoogleMap(com.google.android.gms.maps.OnMapReadyCallback googleCallback)
Get theGoogleMap
instance when ready.abstract boolean
onBackPressed()
Notifies the underlying fragment the onBackPressed event.abstract void
releaseOneBuildingMode()
Release the one building mode.abstract void
removeCustomPoi(int poiId, ActionsCallback callback)
Deletes theCustomPoi
currently stored both on local storage and on runtime storage.abstract void
removeView(View view)
Remove a previously added child view.abstract void
removeViewAt(int index)
Remove a previously added child view.abstract void
selectCustomPoi(int poId, ActionsCallback callback)
Selects theCustomPoi
instance saved on cache.abstract void
selectFloor(es.situm.sdk.model.cartography.Floor floor)
Select the given floor.abstract void
selectPoi(es.situm.sdk.model.cartography.Poi poi)
Select the given poi on the map.abstract void
selectPoi(es.situm.sdk.model.cartography.Poi poi, ActionsCallback callback)
Select the given poi on the map.abstract void
setFloorsListVisible(boolean visible)
Show/hide the floors list selector.abstract void
setGetMeToPoiFabVisible(boolean visible)
Show/hide the default get-me-to-poi Foating Action Button.abstract void
setInfoViewVisible(boolean visible)
Show/hide the info-view bottom area.abstract void
setOnActiveBuildingListener(OnActiveBuildingListener listener)
Get notified about active building events.abstract void
setOnFloorChangeListener(OnFloorChangeListener listener)
Get notified about changes in the floor level selector.abstract void
setOnLibraryViewListener(OnLibraryViewListener listener)
Get notified about activity/view events.abstract void
setOnLoadBuildingsListener(OnLoadBuildingsListener listener)
Get notified about buildings events.abstract void
setOnLocationChangeListener(OnLocationChangeListener listener)
Get notified about user location changes.abstract void
setOnNavigationListener(OnNavigationListener listener)
Get notified about navigation events (request, cancel, destination reached).abstract void
setOnPoiSelectionListener(OnPoiSelectionListener listener)
Get notified about POI events.abstract void
setOnRealtimeDataChangeListener(es.situm.wayfinding.OnRealtimeDataChangeListener listener)
Get notified about changes in the floor level selector.abstract void
setPositioningFabVisible(boolean visible)
Show/hide the default positioning Foating Action Button.abstract void
setSitumMapsListener(SitumMapsListener listener)
Get notified ofSitumMapsLibrary
events.abstract void
setUserInteractionsListener(OnUserInteractionListener listener)
Get notified of events produced by user interactions.abstract void
startCustomPoiCreation(ActionsCallback callback)
Initiates the creation of an instance ofCustomPoi
with default name and description if it does not exist.abstract void
startCustomPoiCreation(String name, String description, Bitmap selectedIcon, Bitmap unSelectedIcon, ActionsCallback callback)
Create an instance ofCustomPoi
if it does not exist or update the one that is currently saved.abstract void
startPositioning()
Start positioning at the first loaded building.abstract void
startPositioning(es.situm.sdk.model.cartography.Building building)
Start positioning at the given building.abstract void
startPositioning(String buildingId)
Start positioning at the given building.abstract void
stopNavigation()
Stop navigating if the user is currently navigating to aPoi
or location.abstract void
stopPositioning()
Stop positioning.
-
-
-
Method Detail
-
onBackPressed
public abstract boolean onBackPressed()
Notifies the underlying fragment the onBackPressed event. Call this method from yourComponentActivity.onBackPressed()
method if you want the situm maps fragment to handle these events.- Returns:
- true if the event was consumed, false elsewhere.
-
setSitumMapsListener
public abstract void setSitumMapsListener(SitumMapsListener listener)
Get notified ofSitumMapsLibrary
events.- Parameters:
listener
- listener.
-
setOnLocationChangeListener
public abstract void setOnLocationChangeListener(OnLocationChangeListener listener)
Get notified about user location changes.- Parameters:
listener
- listener
-
setUserInteractionsListener
public abstract void setUserInteractionsListener(OnUserInteractionListener listener)
Get notified of events produced by user interactions.- Parameters:
listener
- listener.
-
setOnPoiSelectionListener
public abstract void setOnPoiSelectionListener(OnPoiSelectionListener listener)
Get notified about POI events.- Parameters:
listener
- listener
-
setOnActiveBuildingListener
public abstract void setOnActiveBuildingListener(OnActiveBuildingListener listener)
Get notified about active building events.- Parameters:
listener
- listener
-
setOnLoadBuildingsListener
public abstract void setOnLoadBuildingsListener(OnLoadBuildingsListener listener)
Get notified about buildings events.- Parameters:
listener
- listener.
-
setOnFloorChangeListener
public abstract void setOnFloorChangeListener(OnFloorChangeListener listener)
Get notified about changes in the floor level selector.- Parameters:
listener
- listener
-
setOnRealtimeDataChangeListener
public abstract void setOnRealtimeDataChangeListener(es.situm.wayfinding.OnRealtimeDataChangeListener listener)
Get notified about changes in the floor level selector.- Parameters:
listener
- listener
-
getGoogleMap
public abstract void getGoogleMap(@NonNull com.google.android.gms.maps.OnMapReadyCallback googleCallback)
Get theGoogleMap
instance when ready.- Parameters:
googleCallback
- Google Callback.
-
addLocationRequestInterceptor
public abstract void addLocationRequestInterceptor(Interceptor<es.situm.sdk.location.LocationRequest.Builder> interceptor)
Add aInterceptor
that will interceptLocationRequest
object creations.- Parameters:
interceptor
- Given interceptor.
-
addNavigationRequestInterceptor
public abstract void addNavigationRequestInterceptor(Interceptor<es.situm.sdk.navigation.NavigationRequest.Builder> interceptor)
Add aInterceptor
that will interceptNavigationRequest
object creations.- Parameters:
interceptor
- Given interceptor.
-
addDirectionsRequestInterceptor
public abstract void addDirectionsRequestInterceptor(Interceptor<es.situm.sdk.directions.DirectionsRequest.Builder> interceptor)
Add aInterceptor
that will interceptDirectionsRequest
object creations.- Parameters:
interceptor
- Given interceptor.
-
centerBuilding
public abstract void centerBuilding(@NonNull es.situm.sdk.model.cartography.Building building)
Center the given building in the map.- Parameters:
building
- Building.
-
centerBuilding
public abstract void centerBuilding(@NonNull es.situm.sdk.model.cartography.Building building, @Nullable ActionsCallback callback)
Center the given building in the map. Use the given callback to chain other commands (ex.selectPoi(Poi)
,enableOneBuildingMode()
...).- Parameters:
building
-callback
-
-
centerBuilding
public abstract void centerBuilding(@NonNull String buildingId, @Nullable ActionsCallback callback)
Center the given building in the map. Use the given callback to chain other commands (ex.selectPoi(Poi)
,enableOneBuildingMode()
...).- Parameters:
buildingId
-callback
-
-
enableOneBuildingMode
public abstract void enableOneBuildingMode()
Limit the map to the first loaded building bounds.
-
enableOneBuildingMode
public abstract void enableOneBuildingMode(@Nullable String buildingId, @Nullable ActionsCallback callback)
Limit the map to the given building bounds.- Parameters:
buildingId
- Building identifier.callback
- Get notified when de action concludes.
-
enableOneBuildingMode
public abstract void enableOneBuildingMode(@Nullable String buildingId)
Limit the map to the given building bounds.- Parameters:
buildingId
- Building identifier.
-
releaseOneBuildingMode
public abstract void releaseOneBuildingMode()
Release the one building mode.
-
startPositioning
public abstract void startPositioning()
Start positioning at the first loaded building.
-
startPositioning
public abstract void startPositioning(@NonNull es.situm.sdk.model.cartography.Building building)
Start positioning at the given building.- Parameters:
building
- Building.
-
startPositioning
public abstract void startPositioning(@Nullable String buildingId)
Start positioning at the given building.- Parameters:
buildingId
- Building identifier.
-
stopPositioning
public abstract void stopPositioning()
Stop positioning.
-
selectFloor
public abstract void selectFloor(@NonNull es.situm.sdk.model.cartography.Floor floor)
Select the given floor.- Parameters:
floor
- Floor to select.
-
selectPoi
public abstract void selectPoi(@NonNull es.situm.sdk.model.cartography.Poi poi)
Select the given poi on the map.- Parameters:
poi
- Poi.
-
selectPoi
public abstract void selectPoi(@NonNull es.situm.sdk.model.cartography.Poi poi, @Nullable ActionsCallback callback)
Select the given poi on the map.- Parameters:
poi
- Poi.callback
- Callback.
-
findRouteToPoi
public abstract void findRouteToPoi(@NonNull es.situm.sdk.model.cartography.Poi poi)
Find a route to the given Poi.- Parameters:
poi
- Poi.
-
findRouteToLocation
public abstract void findRouteToLocation(@NonNull es.situm.sdk.model.cartography.Floor floor, double lat, double lng)
Find a route to the given location.- Parameters:
floor
- Floor.lat
- Latitude.lng
- Longitude.
-
findRouteToLocation
public abstract void findRouteToLocation(String buildingId, String floorId, double lat, double lng)
Find a route to the given location.- Parameters:
buildingId
- Id of the building.floorId
- Id of the desired floor.lat
- Latitude.lng
- Longitude.
-
stopNavigation
public abstract void stopNavigation()
Stop navigating if the user is currently navigating to aPoi
or location. Does nothing if navigation is not running.
-
changeGeofencesColor
public abstract void changeGeofencesColor(Map<Integer,List<es.situm.sdk.model.cartography.Geofence>> geofences)
Change the color of the geofences that you want painted over the map. The color is a 32-bit ARGB. Default color is 0x7Ff9ff80.- Parameters:
geofences
- Map with the colors and the geofences list
-
setPositioningFabVisible
public abstract void setPositioningFabVisible(boolean visible)
Show/hide the default positioning Foating Action Button.- Parameters:
visible
- Visible/gone.
-
setGetMeToPoiFabVisible
public abstract void setGetMeToPoiFabVisible(boolean visible)
Show/hide the default get-me-to-poi Foating Action Button.- Parameters:
visible
- Visible/gone.
-
setFloorsListVisible
public abstract void setFloorsListVisible(boolean visible)
Show/hide the floors list selector.- Parameters:
visible
- Visible/gone.
-
setInfoViewVisible
public abstract void setInfoViewVisible(boolean visible)
Show/hide the info-view bottom area.- Parameters:
visible
- Visible/gone.
-
setOnLibraryViewListener
public abstract void setOnLibraryViewListener(OnLibraryViewListener listener)
Get notified about activity/view events.- Parameters:
listener
- Listener.
-
setOnNavigationListener
public abstract void setOnNavigationListener(OnNavigationListener listener)
Get notified about navigation events (request, cancel, destination reached).- Parameters:
listener
- Listener.
-
addView
public abstract void addView(View view, int index, ViewGroup.LayoutParams params)
Add this child view. The target will be placed in an overlay that is:- Over the map and all its markers/buildings.
- Behind the UI controls (positioning fab, search bar...).
- Parameters:
view
- Child view.index
- Index.params
- Layout params.
-
addView
public abstract void addView(View view, int index)
Add this child view.- Parameters:
view
- Child view.index
- Index.- See Also:
addView(View, int, ViewGroup.LayoutParams)
-
addView
public abstract void addView(View view)
Add this child view.- Parameters:
view
- Child view.- See Also:
addView(View, int, ViewGroup.LayoutParams)
-
addView
public abstract void addView(View child, ViewGroup.LayoutParams params)
Add this child view.- Parameters:
child
- Child view.params
- Layout params.- See Also:
addView(View, int, ViewGroup.LayoutParams)
-
addView
public abstract void addView(View child, int width, int height)
Add this child view.- Parameters:
child
- Child view.width
- Width.height
- Height.- See Also:
addView(View, int, ViewGroup.LayoutParams)
-
removeView
public abstract void removeView(View view)
Remove a previously added child view.- Parameters:
view
- Child view.- See Also:
addView(View, int, ViewGroup.LayoutParams)
-
removeViewAt
public abstract void removeViewAt(int index)
Remove a previously added child view.- Parameters:
index
- Index of the child view.- See Also:
addView(View, int, ViewGroup.LayoutParams)
-
addExternalLocation
public abstract void addExternalLocation(@NonNull es.situm.sdk.location.ExternalLocation externalLocation)
Add an external location for the SDK to use as it's own.- Parameters:
externalLocation
- this location will be forwarded by the SDK and drawn on the map
-
filterPoisBy
public abstract void filterPoisBy(List<String> categoryIdsFilter)
Filter thePoi
s displayed using the given list ofPoiCategory
identifiers. The selected Poi is always visible; the filter will be applied when it gets deselected.- Parameters:
categoryIdsFilter
- ListPoiCategory
identifiers. Empty or null to clear filters.
-
selectCustomPoi
public abstract void selectCustomPoi(int poId, @Nullable ActionsCallback callback)
Selects theCustomPoi
instance saved on cache.- Parameters:
poId
- Identifier of POI that is to be selected.callback
- Callback that notifies the state of this event.
-
startCustomPoiCreation
public abstract void startCustomPoiCreation(@Nullable String name, @Nullable String description, @Nullable Bitmap selectedIcon, @Nullable Bitmap unSelectedIcon, @Nullable ActionsCallback callback)
Create an instance ofCustomPoi
if it does not exist or update the one that is currently saved. The resultingCustomPoi
is saved on local storage.- Parameters:
name
- Name of theCustomPoi
description
- Description of theCustomPoi
selectedIcon
- Icon that is painted on the map when theCustomPoi
is selected.unSelectedIcon
- Icon that is painted on the map when theCustomPoi
is selected.callback
- Callback that notifies the state of this event.
-
startCustomPoiCreation
public abstract void startCustomPoiCreation(@Nullable ActionsCallback callback)
Initiates the creation of an instance ofCustomPoi
with default name and description if it does not exist. If a custom poi is already saved, the creation operation will override it. The resultingCustomPoi
is saved on local storage.- Parameters:
callback
- Callback that notifies the state of this event.
-
getCustomPoi
public abstract CustomPoi getCustomPoi(int poiId)
Reads theCustomPoi
that matches the id, returns null if noCustomPoi
stored matches the id provided.- Parameters:
poiId
- Identifier of custom POI.- Returns:
CustomPoi
to be retrieved.
-
removeCustomPoi
public abstract void removeCustomPoi(int poiId, @Nullable ActionsCallback callback)
Deletes theCustomPoi
currently stored both on local storage and on runtime storage.- Parameters:
poiId
- Identifier of the POI that will be removed.callback
- Callback that notifies of the state of this event.
-
-