com.esri.android.map
Class LocationService

java.lang.Object
  extended by com.esri.android.map.LocationService

public class LocationService
extends Object

Class providing UI support to display the current location of the device on a MapView.


Nested Class Summary
protected  class LocationService.LocationServiceInner
           
 
Constructor Summary
LocationService(MapView map)
           
 
Method Summary
 android.location.Location getLocation()
          Returns the current location in the spatial reference WGS1984 (WKID=4326).
 android.location.LocationListener getLocationListener()
           
 OnSingleTapListener getOnSingleTapListener()
          Returns the current listener for the single tap event on the LocationService symbol.
 Point getPoint()
          Returns the current coordinates in the map's spatial reference.
 Symbol getSymbol()
           
 boolean isAccuracyCircleOn()
           
 boolean isAllowNetworkLocation()
           
 boolean isAutoPan()
           
 boolean isBearingOn()
           
 boolean isStarted()
           
 void setAccuracyCircleOn(boolean accuracyCircleOn)
           
 void setAllowNetworkLocation(boolean allowNetworkLocation)
          Allow/disallow the usage of the network (cellular network and WiFi if available) to determine the current location
 void setAutoPan(boolean autoPan)
          activate/deactivate the autoPan
 void setBearing(boolean bearing)
          activate/deactivate the bearing representation.
 void setLocationListener(android.location.LocationListener locationListener)
           
 void setOnSingleTapListener(OnSingleTapListener onSingleTapListener)
          Sets a listener overriding the default behavior of a single tap on the LocationService symbol.
 void setSymbol(Symbol symbol)
           
 void start()
          Starts the LocationService.
 void stop()
          Stops the LocationService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationService

public LocationService(MapView map)
Parameters:
map - the MapView the location will be displayed on.
Method Detail

start

public void start()
Starts the LocationService.


stop

public void stop()
Stops the LocationService


getLocation

public android.location.Location getLocation()
Returns the current location in the spatial reference WGS1984 (WKID=4326). Other information are available. see Location.

Returns:
the current location

getPoint

public Point getPoint()
Returns the current coordinates in the map's spatial reference.

Returns:
the Point containing the coordinates.

getSymbol

public Symbol getSymbol()
Returns:
the symbol used to represent the current location.

setOnSingleTapListener

public void setOnSingleTapListener(OnSingleTapListener onSingleTapListener)
Sets a listener overriding the default behavior of a single tap on the LocationService symbol.

Parameters:
onSingleTapListener - the onSingleTapListener to set

getOnSingleTapListener

public OnSingleTapListener getOnSingleTapListener()
Returns the current listener for the single tap event on the LocationService symbol.

Returns:
the onSingleTapListener

isBearingOn

public boolean isBearingOn()
Returns:
whether the bearing (direction of travel) is taken into account.

isStarted

public boolean isStarted()
Returns:
if the LocationService is activated.

isAutoPan

public boolean isAutoPan()
Returns:
whether the autoPan is activated or not.

getLocationListener

public android.location.LocationListener getLocationListener()
Returns:
the locationListener

setLocationListener

public void setLocationListener(android.location.LocationListener locationListener)
Parameters:
locationListener - the locationListener to set

setAutoPan

public void setAutoPan(boolean autoPan)
activate/deactivate the autoPan

Parameters:
autoPan - the flag for the autoPan (default: true)

setBearing

public void setBearing(boolean bearing)
activate/deactivate the bearing representation.

Parameters:
bearing - flag for the bearing (default: true)

setSymbol

public void setSymbol(Symbol symbol)
Parameters:
symbol - the symbol to set

isAllowNetworkLocation

public boolean isAllowNetworkLocation()
Returns:
whether the network (cellular network and WiFi if available) should be used to determine the current location

setAllowNetworkLocation

public void setAllowNetworkLocation(boolean allowNetworkLocation)
Allow/disallow the usage of the network (cellular network and WiFi if available) to determine the current location

Parameters:
allowNetworkLocation - the flag for the usage of the network (default: true)

isAccuracyCircleOn

public boolean isAccuracyCircleOn()
Returns:
the accuracyCircleOn

setAccuracyCircleOn

public void setAccuracyCircleOn(boolean accuracyCircleOn)
Parameters:
accuracyCircleOn - the accuracyCircleOn to set


Copyright © 2010. All Rights Reserved.