com.supermap.plugin
Class LocationManagePlugin
- java.lang.Object
-
- com.supermap.plugin.LocationManagePlugin
-
public class LocationManagePlugin extends java.lang.ObjectThe location management plug-in. Now it supports to get the current location from the GPS device.When using the navigation function, you must use this class to get GPSData for real navigation and cruise.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classLocationManagePlugin.GPSDataThis class is the inner class ofLocationManagePlugin, which identifies the detailed information of the current GPS data, such as: longitude, latitude, azimuth and so on.static classLocationManagePlugin.SatelliteThis class is the inter class ofLocationManagePlugin, which identifies the satellites information used to locate, including location, azimuth, signal strength and so on.
-
Constructor Summary
Constructors Constructor and Description LocationManagePlugin()Constructs a new location management plug-in.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaddLocationChangedListener(LocationChangedListener locationChangedListener)Adds the listener of location changes.booleanaddSatelliteStatusListener(SatelliteStatusListener satelliteStatusListener)Adds satellite status listener.voidcloseGpsDevice()Closes the GPS device.longgetTimeInterval()Gets the time interval.booleanopenGpsDevice(android.location.LocationManager loc)Starts the GPS device.booleanremoveLocationChangedListener(LocationChangedListener locationChangedListener)Removes the change listener with the specified location.booleanremoveSatelliteStatusListener(SatelliteStatusListener satelliteStatusListener)Removes the specified satellite status listener.voidsetTimeInterval(long interval)Sets time interval.
-
-
-
Constructor Detail
-
LocationManagePlugin
public LocationManagePlugin()
Constructs a new location management plug-in.
-
-
Method Detail
-
openGpsDevice
public boolean openGpsDevice(android.location.LocationManager loc)
Starts the GPS device.- Parameters:
loc- android The location manager of android.- Returns:
- A boolean. Return true if successful; otherwise, false.
-
closeGpsDevice
public void closeGpsDevice()
Closes the GPS device.
-
setTimeInterval
public void setTimeInterval(long interval)
Sets time interval.- Parameters:
interval- Time interval. The unit is millisecond.
-
getTimeInterval
public long getTimeInterval()
Gets the time interval.- Returns:
- Time interval.
-
addLocationChangedListener
public boolean addLocationChangedListener(LocationChangedListener locationChangedListener)
Adds the listener of location changes.- Parameters:
locationChangedListener- location change listener.- Returns:
- a boolean value, add a position to change the listener successfully returns true, otherwise it returns false.
-
removeLocationChangedListener
public boolean removeLocationChangedListener(LocationChangedListener locationChangedListener)
Removes the change listener with the specified location.- Parameters:
locationChangedListener- ChangedListener location change listener.- Returns:
- a boolean value, remove the specified location change the listener successfully returns true, otherwise it returns false.
-
addSatelliteStatusListener
public boolean addSatelliteStatusListener(SatelliteStatusListener satelliteStatusListener)
Adds satellite status listener.- Parameters:
satelliteStatusListener- satellite information change listener- Returns:
- adds a listening that is null and returns false; otherwise it returns true.
-
removeSatelliteStatusListener
public boolean removeSatelliteStatusListener(SatelliteStatusListener satelliteStatusListener)
Removes the specified satellite status listener.- Parameters:
satelliteStatusListener- satellite information change listener- Returns:
- Returns true if the specified listener object is found, false otherwise;
-
-