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
SitumMapViewobject instance and set aSitumMapView.OnMapReadyCallbackon 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.OnMapReadyCallbackmethods: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 voidaddDirectionsRequestInterceptor(Interceptor<es.situm.sdk.directions.DirectionsRequest.Builder> interceptor)Add aInterceptorthat will interceptDirectionsRequestobject creations.abstract voidaddExternalLocation(es.situm.sdk.location.ExternalLocation externalLocation)Add an external location for the SDK to use as it's own.abstract voidaddLocationRequestInterceptor(Interceptor<es.situm.sdk.location.LocationRequest.Builder> interceptor)Add aInterceptorthat will interceptLocationRequestobject creations.abstract voidaddNavigationRequestInterceptor(Interceptor<es.situm.sdk.navigation.NavigationRequest.Builder> interceptor)Add aInterceptorthat will interceptNavigationRequestobject creations.abstract voidaddView(View view)Add this child view.abstract voidaddView(View view, int index)Add this child view.abstract voidaddView(View child, int width, int height)Add this child view.abstract voidaddView(View view, int index, ViewGroup.LayoutParams params)Add this child view.abstract voidaddView(View child, ViewGroup.LayoutParams params)Add this child view.abstract voidcenterBuilding(es.situm.sdk.model.cartography.Building building)Center the given building in the map.abstract voidcenterBuilding(es.situm.sdk.model.cartography.Building building, ActionsCallback callback)Center the given building in the map.abstract voidcenterBuilding(String buildingId, ActionsCallback callback)Center the given building in the map.abstract voidchangeGeofencesColor(Map<Integer,List<es.situm.sdk.model.cartography.Geofence>> geofences)Change the color of the geofences that you want painted over the map.abstract voidenableOneBuildingMode()Limit the map to the first loaded building bounds.abstract voidenableOneBuildingMode(String buildingId)Limit the map to the given building bounds.abstract voidenableOneBuildingMode(String buildingId, ActionsCallback callback)Limit the map to the given building bounds.abstract voidfilterPoisBy(List<String> categoryIdsFilter)Filter thePois displayed using the given list ofPoiCategoryidentifiers.abstract voidfindRouteToLocation(es.situm.sdk.model.cartography.Floor floor, double lat, double lng)Find a route to the given location.abstract voidfindRouteToLocation(String buildingId, String floorId, double lat, double lng)Find a route to the given location.abstract voidfindRouteToPoi(es.situm.sdk.model.cartography.Poi poi)Find a route to the given Poi.abstract CustomPoigetCustomPoi()abstract CustomPoigetCustomPoi(int poiId)abstract voidgetGoogleMap(com.google.android.gms.maps.OnMapReadyCallback googleCallback)Get theGoogleMapinstance when ready.abstract booleanonBackPressed()Notifies the underlying fragment the onBackPressed event.abstract voidreleaseOneBuildingMode()Release the one building mode.abstract voidremoveCustomPoi(int poiId, ActionsCallback callback)Deletes theCustomPoicurrently stored both on local storage and on runtime storage.abstract voidremoveView(View view)Remove a previously added child view.abstract voidremoveViewAt(int index)Remove a previously added child view.abstract voidselectCustomPoi(int poId, ActionsCallback callback)Selects theCustomPoiinstance saved on cache.abstract voidselectFloor(es.situm.sdk.model.cartography.Floor floor)Select the given floor.abstract voidselectPoi(es.situm.sdk.model.cartography.Poi poi)Select the given poi on the map.abstract voidselectPoi(es.situm.sdk.model.cartography.Poi poi, ActionsCallback callback)Select the given poi on the map.abstract voidsetFloorsListVisible(boolean visible)Show/hide the floors list selector.abstract voidsetGetMeToPoiFabVisible(boolean visible)Show/hide the default get-me-to-poi Foating Action Button.abstract voidsetInfoViewVisible(boolean visible)Show/hide the info-view bottom area.abstract voidsetOnActiveBuildingListener(OnActiveBuildingListener listener)Get notified about active building events.abstract voidsetOnFloorChangeListener(OnFloorChangeListener listener)Get notified about changes in the floor level selector.abstract voidsetOnLibraryViewListener(OnLibraryViewListener listener)Get notified about activity/view events.abstract voidsetOnLoadBuildingsListener(OnLoadBuildingsListener listener)Get notified about buildings events.abstract voidsetOnLocationChangeListener(OnLocationChangeListener listener)Get notified about user location changes.abstract voidsetOnNavigationListener(OnNavigationListener listener)Get notified about navigation events (request, cancel, destination reached).abstract voidsetOnPoiSelectionListener(OnPoiSelectionListener listener)Get notified about POI events.abstract voidsetOnRealtimeDataChangeListener(es.situm.wayfinding.OnRealtimeDataChangeListener listener)Get notified about changes in the floor level selector.abstract voidsetPositioningFabVisible(boolean visible)Show/hide the default positioning Foating Action Button.abstract voidsetSitumMapsListener(SitumMapsListener listener)Get notified ofSitumMapsLibraryevents.abstract voidsetUserInteractionsListener(OnUserInteractionListener listener)Get notified of events produced by user interactions.abstract voidstartCustomPoiCreation(ActionsCallback callback)Initiates the creation of an instance ofCustomPoiwith default name and description if it does not exist.abstract voidstartCustomPoiCreation(String name, String description, Bitmap selectedIcon, Bitmap unSelectedIcon, ActionsCallback callback)Create an instance ofCustomPoiif it does not exist or update the one that is currently saved.abstract voidstartPositioning()Start positioning at the first loaded building.abstract voidstartPositioning(es.situm.sdk.model.cartography.Building building)Start positioning at the given building.abstract voidstartPositioning(String buildingId)Start positioning at the given building.abstract voidstopNavigation()Stop navigating if the user is currently navigating to aPoior location.abstract voidstopPositioning()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 ofSitumMapsLibraryevents.- 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 theGoogleMapinstance when ready.- Parameters:
googleCallback- Google Callback.
-
addLocationRequestInterceptor
public abstract void addLocationRequestInterceptor(Interceptor<es.situm.sdk.location.LocationRequest.Builder> interceptor)
Add aInterceptorthat will interceptLocationRequestobject creations.- Parameters:
interceptor- Given interceptor.
-
addNavigationRequestInterceptor
public abstract void addNavigationRequestInterceptor(Interceptor<es.situm.sdk.navigation.NavigationRequest.Builder> interceptor)
Add aInterceptorthat will interceptNavigationRequestobject creations.- Parameters:
interceptor- Given interceptor.
-
addDirectionsRequestInterceptor
public abstract void addDirectionsRequestInterceptor(Interceptor<es.situm.sdk.directions.DirectionsRequest.Builder> interceptor)
Add aInterceptorthat will interceptDirectionsRequestobject 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 aPoior 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 thePois displayed using the given list ofPoiCategoryidentifiers. The selected Poi is always visible; the filter will be applied when it gets deselected.- Parameters:
categoryIdsFilter- ListPoiCategoryidentifiers. Empty or null to clear filters.
-
selectCustomPoi
public abstract void selectCustomPoi(int poId, @Nullable ActionsCallback callback)Selects theCustomPoiinstance 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 ofCustomPoiif it does not exist or update the one that is currently saved. The resultingCustomPoiis saved on local storage.- Parameters:
name- Name of theCustomPoidescription- Description of theCustomPoiselectedIcon- Icon that is painted on the map when theCustomPoiis selected.unSelectedIcon- Icon that is painted on the map when theCustomPoiis selected.callback- Callback that notifies the state of this event.
-
startCustomPoiCreation
public abstract void startCustomPoiCreation(@Nullable ActionsCallback callback)Initiates the creation of an instance ofCustomPoiwith default name and description if it does not exist. If a custom poi is already saved, the creation operation will override it. The resultingCustomPoiis saved on local storage.- Parameters:
callback- Callback that notifies the state of this event.
-
getCustomPoi
public abstract CustomPoi getCustomPoi(int poiId)
Reads theCustomPoithat matches the id, returns null if noCustomPoistored matches the id provided.- Parameters:
poiId- Identifier of custom POI.- Returns:
CustomPoito be retrieved.
-
removeCustomPoi
public abstract void removeCustomPoi(int poiId, @Nullable ActionsCallback callback)Deletes theCustomPoicurrently 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.
-
-