本文整理匯總了Java中com.baidu.mapapi.map.MyLocationConfigeration類的典型用法代碼示例。如果您正苦於以下問題:Java MyLocationConfigeration類的具體用法?Java MyLocationConfigeration怎麽用?Java MyLocationConfigeration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MyLocationConfigeration類屬於com.baidu.mapapi.map包,在下文中一共展示了MyLocationConfigeration類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initLocClient
import com.baidu.mapapi.map.MyLocationConfigeration; //導入依賴的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);
}
}
示例2: initLocClient
import com.baidu.mapapi.map.MyLocationConfigeration; //導入依賴的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);
}
}
示例3: initLocClient
import com.baidu.mapapi.map.MyLocationConfigeration; //導入依賴的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);
}
}