public final class MapControl
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
MapControl.FloorTileSize
Deprecated.
|
static interface |
MapControl.TileCacheScheme
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
TILE_CACHESCHEME_NONE
Deprecated.
|
static int |
TILE_CACHESCHEME_OFFLINE
Deprecated.
|
static int |
TILE_CACHESCHEME_PERSISTENT
Deprecated.
|
static int |
TILE_CACHESCHEME_TEMPORARY
Deprecated.
|
static int |
TILE_SIZE_X1
Deprecated.
|
static int |
TILE_SIZE_X2
Deprecated.
|
| Constructor and Description |
|---|
MapControl(android.content.Context context)
Creates a MapControl instance without having a Google Map object available
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDisplayRule(LocationDisplayRule locationDisplayRule)
Adds a custom display rule
|
void |
addDisplayRule(LocationDisplayRule locationDisplayRule,
OnResultReadyListener onResultReadyListener)
Adds a new display rule
|
void |
addDisplayRules(java.util.List<LocationDisplayRule> displayRuleList)
Adds a new set of custom display rules
|
void |
addDisplayRules(java.util.List<LocationDisplayRule> displayRuleList,
OnResultReadyListener onResultReadyListener)
Add rules needed to display locations correctly.
|
void |
addOnCameraIdleListener(com.google.android.gms.maps.GoogleMap.OnCameraIdleListener onCameraIdleListener)
Adds a callback that's invoked when camera movement has ended.
|
void |
addOnCameraMoveCanceledListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveCanceledListener onCameraMoveCanceledListener)
Adds a callback that's invoked when camera motion is stopped or interrupted by a new type of animation.
|
void |
addOnCameraMoveListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveListener onCameraMoveListener)
Adds a callback that's invoked repeatedly while the camera is in motion.
|
void |
addOnCameraMoveStartedListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener onCameraMoveStartedListener)
Adds a callback that's invoked when the camera starts moving or the reason for camera motion has changed.
|
void |
bindToMap(com.google.android.gms.maps.GoogleMap googleMap,
android.view.View view)
Deprecated.
|
void |
clearMap()
Invoke this method to restore the map to its default state (POIs shown based on their display rules, etc.)
|
void |
deSelectLocation()
Call this to deselect a location previously selected with
selectLocation(MPLocation) |
void |
disableLiveData(java.lang.String domainType)
Disables live data on a specific domainType
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations)
Use this method to display temporary locations, not points of interests location.
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations,
boolean animateCamera)
Use this method to display temporary locations, not points of interests location.
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding)
Use this method to display temporary locations, not points of interests location.
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
boolean showInfoWindow)
Use this method to display temporary locations, not points of interests location.
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
boolean showInfoWindow,
com.google.android.gms.maps.CameraUpdate googleMapCameraUpdate,
int durationMs,
com.google.android.gms.maps.GoogleMap.CancelableCallback googleMapCancelableCallback)
Use this method to display temporary locations, not points of interests location.
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
boolean showInfoWindow,
com.google.android.gms.maps.CameraUpdate googleMapCameraUpdate,
int durationMs,
com.google.android.gms.maps.GoogleMap.CancelableCallback googleMapCancelableCallback,
ReadyListener readyListener)
Use this method to display temporary locations, not points of interests location.
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
ReadyListener readyListener)
Use this method to display temporary locations, not points of interests location.
|
boolean |
displaySearchResults(java.util.List<MPLocation> locations,
ReadyListener readyListener)
Use this method to display temporary locations, not points of interests location.
|
void |
enableClickedPOIHighlight(boolean enable)
Enables/disables POI area highlighting
|
void |
enableFloorSelector(boolean enable)
Enables or disables the
FloorSelectorInterface, i.e. |
void |
enableLiveData(java.lang.String domainType)
Enables live data on a specific domain and uses MapsIndoors standard graphic implementation
|
void |
enableLiveData(java.lang.String domainType,
OnLiveLocationUpdateListener onLiveLocationUpdateListener)
Enables live data on a specific domain
|
int |
getClickedPOIHighlightFillColor()
Get the selected area's fill color
|
int |
getClickedPOIHighlightOutlineStrokeColor()
Get the selected area's stroke color
|
float |
getClickedPOIHighlightOutlineStrokeWidth()
Get the selected area's stroke width
|
float |
getClickedPOIHighlightShowingZoomLevel()
Get the zoom level a selected area will start showing
|
Building |
getCurrentBuilding()
Returns the current visible
Building (the one having the viewport's center/target within its bounding box or closest to any of its contour) |
Floor |
getCurrentBuildingFloor()
|
int |
getCurrentFloorIndex()
Returns the current selected floor index
|
PositionResult |
getCurrentPosition()
Get the current user position (blue dot) object
|
LocationDisplayRule |
getDefaultDisplayRule()
Gets the default
LocationDisplayRule |
LocationDisplayRule |
getDisplayRule(MPLocation location)
Gets the
LocationDisplayRule currently being used by the given MPLocation |
LocationDisplayRule |
getDisplayRule(java.lang.String type)
Gets the
LocationDisplayRule with the given type (name) |
java.util.List<LocationDisplayRule> |
getDisplayRules()
Gets the full list of
LocationDisplayRule, if available |
java.util.HashMap<java.lang.String,LocationDisplayRule> |
getDisplayRulesForLocations(java.util.List<MPLocation> locations)
Gets the
LocationDisplayRules currently being used by the given MPLocations |
FloorSelectorInterface |
getFloorSelector()
Get the floor selector control object.
|
MPLocation |
getLocation(com.google.android.gms.maps.model.Marker marker)
Get a
MPLocation by marker reference. |
MapStyle |
getMapStyle()
Gets the current map style
|
java.util.List<MapStyle> |
getMapStyles()
Deprecated.
|
int |
getMapViewPaddingBottom()
Gets the Map View bottom padding
|
int |
getMapViewPaddingEnd()
Gets the Map View right padding
|
int |
getMapViewPaddingStart()
Gets the Map View left padding
|
int |
getMapViewPaddingTop()
Gets the Map View top padding
|
PositionIndicator |
getPositionIndicator()
Get the position indicator (user location icon)
|
PositionIndicator |
getPositionMarker()
Deprecated.
Use
getCurrentPosition() instead |
int |
getSearchResultCount()
Gets the last search result object count
|
java.util.List<MPLocation> |
getSearchResults()
Get the search results from the last call to any of the
displaySearchResults() methods |
void |
init(OnLoadingDataReadyListener onLoadingDataReadyListener)
Initializes
MapControl |
boolean |
isFloorSelectorEnabled()
Returns the current state of the current
FloorSelectorInterface. |
boolean |
isPOIHighlightEnabled()
Checks if location area highlight is enabled
|
boolean |
isReady()
Returns true if MapControl has been initialized and is ready to be used
|
boolean |
isTrackingPosition()
Checks whether position tracking is enabled or not
|
boolean |
isUserPositionShown()
Returns the current visibility state of the user location icon (blue dot)
|
void |
onDestroy()
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
onLowMemory()
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
onPause()
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
onRestoreInstanceState(android.os.Bundle savedInstanceState)
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
onResume()
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
onSaveInstanceState(android.os.Bundle outState)
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
onStart()
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
onStop()
Call this method from the parent Activity/Fragment's corresponding method.
|
void |
refreshMap()
Forces a map update
|
void |
removeOnCameraIdleListener(com.google.android.gms.maps.GoogleMap.OnCameraIdleListener onCameraIdleListener)
Removes the callback added with
addOnCameraIdleListener(GoogleMap.OnCameraIdleListener) |
void |
removeOnCameraMoveCanceledListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveCanceledListener onCameraMoveCanceledListener)
Removes the callback added with
addOnCameraMoveCanceledListener(GoogleMap.OnCameraMoveCanceledListener) |
void |
removeOnCameraMoveListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveListener onCameraMoveListener)
Removes the callback added with
addOnCameraMoveListener(GoogleMap.OnCameraMoveListener) |
void |
removeOnCameraMoveStartedListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener onCameraMoveStartedListener)
Removes the callback added with
addOnCameraMoveStartedListener(GoogleMap.OnCameraMoveStartedListener) |
void |
resetDisplayRule(java.util.List<MPLocation> locations)
Sets the display rule of the given
MPLocation set to their default one (set from the CMS) |
void |
resetDisplayRule(MPLocation location)
Sets the display rule of the given
MPLocation to its default one (set from the CMS) |
void |
selectFloor(int floorIndex)
Sets the current visible floor to the given z-index one
|
void |
selectLocation(MPLocation location)
Selects the given
MPLocation. |
void |
selectLocation(MPLocation location,
boolean zoomToLocationMinZoomLevel)
Selects the given
MPLocation. |
void |
selectLocation(MPLocation location,
boolean animateCamera,
boolean zoomToLocationMinZoomLevel,
boolean showInfoWindow)
Selects the given
MPLocation. |
void |
selectLocation(MPLocation location,
boolean animateCamera,
boolean zoomToLocationMinZoomLevel,
boolean showInfoWindow,
boolean userTriggered)
Selects the given
MPLocation. |
void |
setBuildingOutlineShowingZoomLevel(int buildingOutlineShowingZoomLevel)
Sets the zoom level from which the building outline should be rendered
|
void |
setBuildingOutlineStrokeColor(int strokeColor)
Sets the building outline color
|
void |
setCacheScheme(int scheme)
Deprecated.
use
@MPTileManager.setTileCacheStrategy(TileCacheStrategy) |
void |
setClickedPOIHighlightFillColor(int fillColor)
Sets the selected area's fill color
|
void |
setClickedPOIHighlightOutlineStrokeColor(int strokeColor)
Sets the selected area's stroke color
|
void |
setClickedPOIHighlightOutlineStrokeWidth(float strokeWidth)
Sets the selected area's stroke width
|
void |
setClickedPOIHighlightShowingZoomLevel(float zoomLevel)
Sets the zoom level a selected area will start showing
|
void |
setCurrentPosition(PositionResult position)
Manually sets the user ("blue dot") position
|
void |
setDefaultDisplayRule(LocationDisplayRule displayRule)
Sets the default
LocationDisplayRule |
void |
setDisplayRule(LocationDisplayRule displayRule,
java.util.List<MPLocation> locations)
Sets a
LocationDisplayRule on given MPLocation set |
void |
setDisplayRule(LocationDisplayRule displayRule,
MPLocation location)
Sets a
LocationDisplayRule on a single MPLocation |
void |
setDisplayRule(java.lang.String displayRuleName,
java.util.List<MPLocation> locations)
Sets a
LocationDisplayRule on the given MPLocation set |
void |
setDisplayRule(java.lang.String displayRuleName,
MPLocation location)
Sets a
LocationDisplayRule on the given MPLocation |
void |
setDisplayRuleDefaultIconSize(int size)
Overwrites the display rules default icon size
|
void |
setDisplayRuleDefaultLabelMaxCharLength(int maxCharLength)
Overwrites the label's max char length on ALL display rules
|
void |
setFloorSelector(FloorSelectorInterface floorSelector)
Replaces the embedded FloorSelector with the given custom one.
|
void |
setGoogleMap(com.google.android.gms.maps.GoogleMap googleMap,
android.view.View view)
Sets the Google Map and its parent view
|
void |
setInfoWindowAdapter(com.google.android.gms.maps.GoogleMap.InfoWindowAdapter adapter)
A convenience
GoogleMap.setInfoWindowAdapter(GoogleMap.InfoWindowAdapter) wrapper |
void |
setLocationClusterImageAdapter(MPLocationClusterImageAdapter locationClusterImageAdapter)
Sets the given
MPLocationClusterImageAdapter handler |
void |
setLocationClusteringEnabled(boolean enable)
Enables/disables marker clustering
|
void |
setLocationHideOnIconOverlapEnabled(boolean enable)
Enables/disables marker hiding on icon overlap
|
void |
setMapLabelFont(android.graphics.Typeface typeface,
int color,
boolean showHalo)
Changes the font of the maps marker labels
|
void |
setMapLabelTextSize(int textSize)
Changes the text size of the maps marker labels
|
void |
setMapPadding(int start,
int top,
int end,
int bottom)
Sets padding on the map
|
void |
setMapStyle(MapStyle mapStyle)
Sets the Google Map's style to its default one
|
void |
setOnCurrentBuildingChangedListener(OnBuildingFoundAtCameraTargetListener onBuildingFoundAtCameraTargetListener)
Receive notifications when the current building changes
|
void |
setOnCurrentVenueChangedListener(OnVenueFoundAtCameraTargetListener onVenueFoundAtCameraTargetListener)
Receive notifications when the map camera target enters a
Venue (its boundaries) |
void |
setOnFloorUpdateListener(OnFloorUpdateListener onFloorUpdateListener)
Set up a listener object to catch floor changes made by either the user or the positioning service
|
void |
setOnLocationClusterClickListener(OnLocationClusterClickListener onLocationClusterClickListener)
Sets the given
OnLocationClusterClickListener handler |
void |
setOnLocationSelectedListener(OnLocationSelectedListener onLocationSelectedListener)
Sets a listener for when a location gets selected (programmatically or user-triggered)
|
void |
setOnMapClickListener(OnMapClickListener onMapClickListener)
Set the map click listener.
|
void |
setOnMapLongClickListener(OnMapLongClickListener onMapLongClickListener)
Sets the long map click listener.
|
void |
setOnMarkerClickListener(com.google.android.gms.maps.GoogleMap.OnMarkerClickListener onMarkerClickListener)
Set the marker click listener.
|
void |
setOnMarkerDragListener(com.google.android.gms.maps.GoogleMap.OnMarkerDragListener onMarkerDragListener)
Set the marker drag listener.
|
void |
setOnMarkerInfoWindowClickListener(com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener onInfoWindowClickListener)
Set the marker info window click listener.
|
void |
setOnMarkerInfoWindowCloseListener(com.google.android.gms.maps.GoogleMap.OnInfoWindowCloseListener onMarkerInfoWindowCloseListener)
Set the marker info window click listener.
|
void |
setOnMarkerInfoWindowLongClickListener(com.google.android.gms.maps.GoogleMap.OnInfoWindowLongClickListener onMarkerInfoWindowLongClickListener)
Set the marker info window long click listener.
|
void |
setOnWillUpdateLocationsOnMap(OnWillUpdateLocationsOnMap listener) |
void |
setTileFadeIn(boolean enableTileFadeIn)
Enable fade-in effect on MapsIndoors tiles.
|
void |
setTileSize(int tileSize)
Deprecated.
Use
setTileSize(TileSize) instead |
void |
setTileSize(TileSize tileSize) |
void |
setTrackingPositionTiltAngle(float angle)
When in tracking mode, sets the camera's tilt to the given one
|
boolean |
setUserLocationIconFromDisplayRule(LocationDisplayRule locationDisplayRule)
Deprecated.
|
void |
showBuildingOutline(boolean show)
Enables the rendering of the
Building on focus's floor outline |
void |
showInfoWindowOnClickedLocation(boolean show)
Enables/disables the info window on user-selected locations
|
void |
showUserPosition(boolean show)
Renders the icon set with
setUserLocationIconFromDisplayRule(LocationDisplayRule) at the last known user position on the map |
boolean |
trackUserPosition(boolean enableTracking)
Enables/disables user position tracking (camera following the blue-dot marker)
|
boolean |
trackUserPosition(boolean enableTracking,
boolean bearingCoupledWithCamera)
Deprecated.
As of 3.9.1, this method is replaced by
trackUserPosition(boolean) |
void |
unbindFromMap()
Unbinds
MapControl from the current GoogleMap and view it's attached to |
void |
updatePosition(PositionResult positionResult)
Updates the blue dot, whatever its status is
|
@Deprecated public static final int TILE_SIZE_X1
@Deprecated public static final int TILE_SIZE_X2
@Deprecated public static final int TILE_CACHESCHEME_NONE
@Deprecated public static final int TILE_CACHESCHEME_TEMPORARY
@Deprecated public static final int TILE_CACHESCHEME_PERSISTENT
@Deprecated public static final int TILE_CACHESCHEME_OFFLINE
@UiThread
public MapControl(@NonNull
android.content.Context context)
Use setGoogleMap(GoogleMap, View) to set the GoogleMap object and its parent view
context - The contextMapsIndoorsException - if the SDK wasn't initialized yetjava.lang.IllegalStateException - if this wasn't invoked from the UI ThreadMapsIndoorsException - if more instances were created than supported@UiThread public final void init(OnLoadingDataReadyListener onLoadingDataReadyListener)
MapControlonLoadingDataReadyListener - An optional listener that will be called on the UI Threadjava.lang.IllegalStateException - if this wasn't invoked from the UI Threadpublic final boolean isReady()
true if MapControl is done initializing/synchronizing, false if MapControl
is either synchronizing or it is terminating (by invoking onDestroy())@UiThread public final void clearMap()
java.lang.IllegalStateException - if this wasn't invoked from the UI Thread@AnyThread public final void refreshMap()
@UiThread
public final void setGoogleMap(@NonNull
com.google.android.gms.maps.GoogleMap googleMap,
@NonNull
android.view.View view)
googleMap - The GoogleMap objectview - The View the map is child ofjava.lang.IllegalStateException - if this wasn't invoked from the UI Threadpublic void setTileFadeIn(boolean enableTileFadeIn)
enableTileFadeIn - - enable fade-in@Deprecated
@UiThread
public final void bindToMap(com.google.android.gms.maps.GoogleMap googleMap,
android.view.View view)
MapControl to the given GoogleMap and view objectsgoogleMap - A GoogleMap instanceview - The View the given GoogleMap instance is attached to@UiThread public final void unbindFromMap()
MapControl from the current GoogleMap and view it's attached to@AnyThread
public final void setDisplayRule(@Nullable
LocationDisplayRule displayRule,
@Nullable
MPLocation location)
LocationDisplayRule on a single MPLocation
This display rule takes precedence over more general displayrules like the type-display-rule
displayRule - The LocationDisplayRule to apply to the given MPLocationlocation - A MPLocation@AnyThread
public final void setDisplayRule(@Nullable
LocationDisplayRule displayRule,
@Nullable
java.util.List<MPLocation> locations)
LocationDisplayRule on given MPLocation set
This display rule takes precedence over more general displayrules like the type-display-rule
displayRule - The LocationDisplayRule to apply to the given MPLocationlocations - A list of MPLocation that will be set to the given LocationDisplayRule@AnyThread
public final void setDisplayRule(@Nullable
java.lang.String displayRuleName,
@Nullable
MPLocation location)
LocationDisplayRule on the given MPLocation
This display rule takes precedence over more general display rules like the type-display-rule
displayRuleName - The name of the LocationDisplayRule that should be applied to the given MPLocationlocation - A MPLocation@AnyThread
public final void setDisplayRule(@Nullable
java.lang.String displayRuleName,
@Nullable
java.util.List<MPLocation> locations)
LocationDisplayRule on the given MPLocation set
This display rule takes precedence over more general display rules like the type-display-rule
displayRuleName - The name of the LocationDisplayRule that should be applied to the given MPLocationlocations - A list of MPLocation that will be set to the given LocationDisplayRule@Nullable public final LocationDisplayRule getDisplayRule(java.lang.String type)
LocationDisplayRule with the given type (name)type - The LocationDisplayRule nameLocationDisplayRule or null if a LocationDisplayRule with the given name wasn't found@Nullable @AnyThread public final LocationDisplayRule getDisplayRule(@Nullable MPLocation location)
LocationDisplayRule currently being used by the given MPLocationlocation - The MPLocation we want to get its current LocationDisplayRuleLocationDisplayRule or null (if the given location has an overridden icon
set in the CMS or if it is null)@NonNull public final java.util.List<LocationDisplayRule> getDisplayRules()
LocationDisplayRule, if availableLocationDisplayRule, if available@NonNull public final LocationDisplayRule getDefaultDisplayRule()
LocationDisplayRuleLocationDisplayRulesetDefaultDisplayRule()public final void setDefaultDisplayRule(LocationDisplayRule displayRule)
LocationDisplayRule
The default display settings used by MPMapControl to display a location. Modify this object to change the default visual appearance of a location. The default appearance only applies for locations that has no other references to a display rule.
displayRule - A new LocationDisplayRule to be set as the default, or null to revert to the SDK's onepublic final void setDisplayRuleDefaultIconSize(int size)
Applies only to those display rules that don't specify the size
size - The new default uniform POI icon size, in dp. Set to zero to use the SDK's default valuepublic final void setDisplayRuleDefaultLabelMaxCharLength(int maxCharLength)
maxCharLength - The desired char count or LocationDisplayRule.DEFAULT_MARKER_LABEL_LENGTH_NO_CAP to disable cappingpublic final void addDisplayRule(LocationDisplayRule locationDisplayRule)
locationDisplayRule - The new display rule to addjava.lang.IllegalArgumentException - if the given LocationDisplayRule name is currently being usedpublic final void addDisplayRule(LocationDisplayRule locationDisplayRule, OnResultReadyListener onResultReadyListener)
locationDisplayRule - The new display rule to addonResultReadyListener - A callback invoked once this method is done loading resources, if anyjava.lang.IllegalArgumentException - if the given LocationDisplayRule name is currently being usedpublic final void addDisplayRules(java.util.List<LocationDisplayRule> displayRuleList)
displayRuleList - The set of new display rules to be addedjava.lang.IllegalArgumentException - if the given LocationDisplayRule name is currently being usedpublic final void addDisplayRules(java.util.List<LocationDisplayRule> displayRuleList, OnResultReadyListener onResultReadyListener)
displayRuleList - The new display rule to addonResultReadyListener - A callback invoked once this method is done loading resources, if anyjava.lang.IllegalArgumentException - if the given LocationDisplayRule name is currently being used@Nullable @AnyThread public final java.util.HashMap<java.lang.String,LocationDisplayRule> getDisplayRulesForLocations(@NonNull java.util.List<MPLocation> locations)
LocationDisplayRules currently being used by the given MPLocationslocations - List of MPLocations we want to get current LocationDisplayRules for.@AnyThread
public final void resetDisplayRule(@Nullable
MPLocation location)
MPLocation to its default one (set from the CMS)location - The MPLocation we want to set its display rule to its default (set from the CMS)@AnyThread
public final void resetDisplayRule(@Nullable
java.util.List<MPLocation> locations)
MPLocation set to their default one (set from the CMS)locations - The MPLocation set we want to set their display rule to their default (set from the CMS)public final int getSearchResultCount()
@NonNull public final java.util.List<MPLocation> getSearchResults()
displaySearchResults() methodsMPLocation objects@AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations)
clearMap() to exit this statelocations - The temporary locations.@AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations,
boolean animateCamera)
clearMap() to exit this statelocations - The temporary locations.animateCamera - True if the camera should animate to the locations center, false to just move there@AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations,
@Nullable
ReadyListener readyListener)
clearMap() to exit this statelocations - The temporary locations.readyListener - @AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding)
clearMap() to exit this statelocations - The temporary locations.animateCamera - True if the camera should animate to the locations center, false to just move therecameraPadding - A padding value (in dp) between the given locations bounding box and the viewport@AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
boolean showInfoWindow)
clearMap() to exit this statelocations - The temporary locations.animateCamera - True if the camera should animate to the locations center, false to just move therecameraPadding - A padding value (in dp) between the given locations bounding box and the viewportshowInfoWindow - True to show the info window if there is only one location in the list@AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
@Nullable
ReadyListener readyListener)
clearMap() to exit this statelocations - The temporary locations.animateCamera - True if the camera should animate to the locations center, false to just move therecameraPadding - A padding value (in dp) between the given locations bounding box and the viewport@AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
boolean showInfoWindow,
@Nullable
com.google.android.gms.maps.CameraUpdate googleMapCameraUpdate,
int durationMs,
com.google.android.gms.maps.GoogleMap.CancelableCallback googleMapCancelableCallback)
clearMap() to exit this statelocations - The temporary locations.animateCamera - True if the camera should animate to the locations center, false to just move theregoogleMapCameraUpdate - A CameraUpdate object. See CameraUpdatedurationMs - The duration of the animation in milliseconds. This must be strictly positive, otherwise an IllegalArgumentException will be thrown.googleMapCancelableCallback - An optional callback to be notified from the Android UI thread
when the animation stops. If the animation stops due to its
natural completion, the callback will be notified with onFinish().
If the animation stops due to interruption by a later camera
movement or a user gesture, onCancel() will be called.
The callback should not attempt to move or animate the camera
in its cancellation method. If a callback isn't required, leave it as null.@AnyThread
public final boolean displaySearchResults(@NonNull
java.util.List<MPLocation> locations,
boolean animateCamera,
int cameraPadding,
boolean showInfoWindow,
@Nullable
com.google.android.gms.maps.CameraUpdate googleMapCameraUpdate,
int durationMs,
com.google.android.gms.maps.GoogleMap.CancelableCallback googleMapCancelableCallback,
@Nullable
ReadyListener readyListener)
clearMap() to exit this statelocations - The temporary locations.animateCamera - True if the camera should animate to the locations center, false to just move therecameraPadding - A padding value (in dp) between the given locations bounding box and the viewportshowInfoWindow - True to show the info window if there is only one location in the listgoogleMapCameraUpdate - A CameraUpdate object. See CameraUpdatedurationMs - The duration of the animation in milliseconds. This must be strictly positive, otherwise an IllegalArgumentException will be thrown.googleMapCancelableCallback - An optional callback to be notified from the Android UI thread
when the animation stops. If the animation stops due to its
natural completion, the callback will be notified with onFinish().
If the animation stops due to interruption by a later camera
movement or a user gesture, onCancel() will be called.
The callback should not attempt to move or animate the camera
in its cancellation method. If a callback isn't required, leave it as null.readyListener - An optional callback to be notified once the method is done (failed to run, end of camera animations, etc.)public final void enableFloorSelector(boolean enable)
FloorSelectorInterface, i.e. hiding the View from the MapControl
The MapControl will still receive relevant events on floor updates, building change etc.
The Interface will also receive the events, making it possible to enable/disable in real time,
without refreshing the map.enable - Should the FloorSelectorInterface be enabled?public final void setFloorSelector(FloorSelectorInterface floorSelector)
floorSelector - View that implements FloorSelectorInterface@UiThread public final void enableClickedPOIHighlight(boolean enable)
Enabled by default
enable - true to enable area highlighting, false to disablejava.lang.IllegalStateException - if this wasn't invoked from the UI Thread@AnyThread public final int getClickedPOIHighlightFillColor()
AARRGGBB format@AnyThread public final int getClickedPOIHighlightOutlineStrokeColor()
AARRGGBB format@AnyThread public final float getClickedPOIHighlightOutlineStrokeWidth()
@AnyThread public final float getClickedPOIHighlightShowingZoomLevel()
@UiThread public final void setClickedPOIHighlightFillColor(int fillColor)
fillColor - A color value in the AARRGGBB formatjava.lang.IllegalStateException - if this wasn't invoked from the UI Thread@UiThread public final void setClickedPOIHighlightOutlineStrokeColor(int strokeColor)
strokeColor - A color value in the AARRGGBB formatjava.lang.IllegalStateException - if this wasn't invoked from the UI Thread@UiThread public final void setClickedPOIHighlightOutlineStrokeWidth(float strokeWidth)
strokeWidth - The stroke width, in pixelsjava.lang.IllegalStateException - if this wasn't invoked from the UI Thread@UiThread public final void setClickedPOIHighlightShowingZoomLevel(float zoomLevel)
zoomLevel - The zoom level a selected area will be shownjava.lang.IllegalStateException - if this wasn't invoked from the UI Threadpublic final void showBuildingOutline(boolean show)
Building on focus's floor outlineshow - true to render the current floor's outline, false otherwise@AnyThread public final boolean isPOIHighlightEnabled()
true if highlight is enabled (with enableClickedPOIHighlight(boolean)), false otherwise@UiThread public final void setInfoWindowAdapter(com.google.android.gms.maps.GoogleMap.InfoWindowAdapter adapter)
GoogleMap.setInfoWindowAdapter(GoogleMap.InfoWindowAdapter) wrapperadapter - The adapter to use for info window contents, or null to use the default content rendering in info windows.java.lang.IllegalStateException - if this wasn't invoked from the UI Threadpublic final void setLocationClusterImageAdapter(MPLocationClusterImageAdapter locationClusterImageAdapter)
MPLocationClusterImageAdapter handlerlocationClusterImageAdapter - A custom MPLocationClusterImageAdapter handler.
Set to null to use the default onepublic final void setLocationClusteringEnabled(boolean enable)
At the moment, invoking this method once MapControl.init() has
been called, has no effect
enable - true to enable marker clustering, false otherwiseMapsIndoorsException - if this was invoked after MapControl.init() was calledpublic final void setLocationHideOnIconOverlapEnabled(boolean enable)
This method enables/disables hiding icons when colliding with others
At the moment, invoking this method once MapControl.init() has
been called, has no effect
enable - true to enable marker hiding when overlapping with others, false otherwiseMapsIndoorsException - if this was invoked after MapControl.init() was calledpublic final void setMapPadding(int start,
int top,
int end,
int bottom)
start - Left padding, in pixelstop - Top padding, in pixelsend - Right padding, in pixelsbottom - Bottom padding, in pixels@UiThread public final void setMapStyle(MapStyle mapStyle)
@Nullable @AnyThread public final MapStyle getMapStyle()
MapStyle or null if data isn't yet available@NonNull @AnyThread public final java.util.List<MapStyle> getMapStyles()
MapsIndoors.getMapStyles()MapStyle or an empty list if data isn't yet availablepublic final int getMapViewPaddingBottom()
public final int getMapViewPaddingEnd()
public final int getMapViewPaddingStart()
public final int getMapViewPaddingTop()
public final void setTrackingPositionTiltAngle(float angle)
angle - The angle, in degrees@AnyThread public final void showInfoWindowOnClickedLocation(boolean show)
The info window is shown by default when the user selects a location (by tapping on it)
show - true to show the info window on user-selected locations, false otherwise@UiThread @Deprecated public final boolean setUserLocationIconFromDisplayRule(LocationDisplayRule locationDisplayRule)
PositionIndicator.setIconFromDisplayRule(LocationDisplayRule) insteadLocationDisplayRulelocationDisplayRule - The LocationDisplayRule to use as the user's location icon on the maptrue if the given location display rule was successfully added, false otherwisepublic final boolean isFloorSelectorEnabled()
FloorSelectorInterface.true if enabled (default), false if not.public final void setBuildingOutlineShowingZoomLevel(int buildingOutlineShowingZoomLevel)
buildingOutlineShowingZoomLevel - The zoom level, in the range [0, 22]public final void setBuildingOutlineStrokeColor(int strokeColor)
strokeColor - The color as AARRGGBBpublic final void setTileSize(int tileSize)
setTileSize(TileSize) insteadNote that tile sizes depend on the Solution set (it is not mandatory for all MapsIndoors solutions to support all tile sizes)
tileSize - The tile (square) size in pixels (TILE_SIZE_X1, TILE_SIZE_X2)java.lang.IllegalArgumentException - if the argument tileSize is not a valid one (TILE_SIZE_X1, TILE_SIZE_X2)MapsIndoorsException - if this was invoked after MapControl.init() was calledpublic final void setTileSize(@NonNull
TileSize tileSize)
@UiThread public final void deSelectLocation()
selectLocation(MPLocation)@UiThread public final void selectFloor(int floorIndex)
For floor names/z-index pairs check the value returned by Building.getFloorHashMap()
floorIndex - A floor z-index@UiThread
public final void selectLocation(@Nullable
MPLocation location)
MPLocation.
This will set the camera over it. The camera will animate and a fixed zoom level will be used (21)
location - The MPLocation to be selected, null to deselect the current one@UiThread
public final void selectLocation(@Nullable
MPLocation location,
boolean zoomToLocationMinZoomLevel)
MPLocation.
This will set the camera over it. The camera will animate and, if the zoomToLocationMinZoomLevel param is set to true,
the location's smallest zoom level (LocationDisplayRule.getZoomLevelOn()) will be used as the camera's target zoom
location - The MPLocation to be selected, null to deselect the current onezoomToLocationMinZoomLevel - true to use the location's smallest zoom level (LocationDisplayRule.getZoomLevelOn()) will be used as the camera's target zoom@UiThread
public final void selectLocation(@Nullable
MPLocation location,
boolean animateCamera,
boolean zoomToLocationMinZoomLevel,
boolean showInfoWindow,
boolean userTriggered)
MPLocation.
This will set the camera over it. The camera will animate and, if the
zoomToLocationMinZoomLevel argument is set to true, the location's smallest
zoom level (LocationDisplayRule.getZoomLevelOn()) will be used as the camera's target
zoom
location - The location to be selected, null to deselect the current oneanimateCamera - true if the camera should animate to the location's
position, false to just movezoomToLocationMinZoomLevel - true to use the location's smallest zoom level
(LocationDisplayRule.getZoomLevelOn()) will be used
as the camera's target zoomshowInfoWindow - true if the Info Window should be shown, false otherwiseuserTriggered - true to move the MPLocation marker into
view only if it is partially visible. Set to false
for the default behaviour@UiThread
public final void selectLocation(@Nullable
MPLocation location,
boolean animateCamera,
boolean zoomToLocationMinZoomLevel,
boolean showInfoWindow)
MPLocation.
This will set the camera over it. The camera will animate and, if the zoomToLocationMinZoomLevel param is set to true,
the location's smallest zoom level (LocationDisplayRule.getZoomLevelOn()) will be used as the camera's target zoom
location - The location to be selected, null to deselect the current oneanimateCamera - true if the camera should animate to the location's position, false to just movezoomToLocationMinZoomLevel - true to use the location's smallest zoom level (LocationDisplayRule.getZoomLevelOn()) will be used as the camera's target zoomshowInfoWindow - true if the Info Window should be shown, false otherwise@Nullable public final Building getCurrentBuilding()
Building (the one having the viewport's center/target within its bounding box or closest to any of its contour)@Nullable public final Floor getCurrentBuildingFloor()
public final int getCurrentFloorIndex()
Floor.DEFAULT_GROUND_FLOOR_INDEX if no Building is in focus@Nullable public final PositionResult getCurrentPosition()
PositionIndicator object@Nullable public final FloorSelectorInterface getFloorSelector()
@Nullable public final MPLocation getLocation(com.google.android.gms.maps.model.Marker marker)
MPLocation by marker reference.marker - A Google Map MarkerMPLocation or null@NonNull public final PositionIndicator getPositionIndicator()
PositionIndicator object@Deprecated @NonNull public final PositionIndicator getPositionMarker()
getCurrentPosition() insteadPositionIndicator object@AnyThread public final void setCurrentPosition(PositionResult position)
position - A PositionResult or a null to update the markerpublic final void showUserPosition(boolean show)
setUserLocationIconFromDisplayRule(LocationDisplayRule) at the last known user position on the mapshow - True to show, false to hide@Deprecated
public final boolean trackUserPosition(boolean enableTracking,
boolean bearingCoupledWithCamera)
trackUserPosition(boolean)enableTracking - true to enable tracking, false to disablebearingCoupledWithCamera - Not used at the momenttrue if starting/stopping tracking was successfulpublic final boolean trackUserPosition(boolean enableTracking)
enableTracking - true to enable tracking, false to disabletrue if starting/stopping tracking was successful@AnyThread public final void updatePosition(PositionResult positionResult)
public final boolean isTrackingPosition()
true if the tracking mode is on, false otherwisepublic final boolean isUserPositionShown()
true if the blue dot marker is being rendered, false otherwisepublic final void enableLiveData(java.lang.String domainType)
domainType - a domainType string. Use LiveDataDomainTypes for getting the supported strings as constants.public final void enableLiveData(java.lang.String domainType,
OnLiveLocationUpdateListener onLiveLocationUpdateListener)
domainType - a domainType string. Use LiveDataDomainTypes for getting the supported strings as constants.onLiveLocationUpdateListener - A Listener that returns each location that has received a live updatepublic final void disableLiveData(java.lang.String domainType)
domainType - a domainType string. Use LiveDataDomainTypes for getting the supported strings as constants.public final void onStart()
In your Activity/Fragment:
protected void onStart() {
super.onStart();
if (mapControl != null) {
mapControl.onStart();
}
}
public final void onStop()
In your Activity/Fragment:
protected void onStop() {
super.onStop();
if (mapControl != null) {
mapControl.onStop();
}
}
public final void onPause()
In your Activity/Fragment:
protected void onPause() {
super.onPause();
if (mapControl != null) {
mapControl.onPause();
}
}
public final void onResume()
In your Activity/Fragment:
protected void onResume() {
super.onResume();
if (mapControl != null) {
mapControl.onResume();
}
}
public final void onLowMemory()
In your Activity/Fragment:
protected void onLowMemory() {
super.onLowMemory();
if (mapControl != null) {
mapControl.onLowMemory();
}
}
public final void onSaveInstanceState(android.os.Bundle outState)
In your Activity/Fragment:
protected void onSaveInstanceState( Bundle outState ) {
super.onSaveInstanceState( outState );
if( mMapControl != null ) {
mMapControl.onSaveInstanceState( outState );
}
}
outState - Bundle in which to place your saved state. This value must never be null.public final void onRestoreInstanceState(android.os.Bundle savedInstanceState)
In your Activity/Fragment:
protected void onRestoreInstanceState( Bundle savedInstanceState ) {
super.onRestoreInstanceState( savedInstanceState );
if( mMapControl != null ) {
mMapControl.onRestoreInstanceState( savedInstanceState );
}
}
savedInstanceState - The data most recently supplied in onSaveInstanceState(Bundle). This value must never be null.public final void onDestroy()
In your Activity/Fragment:
protected void onDestroy() {
super.onDestroy();
if (mapControl != null) {
mapControl.onDestroy();
mapControl = null;
}
}
@Deprecated public final void setCacheScheme(int scheme)
@MPTileManager.setTileCacheStrategy(TileCacheStrategy)Options:
TILE_CACHESCHEME_NONE: No caching. this is the default settingTILE_CACHESCHEME_TEMPORARY: Keeps tiles in a memory cache. Keeps tiles while the app is runningTILE_CACHESCHEME_PERSISTENT: Write tiles to files and keeps them while the app is installedTILE_CACHESCHEME_OFFLINE: Extract tiles from a zip package at startupscheme - The caching scheme to use. Default: TILE_CACHESCHEME_NONEpublic final void addOnCameraIdleListener(com.google.android.gms.maps.GoogleMap.OnCameraIdleListener onCameraIdleListener)
Use this method instead of GoogleMap.setOnCameraIdleListener(GoogleMap.OnCameraIdleListener).
* MapControl will forward all GoogleMap.OnCameraIdleListener events to the given callback
onCameraIdleListener - The callback that's invoked. To remove the callback, use removeOnCameraIdleListener(GoogleMap.OnCameraIdleListener)public final void addOnCameraMoveListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveListener onCameraMoveListener)
Use this method instead of GoogleMap.setOnCameraMoveListener(GoogleMap.OnCameraMoveListener).
* MapControl will forward all GoogleMap.OnCameraMoveListener events to the given callback
onCameraMoveListener - The callback that's invoked. To remove the callback, use removeOnCameraMoveListener(GoogleMap.OnCameraMoveListener)public final void addOnCameraMoveCanceledListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveCanceledListener onCameraMoveCanceledListener)
Use this method instead of GoogleMap.setOnCameraMoveCanceledListener(GoogleMap.OnCameraMoveCanceledListener).
* MapControl will forward all GoogleMap.OnCameraMoveCanceledListener events to the given callback
onCameraMoveCanceledListener - The callback that's invoked. To remove the callback, use removeOnCameraMoveCanceledListener(GoogleMap.OnCameraMoveCanceledListener)public final void addOnCameraMoveStartedListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener onCameraMoveStartedListener)
Use this method instead of GoogleMap.setOnCameraIdleListener(GoogleMap.OnCameraIdleListener).
MapControl will forward all GoogleMap.OnCameraMoveStartedListener events to the given callback
onCameraMoveStartedListener - The callback that's invoked. To remove the callback, use removeOnCameraIdleListener(GoogleMap.OnCameraIdleListener)public final void removeOnCameraIdleListener(com.google.android.gms.maps.GoogleMap.OnCameraIdleListener onCameraIdleListener)
addOnCameraIdleListener(GoogleMap.OnCameraIdleListener)onCameraIdleListener - The callback added with addOnCameraIdleListener(GoogleMap.OnCameraIdleListener)public final void removeOnCameraMoveListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveListener onCameraMoveListener)
addOnCameraMoveListener(GoogleMap.OnCameraMoveListener)onCameraMoveListener - The callback added with addOnCameraMoveListener(GoogleMap.OnCameraMoveListener)public final void removeOnCameraMoveCanceledListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveCanceledListener onCameraMoveCanceledListener)
addOnCameraMoveCanceledListener(GoogleMap.OnCameraMoveCanceledListener)onCameraMoveCanceledListener - The callback added with addOnCameraMoveCanceledListener(GoogleMap.OnCameraMoveCanceledListener)public final void removeOnCameraMoveStartedListener(com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener onCameraMoveStartedListener)
addOnCameraMoveStartedListener(GoogleMap.OnCameraMoveStartedListener)onCameraMoveStartedListener - The callback added with addOnCameraMoveStartedListener(GoogleMap.OnCameraMoveStartedListener)public final void setOnCurrentBuildingChangedListener(OnBuildingFoundAtCameraTargetListener onBuildingFoundAtCameraTargetListener)
The current building can be retrieved using getCurrentBuilding()
onBuildingFoundAtCameraTargetListener - Set to null to stop gettingpublic final void setOnCurrentVenueChangedListener(@Nullable
OnVenueFoundAtCameraTargetListener onVenueFoundAtCameraTargetListener)
Venue (its boundaries)onVenueFoundAtCameraTargetListener - Set to null to stop getting updatespublic final void setOnFloorUpdateListener(OnFloorUpdateListener onFloorUpdateListener)
onFloorUpdateListener - Listener object to catch floor changespublic final void setOnLocationClusterClickListener(OnLocationClusterClickListener onLocationClusterClickListener)
OnLocationClusterClickListener handleronLocationClusterClickListener - A custom OnLocationClusterClickListener handler.
Set to null to use the default onepublic final void setOnLocationSelectedListener(OnLocationSelectedListener onLocationSelectedListener)
onLocationSelectedListener - A callback that will be invoked after a MPLocation has been selectedpublic final void setOnMapClickListener(OnMapClickListener onMapClickListener)
GoogleMap.setOnMapClickListener(GoogleMap.OnMapClickListener), because MapControl needs this event.
IMPORTANT: Please note that, unlike most of the other method callbacks in MapControl, this method doesn't return on the UI Thread
Note that the listener is not GoogleMap.OnMapClickListener but OnMapClickListener instead
onMapClickListener - The map click listener. Set to null to remove it.public final void setOnMapLongClickListener(OnMapLongClickListener onMapLongClickListener)
GoogleMap.setOnMapLongClickListener(GoogleMap.OnMapLongClickListener)onMapLongClickListener - The map long click listener. Set to null to remove it.public final void setOnMarkerClickListener(com.google.android.gms.maps.GoogleMap.OnMarkerClickListener onMarkerClickListener)
GoogleMap.setOnMarkerClickListener(GoogleMap.OnMarkerClickListener)onMarkerClickListener - The marker click listener. Set to null to remove it.public final void setOnMarkerDragListener(com.google.android.gms.maps.GoogleMap.OnMarkerDragListener onMarkerDragListener)
onMarkerDragListener - The marker drag listener. Set to null to remove it.public final void setOnMarkerInfoWindowClickListener(com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener onInfoWindowClickListener)
GoogleMap.setOnInfoWindowClickListener, because MapControl needs this event.onInfoWindowClickListener - The marker's info window click listener. Set to null to remove it.public final void setOnMarkerInfoWindowCloseListener(com.google.android.gms.maps.GoogleMap.OnInfoWindowCloseListener onMarkerInfoWindowCloseListener)
GoogleMap.setOnInfoWindowCloseListener, because MapControl needs this event.onMarkerInfoWindowCloseListener - The marker's info window close listener. Set to null to remove it.public final void setOnMarkerInfoWindowLongClickListener(com.google.android.gms.maps.GoogleMap.OnInfoWindowLongClickListener onMarkerInfoWindowLongClickListener)
GoogleMap.setOnInfoWindowClickListener, because MapControl needs this event.onMarkerInfoWindowLongClickListener - The marker's info window click listener. Set to null to remove it.public final void setOnWillUpdateLocationsOnMap(OnWillUpdateLocationsOnMap listener)
public void setMapLabelFont(android.graphics.Typeface typeface,
int color,
boolean showHalo)
typeface - The typeface used for a custom font on the label text.color - The color of the label text.showHalo - Boolean to decide if the label text should have a white shadow/halopublic void setMapLabelTextSize(int textSize)
textSize - The text size for the label in DP