Class SitumMap

  • Direct Known Subclasses:
    LibraryListeners

    public abstract class SitumMap
    extends Object
    The Situm Map object. To get a SitumMap object follow just:
    1. Get your SitumMapView object instance and set a SitumMapView.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);
           }
       
    2. Implement the SitumMapView.OnMapReadyCallback methods:
           public void onMapReady(SitumMap situmMap) {
               // Stay alert of location changes:
               situmMap.setOnLocationChangeListener(...);
               ...
           }
           public void onError() {
               ...
           }
       
    3. 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 Detail

      • SitumMap

        public SitumMap()
    • Method Detail

      • onBackPressed

        public abstract boolean onBackPressed()
        Notifies the underlying fragment the onBackPressed event. Call this method from your ComponentActivity.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 of SitumMapsLibrary 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 the GoogleMap instance when ready.
        Parameters:
        googleCallback - Google Callback.
      • addLocationRequestInterceptor

        public abstract void addLocationRequestInterceptor​(Interceptor<es.situm.sdk.location.LocationRequest.Builder> interceptor)
        Add a Interceptor that will intercept LocationRequest object creations.
        Parameters:
        interceptor - Given interceptor.
      • addNavigationRequestInterceptor

        public abstract void addNavigationRequestInterceptor​(Interceptor<es.situm.sdk.navigation.NavigationRequest.Builder> interceptor)
        Add a Interceptor that will intercept NavigationRequest object creations.
        Parameters:
        interceptor - Given interceptor.
      • addDirectionsRequestInterceptor

        public abstract void addDirectionsRequestInterceptor​(Interceptor<es.situm.sdk.directions.DirectionsRequest.Builder> interceptor)
        Add a Interceptor that will intercept DirectionsRequest 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 a Poi 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:
        1. Over the map and all its markers/buildings.
        2. Behind the UI controls (positioning fab, search bar...).
        Parameters:
        view - Child view.
        index - Index.
        params - Layout params.
      • 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 the Pois displayed using the given list of PoiCategory identifiers. The selected Poi is always visible; the filter will be applied when it gets deselected.
        Parameters:
        categoryIdsFilter - List PoiCategory identifiers. Empty or null to clear filters.
      • selectCustomPoi

        public abstract void selectCustomPoi​(int poId,
                                             @Nullable
                                             ActionsCallback callback)
        Selects the CustomPoi 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 of CustomPoi if it does not exist or update the one that is currently saved. The resulting CustomPoi is saved on local storage.
        Parameters:
        name - Name of the CustomPoi
        description - Description of the CustomPoi
        selectedIcon - Icon that is painted on the map when the CustomPoi is selected.
        unSelectedIcon - Icon that is painted on the map when the CustomPoi 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 of CustomPoi with default name and description if it does not exist. If a custom poi is already saved, the creation operation will override it. The resulting CustomPoi is saved on local storage.
        Parameters:
        callback - Callback that notifies the state of this event.
      • getCustomPoi

        public abstract CustomPoi getCustomPoi​(int poiId)
        Reads the CustomPoi that matches the id, returns null if no CustomPoi 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 the CustomPoi 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.