本文整理匯總了Java中com.baidu.location.LocationClient.isStarted方法的典型用法代碼示例。如果您正苦於以下問題:Java LocationClient.isStarted方法的具體用法?Java LocationClient.isStarted怎麽用?Java LocationClient.isStarted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.baidu.location.LocationClient
的用法示例。
在下文中一共展示了LocationClient.isStarted方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initMap
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initMap() {
mlocationClient = new LocationClient(this);
// mlistener = new MylocationListener();
// mlocationClient.registerLocationListener(mlistener);
LocationClientOption mOption = new LocationClientOption();
//設置坐標類型
mOption.setCoorType("bd09ll");
//設置是否需要地址信息,默認為無地址
mOption.setIsNeedAddress(true);
//設置是否打開gps進行定位
mOption.setOpenGps(true);
//設置掃描間隔,單位是毫秒 當<1000(1s)時,定時定位無效
int span = 10000;
mOption.setScanSpan(span);
//設置 LocationClientOption
mlocationClient.setLocOption(mOption);
if (!mlocationClient.isStarted()) {
mlocationClient.start();
}
UiSettings settings = routeBaiduMap.getUiSettings();
settings.setScrollGesturesEnabled(true);
}
示例2: initMap
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initMap() {
mlocationClient = new LocationClient(this);
// mlistener = new MylocationListener();
// mlocationClient.registerLocationListener(mlistener);
LocationClientOption mOption = new LocationClientOption();
//設置坐標類型
mOption.setCoorType("bd09ll");
//設置是否需要地址信息,默認為無地址
mOption.setIsNeedAddress(true);
//設置是否打開gps進行定位
mOption.setOpenGps(true);
//設置掃描間隔,單位是毫秒 當<1000(1s)時,定時定位無效
int span = 10000;
mOption.setScanSpan(span);
//設置 LocationClientOption
mlocationClient.setLocOption(mOption);
if (!mlocationClient.isStarted()) {
mlocationClient.start();
}
UiSettings settings = routeBaiduMap.getUiSettings();
settings.setScrollGesturesEnabled(true);
}
示例3: startPosition
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
public void startPosition() {
mLocationClient = new LocationClient(context);
mMyLocationListener = new MyLocationListener();
mLocationClient.registerLocationListener(mMyLocationListener);
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationMode.Hight_Accuracy);//設置定位模式
option.setCoorType("bd09ll");//返回的定位結果是百度經緯度,默認值gcj02
option.setScanSpan(5000);//設置發起定位請求的間隔時間為5000ms
option.setIsNeedAddress(true);//返回的定位結果包含地址信息
option.setNeedDeviceDirect(true);//返回的定位結果包含手機機頭的方向
mLocationClient.setLocOption(option);
mLocationClient.start();
if (mLocationClient != null && mLocationClient.isStarted())
mLocationClient.requestLocation();
else
Log.d(TAG, "locClient is null or not started");
}
示例4: getLoc
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
public void getLoc() {
myListener = new MyLocationListener(MapActivity.this,
(MapView)findViewById(R.id.bmapsView));
mLocationClient = new LocationClient(getApplicationContext());
mLocationClient.setAccessKey(mk);
mLocationClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationMode.Hight_Accuracy);//設置定位模式
option.setCoorType("bd09ll");//返回的定位結果是百度經緯度,默認值gcj02
option.setScanSpan(5000);
option.setIsNeedAddress(true);//返回的定位結果包含地址信息
option.setNeedDeviceDirect(true);//返回的定位結果包含手機機頭的方向
mLocationClient.setLocOption(option);
if (mLocationClient != null && false == mLocationClient.isStarted()) {
mLocationClient.requestLocation();
mLocationClient.start();
}
else
Log.e("LocSDK3", "locClient is null or not started");
}
示例5: initLocClient
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocClient() {
//������λͼ��
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfigeration(com.baidu.mapapi.map.MyLocationConfigeration.LocationMode.NORMAL, true, null));
// ��λ��ʼ��
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setProdName("bmobchat");// ���ò�Ʒ��
option.setOpenGps(true);// ��gps
option.setCoorType("bd09ll"); // ������������
option.setScanSpan(1000);
option.setOpenGps(true);
option.setIsNeedAddress(true);
option.setIgnoreKillProcess(true);
mLocClient.setLocOption(option);
mLocClient.start();
if (mLocClient != null && mLocClient.isStarted())
mLocClient.requestLocation();
if (lastLocation != null) {
// ��ʾ�ڵ�ͼ��
LatLng ll = new LatLng(lastLocation.getLatitude(),
lastLocation.getLongitude());
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.animateMapStatus(u);
}
}
示例6: initLocClient
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocClient() {
// 開啟定位圖層
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(
MyLocationConfiguration.LocationMode.NORMAL, true, null));
// 定位初始化
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setProdName("bmobim");// 設置產品線
option.setOpenGps(true);// 打開gps
option.setCoorType("bd09ll"); // 設置坐標類型
option.setScanSpan(1000);
option.setOpenGps(true);
option.setIsNeedAddress(true);
option.setIgnoreKillProcess(true);
mLocClient.setLocOption(option);
mLocClient.start();
if (mLocClient != null && mLocClient.isStarted())
mLocClient.requestLocation();
if (lastLocation != null) {
// 顯示在地圖上
LatLng ll = new LatLng(lastLocation.getLatitude(),
lastLocation.getLongitude());
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.animateMapStatus(u);
}
}
示例7: initLocClient
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocClient() {
// ������λͼ��
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfigeration(
com.baidu.mapapi.map.MyLocationConfigeration.LocationMode.NORMAL, true, null));
// ��λ��ʼ��
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setProdName("bmobim");// ���ò�Ʒ��
option.setOpenGps(true);// ��gps
option.setCoorType("bd09ll"); // �����������
option.setScanSpan(1000);
option.setOpenGps(true);
option.setIsNeedAddress(true);
option.setIgnoreKillProcess(true);
mLocClient.setLocOption(option);
mLocClient.start();
if (mLocClient != null && mLocClient.isStarted())
mLocClient.requestLocation();
if (lastLocation != null) {
LatLng ll = new LatLng(lastLocation.getLatitude(),
lastLocation.getLongitude());
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.animateMapStatus(u);
}
}
示例8: initLocClient
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocClient() {
// ������λͼ��
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(com.baidu.mapapi.map.MyLocationConfiguration.LocationMode.NORMAL, true, null));
// ��λ��ʼ��
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setProdName("bmobim");// ���ò�Ʒ��
option.setOpenGps(true);// ��gps
option.setCoorType("bd09ll"); // ������������
option.setScanSpan(1000);
option.setOpenGps(true);
option.setIsNeedAddress(true);
option.setIgnoreKillProcess(true);
mLocClient.setLocOption(option);
mLocClient.start();
if (mLocClient != null && mLocClient.isStarted())
mLocClient.requestLocation();
if (lastLocation != null) {
// ��ʾ�ڵ�ͼ��
LatLng ll = new LatLng(lastLocation.getLatitude(), lastLocation.getLongitude());
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.animateMapStatus(u);
}
}
示例9: initLocClient
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocClient() {
// ������λͼ��
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(
com.baidu.mapapi.map.MyLocationConfiguration.LocationMode.NORMAL, true, null));
// ��λ��ʼ��
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setProdName("bmobim");// ���ò�Ʒ��
option.setOpenGps(true);// ��gps
option.setCoorType("bd09ll"); // ������������
option.setScanSpan(1000);
option.setOpenGps(true);
option.setIsNeedAddress(true);
option.setIgnoreKillProcess(true);
mLocClient.setLocOption(option);
mLocClient.start();
if (mLocClient != null && mLocClient.isStarted())
mLocClient.requestLocation();
if (lastLocation != null) {
// ��ʾ�ڵ�ͼ��
LatLng ll = new LatLng(lastLocation.getLatitude(),
lastLocation.getLongitude());
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.animateMapStatus(u);
}
}
示例10: initLocClient
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocClient() {
// 開啟定位圖層
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfigeration(MyLocationConfigeration.LocationMode.NORMAL,
true, null));
// 定位初始化
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setProdName("bmobim");// 設置產品線
option.setOpenGps(true);// 打開gps
option.setCoorType("bd09ll"); // 設置坐標類型
option.setScanSpan(1000);
option.setOpenGps(true);
option.setIsNeedAddress(true);
option.setIgnoreKillProcess(true);
mLocClient.setLocOption(option);
mLocClient.start();
if (mLocClient != null && mLocClient.isStarted()) mLocClient.requestLocation();
if (lastLocation != null) {
// 顯示在地圖上
LatLng ll = new LatLng(lastLocation.getLatitude(), lastLocation.getLongitude());
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.animateMapStatus(u);
}
}
示例11: startLocation
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void startLocation() {
LocationClient = ((DandelionApplication) getApplication()).mLocationClient;
LocationClient.start();
if (LocationClient != null && LocationClient.isStarted()) {
InitLocation();
LocationClient.requestLocation();
}
}
示例12: initLocClient
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocClient() {
// 開啟定位圖層
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(
com.baidu.mapapi.map.MyLocationConfiguration.LocationMode.NORMAL, true, null));
// 定位初始化
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setProdName("bmobim");// 設置產品線
option.setOpenGps(true);// 打開gps
option.setCoorType("bd09ll"); // 設置坐標類型
option.setScanSpan(1000);
option.setOpenGps(true);
option.setIsNeedAddress(true);
option.setIgnoreKillProcess(true);
mLocClient.setLocOption(option);
mLocClient.start();
if (mLocClient != null && mLocClient.isStarted())
mLocClient.requestLocation();
if (lastLocation != null) {
// 顯示在地圖上
LatLng ll = new LatLng(lastLocation.getLatitude(),
lastLocation.getLongitude());
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.animateMapStatus(u);
}
}
示例13: initLocation
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
private void initLocation() {
mIconLocation = BitmapDescriptorFactory
.fromResource(R.mipmap.location_marker);
locationMode = MyLocationConfiguration.LocationMode.NORMAL;
//定位服務的客戶端。宿主程序在客戶端聲明此類,並調用,目前隻支持在主線程中啟動
mlocationClient = new LocationClient(this);
mlistener = new MylocationListener();
// initMarkerClickEvent();
//注冊監聽器
mlocationClient.registerLocationListener(mlistener);
//配置定位SDK各配置參數,比如定位模式、定位時間間隔、坐標係類型等
LocationClientOption mOption = new LocationClientOption();
//設置坐標類型
mOption.setCoorType("bd09ll");
//設置是否需要地址信息,默認為無地址
mOption.setIsNeedAddress(true);
//設置是否打開gps進行定位
mOption.setOpenGps(true);
//設置掃描間隔,單位是毫秒 當<1000(1s)時,定時定位無效
int span = 10000;
mOption.setScanSpan(span);
//設置 LocationClientOption
mlocationClient.setLocOption(mOption);
//初始化圖標,BitmapDescriptorFactory是bitmap 描述信息工廠類.
mIconLocation = BitmapDescriptorFactory
.fromResource(R.mipmap.location_marker);
myOrientationListener = new MyOrientationListener(this);
//通過接口回調來實現實時方向的改變
myOrientationListener.setOnOrientationListener(new MyOrientationListener.OnOrientationListener() {
@Override
public void onOrientationChanged(float x) {
}
});
// mSearch = RoutePlanSearch.newInstance();
// mSearch.setOnGetRoutePlanResultListener(this);
// //開啟定位
// mBaiduMap.setMyLocationEnabled(true);
if (!mlocationClient.isStarted()) {
mlocationClient.start();
}
myOrientationListener.start();
}