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 -
      • enableOneBuildingMode

        public abstract void enableOneBuildingMode()
        Limit the map to the first loaded building bounds.
      • enableOneBuildingMode

        public abstract void enableOneBuildingMode​(@NonNull
                                                   es.situm.sdk.model.cartography.Building building)
        Limit the map to the given building bounds.
        Parameters:
        building - Building.
      • 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