MapControl

class MapControl

Constructors

Link copied to clipboard
@UiThread
open fun MapControl(@NonNull context: Context)
Creates a MapControl instance without having a Google Map object available Use setGoogleMap to set the GoogleMap object and its parent view

Types

Link copied to clipboard
annotation class FloorTileSize
Floor tiles supported sizes (in pixels) Note that tile sizes depend on the Solution set (it is not mandatory for all MapsIndoors solutions to support all tile sizes)
Link copied to clipboard
annotation class TileCacheScheme

Functions

Link copied to clipboard
fun addDisplayRule(locationDisplayRule: LocationDisplayRule)
Adds a custom display rule
fun addDisplayRule(locationDisplayRule: LocationDisplayRule, onResultReadyListener: OnResultReadyListener)
Adds a new display rule
Link copied to clipboard
fun addDisplayRules(displayRuleList: List<LocationDisplayRule>)
Adds a new set of custom display rules
fun addDisplayRules(displayRuleList: List<LocationDisplayRule>, onResultReadyListener: OnResultReadyListener)
Add rules needed to display locations correctly.
Link copied to clipboard
fun addOnCameraIdleListener(onCameraIdleListener: GoogleMap.OnCameraIdleListener)
Adds a callback that's invoked when camera movement has ended.
Link copied to clipboard
fun addOnCameraMoveCanceledListener(onCameraMoveCanceledListener: GoogleMap.OnCameraMoveCanceledListener)
Adds a callback that's invoked when camera motion is stopped or interrupted by a new type of animation.
Link copied to clipboard
fun addOnCameraMoveListener(onCameraMoveListener: GoogleMap.OnCameraMoveListener)
Adds a callback that's invoked repeatedly while the camera is in motion.
Link copied to clipboard
fun addOnCameraMoveStartedListener(onCameraMoveStartedListener: GoogleMap.OnCameraMoveStartedListener)
Adds a callback that's invoked when the camera starts moving or the reason for camera motion has changed.
Link copied to clipboard
@UiThread
fun bindToMap(googleMap: GoogleMap, view: View)
Binds MapControl to the given GoogleMap and view objects
Link copied to clipboard
@UiThread
fun clearMap()
Invoke this method to restore the map to its default state (POIs shown based on their display rules, etc.
Link copied to clipboard
@UiThread
fun deSelectLocation()
Call this to deselect a location previously selected with selectLocation
Link copied to clipboard
fun disableLiveData(domainType: String)
Disables live data on a specific domainType
Link copied to clipboard
@AnyThread
fun displaySearchResults(@NonNull locations: List<MPLocation>): Boolean
@AnyThread
fun displaySearchResults(@NonNull locations: List<MPLocation>, animateCamera: Boolean): Boolean
@AnyThread
fun displaySearchResults(@NonNull locations: List<MPLocation>, @Nullable readyListener: ReadyListener): Boolean
@AnyThread
fun displaySearchResults(    @NonNull locations: List<MPLocation>,     animateCamera: Boolean,     cameraPadding: Int): Boolean
@AnyThread
fun displaySearchResults(    @NonNull locations: List<MPLocation>,     animateCamera: Boolean,     cameraPadding: Int,     showInfoWindow: Boolean): Boolean
@AnyThread
fun displaySearchResults(    @NonNull locations: List<MPLocation>,     animateCamera: Boolean,     cameraPadding: Int,     @Nullable readyListener: ReadyListener): Boolean
@AnyThread
fun displaySearchResults(    @NonNull locations: List<MPLocation>,     animateCamera: Boolean,     cameraPadding: Int,     showInfoWindow: Boolean,     @Nullable googleMapCameraUpdate: CameraUpdate,     durationMs: Int,     googleMapCancelableCallback: GoogleMap.CancelableCallback): Boolean
@AnyThread
fun displaySearchResults(    @NonNull locations: List<MPLocation>,     animateCamera: Boolean,     cameraPadding: Int,     showInfoWindow: Boolean,     @Nullable googleMapCameraUpdate: CameraUpdate,     durationMs: Int,     googleMapCancelableCallback: GoogleMap.CancelableCallback,     @Nullable readyListener: ReadyListener): Boolean
Use this method to display temporary locations, not points of interests location.
Link copied to clipboard
@UiThread
fun enableClickedPOIHighlight(enable: Boolean)
Enables/disables POI area highlighting Enabled by default
Link copied to clipboard
fun enableFloorSelector(enable: Boolean)
Enables or disables the FloorSelectorInterface, i.e.
Link copied to clipboard
fun enableLiveData(domainType: String)
Enables live data on a specific domain and uses MapsIndoors standard graphic implementation
fun enableLiveData(domainType: String, onLiveLocationUpdateListener: OnLiveLocationUpdateListener)
Enables live data on a specific domain
Link copied to clipboard
@AnyThread
fun getClickedPOIHighlightFillColor(): Int
Get the selected area's fill color
Link copied to clipboard
@AnyThread
fun getClickedPOIHighlightOutlineStrokeColor(): Int
Get the selected area's stroke color
Link copied to clipboard
@AnyThread
fun getClickedPOIHighlightOutlineStrokeWidth(): Float
Get the selected area's stroke width
Link copied to clipboard
@AnyThread
fun getClickedPOIHighlightShowingZoomLevel(): Float
Get the zoom level a selected area will start showing
Link copied to clipboard
@Nullable
fun getCurrentBuilding(): Building
Returns the current visible Building (the one having the viewport's center/target within its bounding box or closest to any of its contour)
Link copied to clipboard
@Nullable
fun getCurrentBuildingFloor(): Floor
Returns the current Floor of the current Building in focus
Link copied to clipboard
fun getCurrentFloorIndex(): Int
Returns the current selected floor index
Link copied to clipboard
@Nullable
fun getCurrentPosition(): PositionResult
Get the current user position (blue dot) object
Link copied to clipboard
@NonNull
fun getDefaultDisplayRule(): LocationDisplayRule
Gets the default LocationDisplayRule
Link copied to clipboard
@Nullable
@AnyThread
fun getDisplayRule(@Nullable location: MPLocation): LocationDisplayRule
Gets the LocationDisplayRule currently being used by the given MPLocation
@Nullable
fun getDisplayRule(type: String): LocationDisplayRule
Gets the LocationDisplayRule with the given type (name)
Link copied to clipboard
@NonNull
fun getDisplayRules(): List<LocationDisplayRule>
Gets the full list of LocationDisplayRule, if available
Link copied to clipboard
@Nullable
@AnyThread
fun getDisplayRulesForLocations(@NonNull locations: List<MPLocation>): HashMap<String, LocationDisplayRule>
Gets the LocationDisplayRules currently being used by the given MPLocations
Link copied to clipboard
@Nullable
fun getFloorSelector(): FloorSelectorInterface
Get the floor selector control object.
Link copied to clipboard
@Nullable
fun getLocation(marker: Marker): MPLocation
Get a MPLocation by marker reference.
Link copied to clipboard
@Nullable
@AnyThread
fun getMapStyle(): MapStyle
Gets the current map style of MapsIndoors tiles
Link copied to clipboard
@NonNull
@AnyThread
fun getMapStyles(): List<MapStyle>
Gets a list of available map styles
Link copied to clipboard
fun getMapViewPaddingBottom(): Int
Gets the Map View bottom padding
Link copied to clipboard
fun getMapViewPaddingEnd(): Int
Gets the Map View right padding
Link copied to clipboard
fun getMapViewPaddingStart(): Int
Gets the Map View left padding
Link copied to clipboard
fun getMapViewPaddingTop(): Int
Gets the Map View top padding
Link copied to clipboard
@NonNull
fun getPositionIndicator(): PositionIndicator
Get the position indicator (user location icon)
Link copied to clipboard
@NonNull
fun getPositionMarker(): PositionIndicator
Get the current user position (blue dot) object
Link copied to clipboard
fun getSearchResultCount(): Int
Gets the last search result object count
Link copied to clipboard
@NonNull
fun getSearchResults(): List<MPLocation>
Get the search results from the last call to any of the displaySearchResults() methods
Link copied to clipboard
@UiThread
fun init(onLoadingDataReadyListener: OnLoadingDataReadyListener)
Initializes MapControl
Link copied to clipboard
fun isFloorSelectorEnabled(): Boolean
Returns the current state of the current FloorSelectorInterface.
Link copied to clipboard
@AnyThread
fun isPOIHighlightEnabled(): Boolean
Checks if location area highlight is enabled
Link copied to clipboard
fun isReady(): Boolean
Returns true if MapControl has been initialized and is ready to be used
Link copied to clipboard
fun isTrackingPosition(): Boolean
Checks whether position tracking is enabled or not
Link copied to clipboard
fun isUserPositionShown(): Boolean
Returns the current visibility state of the user location icon (blue dot)
Link copied to clipboard
fun onDestroy()
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
fun onLowMemory()
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
fun onPause()
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
fun onRestoreInstanceState(savedInstanceState: Bundle)
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
fun onResume()
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
fun onSaveInstanceState(outState: Bundle)
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
fun onStart()
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
fun onStop()
Call this method from the parent Activity/Fragment's corresponding method.
Link copied to clipboard
@AnyThread
fun refreshMap()
Forces a map update
Link copied to clipboard
fun removeOnCameraIdleListener(onCameraIdleListener: GoogleMap.OnCameraIdleListener)
Removes the callback added with addOnCameraIdleListener
Link copied to clipboard
fun removeOnCameraMoveCanceledListener(onCameraMoveCanceledListener: GoogleMap.OnCameraMoveCanceledListener)
Removes the callback added with addOnCameraMoveCanceledListener
Link copied to clipboard
fun removeOnCameraMoveListener(onCameraMoveListener: GoogleMap.OnCameraMoveListener)
Removes the callback added with addOnCameraMoveListener
Link copied to clipboard
fun removeOnCameraMoveStartedListener(onCameraMoveStartedListener: GoogleMap.OnCameraMoveStartedListener)
Removes the callback added with addOnCameraMoveStartedListener
Link copied to clipboard
@AnyThread
fun resetDisplayRule(@Nullable location: MPLocation)
Sets the display rule of the given MPLocation to its default one (set from the CMS)
@AnyThread
fun resetDisplayRule(@Nullable locations: List<MPLocation>)
Sets the display rule of the given MPLocation set to their default one (set from the CMS)
Link copied to clipboard
@UiThread
fun selectFloor(floorIndex: Int)
Sets the current visible floor to the given z-index one For floor names/z-index pairs check the value returned by getFloorHashMap
Link copied to clipboard
@UiThread
fun selectLocation(@Nullable location: MPLocation)
@UiThread
fun selectLocation(@Nullable location: MPLocation, zoomToLocationMinZoomLevel: Boolean)
@UiThread
fun selectLocation(    @Nullable location: MPLocation,     animateCamera: Boolean,     zoomToLocationMinZoomLevel: Boolean,     showInfoWindow: Boolean)
@UiThread
fun selectLocation(    @Nullable location: MPLocation,     animateCamera: Boolean,     zoomToLocationMinZoomLevel: Boolean,     showInfoWindow: Boolean,     userTriggered: Boolean)
Selects the given MPLocation.
Link copied to clipboard
fun setBuildingOutlineShowingZoomLevel(buildingOutlineShowingZoomLevel: Int)
Sets the zoom level from which the building outline should be rendered
Link copied to clipboard
fun setBuildingOutlineStrokeColor(strokeColor: Int)
Sets the building outline color
Link copied to clipboard
fun setCacheScheme(scheme: Int)
Sets a caching scheme for tiles Options:
Link copied to clipboard
@UiThread
fun setClickedPOIHighlightFillColor(fillColor: Int)
Sets the selected area's fill color
Link copied to clipboard
@UiThread
fun setClickedPOIHighlightOutlineStrokeColor(strokeColor: Int)
Sets the selected area's stroke color
Link copied to clipboard
@UiThread
fun setClickedPOIHighlightOutlineStrokeWidth(strokeWidth: Float)
Sets the selected area's stroke width
Link copied to clipboard
@UiThread
fun setClickedPOIHighlightShowingZoomLevel(zoomLevel: Float)
Sets the zoom level a selected area will start showing
Link copied to clipboard
@AnyThread
fun setCurrentPosition(position: PositionResult)
Manually sets the user ("blue dot") position
Link copied to clipboard
fun setDefaultDisplayRule(displayRule: LocationDisplayRule)
Sets the default LocationDisplayRuleThe default display settings used by MPMapControl to display a location.
Link copied to clipboard
@AnyThread
fun setDisplayRule(@Nullable displayRule: LocationDisplayRule, @Nullable location: MPLocation)
Sets a LocationDisplayRule on a single MPLocationThis display rule takes precedence over more general displayrules like the type-display-rule
@AnyThread
fun setDisplayRule(@Nullable displayRule: LocationDisplayRule, @Nullable locations: List<MPLocation>)
Sets a LocationDisplayRule on given MPLocation set This display rule takes precedence over more general displayrules like the type-display-rule
@AnyThread
fun setDisplayRule(@Nullable displayRuleName: String, @Nullable location: MPLocation)
Sets a LocationDisplayRule on the given MPLocationThis display rule takes precedence over more general display rules like the type-display-rule
@AnyThread
fun setDisplayRule(@Nullable displayRuleName: String, @Nullable locations: List<MPLocation>)
Sets a LocationDisplayRule on the given MPLocation set This display rule takes precedence over more general display rules like the type-display-rule
Link copied to clipboard
fun setDisplayRuleDefaultIconSize(size: Int)
Overwrites the display rules default icon size Applies only to those display rules that don't specify the size
Link copied to clipboard
fun setDisplayRuleDefaultLabelMaxCharLength(maxCharLength: Int)
Overwrites the label's max char length on ALL display rules
Link copied to clipboard
fun setFloorSelector(floorSelector: FloorSelectorInterface)
Replaces the embedded FloorSelector with the given custom one.
Link copied to clipboard
@UiThread
fun setGoogleMap(@NonNull googleMap: GoogleMap, @NonNull view: View)
Sets the Google Map and its parent view
Link copied to clipboard
@UiThread
fun setInfoWindowAdapter(adapter: GoogleMap.InfoWindowAdapter)
A convenience setInfoWindowAdapter wrapper
Link copied to clipboard
fun setLocationClusterImageAdapter(locationClusterImageAdapter: MPLocationClusterImageAdapter)
Sets the given MPLocationClusterImageAdapter handler
Link copied to clipboard
fun setLocationClusteringEnabled(enable: Boolean)
Enables/disables marker clustering At the moment, invoking this method once MapControl.init() has been called, has no effect
Link copied to clipboard
fun setLocationHideOnIconOverlapEnabled(enable: Boolean)
Enables/disables marker hiding on icon overlap This method enables/disables hiding icons when colliding with others
Link copied to clipboard
open fun setMapLabelFont(    typeface: Typeface,     color: Int,     showHalo: Boolean)
Changes the font of the maps marker labels
Link copied to clipboard
open fun setMapLabelTextSize(textSize: Int)
Changes the text size of the maps marker labels
Link copied to clipboard
fun setMapPadding(    start: Int,     top: Int,     end: Int,     bottom: Int)
Sets padding on the map
Link copied to clipboard
@UiThread
fun setMapStyle(mapStyle: MapStyle)
Sets the map style for MapsIndoors tiles
Link copied to clipboard
fun setOnCurrentBuildingChangedListener(onBuildingFoundAtCameraTargetListener: OnBuildingFoundAtCameraTargetListener)
Receive notifications when the current building changes The current building can be retrieved using getCurrentBuilding
Link copied to clipboard
fun setOnCurrentVenueChangedListener(@Nullable onVenueFoundAtCameraTargetListener: OnVenueFoundAtCameraTargetListener)
Receive notifications when the map camera target enters a Venue (its boundaries)
Link copied to clipboard
fun setOnFloorUpdateListener(onFloorUpdateListener: OnFloorUpdateListener)
Set up a listener object to catch floor changes made by either the user or the positioning service
Link copied to clipboard
fun setOnLocationClusterClickListener(onLocationClusterClickListener: OnLocationClusterClickListener)
Sets the given OnLocationClusterClickListener handler
Link copied to clipboard
fun setOnLocationSelectedListener(onLocationSelectedListener: OnLocationSelectedListener)
Sets a listener for when a location gets selected (programmatically or user-triggered)
Link copied to clipboard
fun setOnMapClickListener(onMapClickListener: OnMapClickListener)
Set the map click listener.
Link copied to clipboard
fun setOnMapLongClickListener(onMapLongClickListener: OnMapLongClickListener)
Sets the long map click listener.
Link copied to clipboard
fun setOnMarkerClickListener(onMarkerClickListener: GoogleMap.OnMarkerClickListener)
Set the marker click listener.
Link copied to clipboard
fun setOnMarkerDragListener(onMarkerDragListener: GoogleMap.OnMarkerDragListener)
Set the marker drag listener.
Link copied to clipboard
fun setOnMarkerInfoWindowClickListener(onInfoWindowClickListener: GoogleMap.OnInfoWindowClickListener)
Set the marker info window click listener.
Link copied to clipboard
fun setOnMarkerInfoWindowCloseListener(onMarkerInfoWindowCloseListener: GoogleMap.OnInfoWindowCloseListener)
Set the marker info window click listener.
Link copied to clipboard
fun setOnMarkerInfoWindowLongClickListener(onMarkerInfoWindowLongClickListener: GoogleMap.OnInfoWindowLongClickListener)
Set the marker info window long click listener.
Link copied to clipboard
fun setOnWillUpdateLocationsOnMap(listener: OnWillUpdateLocationsOnMap)
Link copied to clipboard
open fun setTileFadeIn(enableTileFadeIn: Boolean)
Enable fade-in effect on MapsIndoors tiles.
Link copied to clipboard
fun setTileSize(@NonNull tileSize: TileSize)
fun setTileSize(tileSize: Int)
Set the indoor floor tile-size for rendering.
Link copied to clipboard
fun setTrackingPositionTiltAngle(angle: Float)
When in tracking mode, sets the camera's tilt to the given one
Link copied to clipboard
@UiThread
fun setUserLocationIconFromDisplayRule(locationDisplayRule: LocationDisplayRule): Boolean
Sets the "my location" marker's (aka blue dot) icon using the given LocationDisplayRule
Link copied to clipboard
fun showBuildingOutline(show: Boolean)
Enables the rendering of the Building on focus's floor outline
Link copied to clipboard
@AnyThread
fun showInfoWindowOnClickedLocation(show: Boolean)
Enables/disables the info window on user-selected locations The info window is shown by default when the user selects a location (by tapping on it)
Link copied to clipboard
fun showUserPosition(show: Boolean)
Renders the icon set with setUserLocationIconFromDisplayRule at the last known user position on the map
Link copied to clipboard
fun trackUserPosition(enableTracking: Boolean): Boolean
fun trackUserPosition(enableTracking: Boolean, bearingCoupledWithCamera: Boolean): Boolean
Enables/disables user position tracking (camera following the blue-dot marker)
Link copied to clipboard
@UiThread
fun unbindFromMap()
Unbinds MapControl from the current GoogleMap and view it's attached to
Link copied to clipboard
@AnyThread
fun updatePosition(positionResult: PositionResult)
Updates the blue dot, whatever its status is

Properties

Link copied to clipboard
val TILE_CACHESCHEME_NONE: Int
No caching.
Link copied to clipboard
val TILE_CACHESCHEME_OFFLINE: Int
Extracts tiles from a zip package at startup
Link copied to clipboard
val TILE_CACHESCHEME_PERSISTENT: Int
Writes tiles to files and keeps them while the app is installed
Link copied to clipboard
val TILE_CACHESCHEME_TEMPORARY: Int
Keeps tiles in a memory cache.
Link copied to clipboard
val TILE_SIZE_X1: Int
A 256x256 pixel tile
Link copied to clipboard
val TILE_SIZE_X2: Int
A 512x512 pixel tile