com.micello.mapapi.standard
Class MicelloLocationManager

java.lang.Object
  extended by com.micello.mapapi.standard.MicelloLocationManager
All Implemented Interfaces:
MapViewListener

public class MicelloLocationManager
extends java.lang.Object
implements MapViewListener

This class manages the location and orientation for the user on the map. For location it uses an instance of MLocationProvider to get the location. For orientation, it used the device companss.


Field Summary
static java.lang.String LOCATION_LAYER_NAME
          This is the layer name for the location layer.
 
Constructor Summary
MicelloLocationManager(Context context)
          This class managers location and orientation.
 
Method Summary
 boolean compassEnabled()
          This method returns true if the compass is enabled.
 void connect(MicelloManager micelloManager)
          This method connects the MicelloLocationManager to the map associated with the given MicelloManager.
 void disableCompass()
          This method disables the compass.
 void disableLocation()
          This method disables location.
 void disconnect(MicelloManager micelloManager)
          This method disconnects the MicelloLocationManager from the map associated with the given MicelloManager.
 void enableCompass()
          This method enables the compass.
 void enableLocation()
          This method enables location.
 MLatLonPoint getCurrentLocation()
          The best known current location, or null if no location is known.
 boolean locationEnabled()
          This method returns true if location is enabled.
 void onAccuracyChanged(Sensor sensor, int accuracy)
          This is a part of the SensorEventListener.
 void onLocationChanged(MLatLonPoint latLonPoint, float errorMeters)
          This method should be called when a new location is available.
 void onSensorChanged(SensorEvent event)
          This is a part of the SensorEventListener.
 void setLocationProvider(MLocationProvider locationProvider)
          This method sets the location provider
 void setMapView(MicelloMapView mapView)
          This method sets the MapView, which is the receiver for location and orientation.
 void showErrorRadius(boolean showError)
          This function contorls whether the error radius is shown or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATION_LAYER_NAME

public static final java.lang.String LOCATION_LAYER_NAME
This is the layer name for the location layer.

See Also:
Constant Field Values
Constructor Detail

MicelloLocationManager

public MicelloLocationManager(Context context)
This class managers location and orientation.

Parameters:
context - The context
MicelloManager - The Micello manager for this map data
Method Detail

connect

public void connect(MicelloManager micelloManager)
This method connects the MicelloLocationManager to the map associated with the given MicelloManager.

Parameters:
micelloManager - The MicelloManager associated with the map.

disconnect

public void disconnect(MicelloManager micelloManager)
This method disconnects the MicelloLocationManager from the map associated with the given MicelloManager.

Parameters:
micelloManager - The MicelloManager associated with the map.

showErrorRadius

public void showErrorRadius(boolean showError)
This function contorls whether the error radius is shown or not. By default the error radius is shown.


setLocationProvider

public void setLocationProvider(MLocationProvider locationProvider)
This method sets the location provider

Parameters:
locationProvider - The location provider

setMapView

public void setMapView(MicelloMapView mapView)
This method sets the MapView, which is the receiver for location and orientation.

Specified by:
setMapView in interface MapViewListener
Parameters:
mapView - The MicelloMapView object. This will be null if the mapView is made inactive.

getCurrentLocation

public MLatLonPoint getCurrentLocation()
The best known current location, or null if no location is known.

Returns:
The most recently known location

enableLocation

public void enableLocation()
This method enables location.


disableLocation

public void disableLocation()
This method disables location.


locationEnabled

public boolean locationEnabled()
This method returns true if location is enabled.


enableCompass

public void enableCompass()
This method enables the compass.


disableCompass

public void disableCompass()
This method disables the compass.


compassEnabled

public boolean compassEnabled()
This method returns true if the compass is enabled.


onLocationChanged

public void onLocationChanged(MLatLonPoint latLonPoint,
                              float errorMeters)
This method should be called when a new location is available. latLonPoint The location errorMeters The position uncertainty in meters. If the uncertainty is unknown, pass in the value 0.


onAccuracyChanged

public void onAccuracyChanged(Sensor sensor,
                              int accuracy)
This is a part of the SensorEventListener.


onSensorChanged

public void onSensorChanged(SensorEvent event)
This is a part of the SensorEventListener.