public static interface

CoreApi.Location

com.mapsted.positioning.CoreApi.Location

Class Overview

Use LocationManager to get data based on user location

Summary

Nested Classes
interface CoreApi.Location.NearbyPropertiesChangedListener Listener for changes in nearby properties  
interface CoreApi.Location.PositionAnimationListener Listener for position animation to show user position movement. 
interface CoreApi.Location.PositionChangeListener Listener for position change. 
interface CoreApi.Location.PositionVisibilityListener Listener to show/hide user position  
Public Methods
abstract boolean addNearbyPropertyChangeListener(CoreApi.Location.NearbyPropertiesChangedListener listener)
Add listener for changes in nearby properties
abstract boolean addPositionAnimationListener(CoreApi.Location.PositionAnimationListener listener)
add listener to get position for animation purpose.
abstract boolean addPositionChangeListener(CoreApi.Location.PositionChangeListener listener)
Get updates when user position changes
abstract boolean addPositionVisibilityChange(CoreApi.Location.PositionVisibilityListener listener)
add listener to get update about whether position should be visible or not
abstract void enableSnapBlueDotToRoute(boolean enable)
When enabled, if the user is in navigation mode and the blue dot is nearby the routing path, it will attempt to snap the blue dot to the routing path
abstract IZone getCurrentUserZone()
Get an IZone where the user currently located.
abstract Position getLastKnownPosition()
get last known user position which may be null.
abstract boolean getLastPositionVisibility()
get last info about whether position should be visible or not.
abstract void getNearByEntities(Consumer<List<EntityZoneDistance>> callback)
Get list of nearby entities
abstract Set<Integer> getNearbyProperties()
Gets HashSet of nearby properties
abstract void getQuickRoughEstimate(FusedGpsLocationManager.Listener locationListener)
Get a quick fuzzy location.
abstract boolean hasInit()
Check if current user position exists or not.
abstract CoreApi.Heading heading()
Get access to heading-related information and utilities
abstract boolean isSnapBlueDotToRouteEnabled()
abstract boolean removeNearbyPropertyChangeListener(CoreApi.Location.NearbyPropertiesChangedListener listener)
remove listener
abstract boolean removePositionAnimationListener(CoreApi.Location.PositionAnimationListener listener)
remove listener
abstract boolean removePositionChangeListener(CoreApi.Location.PositionChangeListener listener)
remove listener
abstract boolean removePositionVisibilityChange(CoreApi.Location.PositionVisibilityListener listener)
remove listener

Public Methods

public abstract boolean addNearbyPropertyChangeListener (CoreApi.Location.NearbyPropertiesChangedListener listener)

Add listener for changes in nearby properties

public abstract boolean addPositionAnimationListener (CoreApi.Location.PositionAnimationListener listener)

add listener to get position for animation purpose. This listener may get notified several times in a short period of time, so keep the logic only for ui update.

public abstract boolean addPositionChangeListener (CoreApi.Location.PositionChangeListener listener)

Get updates when user position changes

public abstract boolean addPositionVisibilityChange (CoreApi.Location.PositionVisibilityListener listener)

add listener to get update about whether position should be visible or not

public abstract void enableSnapBlueDotToRoute (boolean enable)

When enabled, if the user is in navigation mode and the blue dot is nearby the routing path, it will attempt to snap the blue dot to the routing path

Parameters
enable whether or not to enable the feature

public abstract IZone getCurrentUserZone ()

Get an IZone where the user currently located.

Returns
  • Returns the zone where the user current location. See IZone
See Also

public abstract Position getLastKnownPosition ()

get last known user position which may be null.

public abstract boolean getLastPositionVisibility ()

get last info about whether position should be visible or not. May be null.

public abstract void getNearByEntities (Consumer<List<EntityZoneDistance>> callback)

Get list of nearby entities

Parameters
callback with sorted list of EntityZoneDistance each containing entity's id information and distance to the user. This might return an empty list if user position is unknown.

public abstract Set<Integer> getNearbyProperties ()

Gets HashSet of nearby properties

Returns
  • set of propertyIds

public abstract void getQuickRoughEstimate (FusedGpsLocationManager.Listener locationListener)

Get a quick fuzzy location.

Use this function when initializing the location because the accurate location takes a long time. Note that this method requires setup().startLocationServices to have been called first

Parameters
locationListener LocationListener

public abstract boolean hasInit ()

Check if current user position exists or not.

Returns
  • A boolean representing if the user position exists or not.

public abstract CoreApi.Heading heading ()

Get access to heading-related information and utilities

Returns
  • reference to heading interface

public abstract boolean isSnapBlueDotToRouteEnabled ()

Returns
  • Whether or not the snapping blue doe to route path feature is enabled

public abstract boolean removeNearbyPropertyChangeListener (CoreApi.Location.NearbyPropertiesChangedListener listener)

public abstract boolean removePositionAnimationListener (CoreApi.Location.PositionAnimationListener listener)

public abstract boolean removePositionChangeListener (CoreApi.Location.PositionChangeListener listener)

public abstract boolean removePositionVisibilityChange (CoreApi.Location.PositionVisibilityListener listener)