public class SitumMapsLibrary extends LibraryContext implements SitumMapsListener
librarySettings = new LibrarySettings(); librarySettings.setCredentials(this, USER, API_KEY, true); // Create library: mLibrary = new SitumMapsLibrary(R.id.maps_library_target, this, librarySettings); mLibrary.load();
<!-- The target view: -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/maps_library_target"
android:layout_width="match_parent"
android:layout_height="match_parent" />
...
SitumMapsListener.Errors
Constructor and Description |
---|
SitumMapsLibrary(int containerId,
FragmentActivity context,
LibrarySettings settings)
Creates a new
SitumMapsLibrary . |
Modifier and Type | Method and Description |
---|---|
void |
addDirectionsRequestInterceptor(<any> interceptor) |
void |
addLocationRequestInterceptor(<any> interceptor) |
void |
addNavigationRequestInterceptor(<any> interceptor) |
void |
addOnBackPressedListener(OnBackPressedListener listener)
Adds a listener that will be notified of onBackPressed events.
|
void |
addPrivateExtensions(PrivateExtensions privateExtensions)
Set up private extensions (search, settings and calibration) in this application.
|
void |
addView(android.view.View view) |
void |
addView(android.view.View view,
int index) |
void |
addView(android.view.View child,
int width,
int height) |
void |
addView(android.view.View view,
int index,
android.view.ViewGroup.LayoutParams params) |
void |
addView(android.view.View child,
android.view.ViewGroup.LayoutParams params) |
void |
centerBuilding(Building building) |
void |
centerBuilding(Building building,
ActionsCallback callback) |
void |
centerPoi(Poi poi) |
void |
changeGeofencesColor(java.util.Map<java.lang.Integer,java.util.List<Geofence>> geofences) |
void |
closeToasts()
Closes all the currently open toasts.
|
void |
enableOneBuildingMode() |
void |
enableOneBuildingMode(Building building) |
void |
findRouteToPoi(Poi poi) |
void |
getGoogleMap(OnMapReadyCallback googleCallback)
Get the
com.google.android.gms.maps.GoogleMap instance when ready. |
void |
load()
Prepares the
MapsFragment and commits the fragment transaction. |
void |
loadInFragment(Fragment parentFragment)
Prepares the
MapsFragment and commits the fragment transaction. |
boolean |
onBackPressed()
Notifies the underlying fragment the onBackPressed event.
|
void |
onError(int error)
An error occurred on library load.
|
void |
onSuccess()
Everything worked as expected on library load.
|
void |
releaseOneBuildingMode() |
void |
removeView(android.view.View view) |
void |
removeViewAt(int index) |
void |
selectFloor(Floor floor) |
void |
setFloorsListVisible(boolean visible) |
void |
setGetMeToPoiFabVisible(boolean visible) |
void |
setInfoViewVisible(boolean visible) |
void |
setPositioningFabVisible(boolean visible) |
void |
startPositioning() |
void |
startPositioning(Building building) |
void |
stopPositioning() |
void |
unload()
Removes the
MapsFragment from the container and commits the fragment transaction. |
public SitumMapsLibrary(int containerId, FragmentActivity context, LibrarySettings settings)
SitumMapsLibrary
.containerId
- ID of the ViewGroup that will contain the MapsFragment
fragment.context
- A FragmentActivity
that will be the parent of the fragment.settings
- Settings needed.public void load()
MapsFragment
and commits the fragment transaction.
Use this method to load the library inside an Activity.public void loadInFragment(Fragment parentFragment)
MapsFragment
and commits the fragment transaction.
Use this method to load the library inside a Fragment.public void unload()
MapsFragment
from the container and commits the fragment transaction.public void onSuccess()
SitumMapsListener
onSuccess
in interface SitumMapsListener
public void onError(int error)
SitumMapsListener
onError
in interface SitumMapsListener
error
- Error identifier.public void getGoogleMap(OnMapReadyCallback googleCallback)
com.google.android.gms.maps.GoogleMap
instance when ready.googleCallback
- Google Callback.public void addPrivateExtensions(PrivateExtensions privateExtensions)
privateExtensions
- Private extensions.public boolean onBackPressed()
Activity.onBackPressed()
method if you want the situm maps fragment to handle these events.public void addOnBackPressedListener(OnBackPressedListener listener)
listener
- OnBackPressedListeneronBackPressed()
public void closeToasts()
public void addLocationRequestInterceptor(<any> interceptor)
public void addNavigationRequestInterceptor(<any> interceptor)
public void addDirectionsRequestInterceptor(<any> interceptor)
public void centerBuilding(Building building)
public void centerBuilding(Building building, ActionsCallback callback)
public void enableOneBuildingMode()
public void enableOneBuildingMode(Building building)
public void releaseOneBuildingMode()
public void centerPoi(Poi poi)
public void findRouteToPoi(Poi poi)
public void changeGeofencesColor(java.util.Map<java.lang.Integer,java.util.List<Geofence>> geofences)
public void startPositioning()
public void startPositioning(Building building)
public void stopPositioning()
public void selectFloor(Floor floor)
public void setPositioningFabVisible(boolean visible)
public void setGetMeToPoiFabVisible(boolean visible)
public void setFloorsListVisible(boolean visible)
public void setInfoViewVisible(boolean visible)
public void addView(android.view.View view, int index, android.view.ViewGroup.LayoutParams params)
public void addView(android.view.View view, int index)
public void addView(android.view.View view)
public void addView(android.view.View child, android.view.ViewGroup.LayoutParams params)
public void addView(android.view.View child, int width, int height)
public void removeView(android.view.View view)
public void removeViewAt(int index)