本文整理匯總了Java中com.baidu.location.LocationClient.getBDLocationInCoorType方法的典型用法代碼示例。如果您正苦於以下問題:Java LocationClient.getBDLocationInCoorType方法的具體用法?Java LocationClient.getBDLocationInCoorType怎麽用?Java LocationClient.getBDLocationInCoorType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.baidu.location.LocationClient
的用法示例。
在下文中一共展示了LocationClient.getBDLocationInCoorType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setAddress
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
public void setAddress(Address address) {
if (address != null) {
mAddress = address.clone();
BDLocation bdLocation = new BDLocation();
bdLocation.setLatitude(mAddress.getLatitude());
bdLocation.setLongitude(mAddress.getLongitude());
bdLocation = LocationClient.getBDLocationInCoorType(bdLocation, BDLocation.BDLOCATION_BD09LL_TO_GCJ02);
mAddress.setLatitude(bdLocation.getLatitude());
mAddress.setLongitude(bdLocation.getLongitude());
}
Log.i("LingJu", "LocationAccessAdapter setAddress() 最終位置:>> " + mAddress);
}
示例2: setCGJ02
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
/**
* 將百度坐標轉換成國測局坐標
**/
public void setCGJ02() {
BDLocation bl = new BDLocation();
bl.setLatitude(this.latitude);
bl.setLongitude(this.longitude);
bl = LocationClient.getBDLocationInCoorType(bl, BDLocation.BDLOCATION_BD09LL_TO_GCJ02);
this.latitude = bl.getLatitude();
this.longitude = bl.getLongitude();
}
示例3: setBD09LL
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
public void setBD09LL() {
BDLocation bl = new BDLocation();
bl.setLatitude(this.latitude);
bl.setLongitude(this.longitude);
bl = LocationClient.getBDLocationInCoorType(bl, BDLocation.BDLOCATION_GCJ02_TO_BD09LL);
this.latitude = bl.getLatitude();
this.longitude = bl.getLongitude();
}
示例4: onClick
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
@OnClick({R.id.ancp_back_bt, R.id.ancp_map_locate_bt, R.id.ancp_zoom_in_bt, R.id.ancp_zoom_out_bt,
R.id.ancp_poi_detial_pre_bt, R.id.ancp_poi_detial_next_bt, R.id.ancp_map_its_bt})
public void onClick(View view) {
switch (view.getId()) {
case R.id.ancp_back_bt:
onBackPressed();
break;
case R.id.ancp_map_locate_bt:
/* 封裝定位信息 */
BDLocation location = new BDLocation();
location.setLatitude(address.getLatitude());
location.setLongitude(address.getLongitude());
location.setRadius(address.getRadius());
location.setSpeed(address.getSpeed());
location.setSatelliteNumber(address.getSatelliteNumber());
location = LocationClient.getBDLocationInCoorType(location, BDLocation.BDLOCATION_GCJ02_TO_BD09LL);
/* 開啟定位圖層 */
baiduMap.setMyLocationEnabled(true);
// 設置定位圖層的配置(定位模式,是否允許方向信息,用戶自定義定位圖標)
baiduMap.setMyLocationConfigeration(new MyLocationConfiguration(MyLocationConfiguration.LocationMode.FOLLOWING, true, null));
/* 構造定位數據並設置 */
baiduMap.setMyLocationData(new MyLocationData.Builder().latitude(location.getLatitude())
.longitude(location.getLongitude())
.accuracy(location.getRadius())
.direction(location.getDirection())
.satellitesNum(location.getSatelliteNumber())
.speed(location.getSpeed())
.build());
break;
case R.id.ancp_zoom_in_bt:
baiduMap.setMapStatus(MapStatusUpdateFactory.zoomIn());
break;
case R.id.ancp_zoom_out_bt:
baiduMap.setMapStatus(MapStatusUpdateFactory.zoomOut());
break;
case R.id.ancp_poi_detial_pre_bt:
if (mAncpPoiDetailPager.getCurrentItem() > 0 && mAncpPoiDetailPager.getCurrentItem() < list.size()) {
showPoiDetail(mAncpPoiDetailPager.getCurrentItem() - 1);
}
break;
case R.id.ancp_poi_detial_next_bt:
if (mAncpPoiDetailPager.getCurrentItem() >= 0 && mAncpPoiDetailPager.getCurrentItem() < list.size() - 1) {
showPoiDetail(mAncpPoiDetailPager.getCurrentItem() + 1);
}
break;
case R.id.ancp_map_its_bt:
if (baiduMap.isTrafficEnabled()) {
baiduMap.setTrafficEnabled(false);
((ImageButton) view).setImageResource(R.drawable.bnav_common_ic_map_its_off);
} else {
baiduMap.setTrafficEnabled(true);
((ImageButton) view).setImageResource(R.drawable.bnav_common_ic_map_its_on);
}
break;
}
}
示例5: setRouteModeDetail
import com.baidu.location.LocationClient; //導入方法依賴的package包/類
@Override
public void setRouteModeDetail(int index) {
calculateScheme = index;
cancelCountDownTimer();
/* 設置指定路線 */
BNRoutePlanerProxy.getInstance().selectRoute(index);
BNRoutePlanerProxy.getInstance().setCalculateScheme(index);
RouteModel.setCalculateScheme(index);
/* 獲取指定算路偏好的指定路線 */
RoutePlanModelProxy mRoutePlanModel = BNRoutePlanerProxy.getInstance().routePlans.get(calculatePreference).get(index);
/* 綁定視圖數據 */
mSetLineView.updateRouteDetailList(mRoutePlanModel.getRouteNodeData());
mSetLineView.setLineMsg(mRoutePlanModel);
mSetLineView.setLineMsg(mRoutePlanModel);
/* 設置導航路線圖層 */
BNMapControllerProxy.getInstance().setLayerMode(
MapParams.LayerMode.MAP_LAYER_MODE_ROUTE_DETAIL_FOR_NAVI);
BNMapControllerProxy.getInstance().updateLayer(MapParams.LayerType.MAP_LAYER_TYPE_ROUTE);
//rLineDetailListBox.setVisibility(View.VISIBLE);
for (int i = 0; i < 3; i++) {
if (i == index) { //選中路線
mSetLineView.setRouteLineModeStyle(i, true);
} else { //其他導航路線
mSetLineView.setRouteLineModeStyle(i, false);
}
}
//上傳導航引擎對象
com.lingju.context.entity.Address startAddress = getAddress(routeInputs.get(0));
com.lingju.context.entity.Address endAddress = getAddress(routeInputs.get(routeInputs.size() - 1));
List<com.lingju.context.entity.Address> passPoints = new ArrayList<>();
for (int i = 1; i < routeInputs.size() - 1; i++) {
passPoints.add(getAddress(routeInputs.get(i)));
}
RouteModel routeModel = RouteModel.getCurrent();
Route route = getRoute(mRoutePlanModel, startAddress, endAddress, passPoints, routeModel, calculateScheme);
mNavigation.setRoute(route);
mNavigation.setNaviplan(calculateScheme + 1);
mNavigation.setIscongestion(NavigatorService.get().isCongestion() ? "ON" : "OFF");
mNavigation.setStatus(RobotConstant.NaviStatus.PLAN.toString());
uploadNavigation();
keepNavigation();
Log.i(TAG, "第一段路名:" + mRoutePlanModel.getFirstRoadName() + ",時間:" + mRoutePlanModel.getTotalTime() + ",花費:" + mRoutePlanModel.getTollFees() + ",routeNum:" + mRoutePlanModel.getNodeNum() + ",主要道路:" + mRoutePlanModel.getMainRoads());
ArrayList<RoutePlanResultItemProxy> rList = mRoutePlanModel.getRouteNodeData();
BDLocation tt = new BDLocation();
for (RoutePlanResultItemProxy ri : rList) {
tt.setLatitude(ri.getLatitude() / 1e5);
tt.setLongitude(ri.getLongitude() / 1e5);
tt = LocationClient.getBDLocationInCoorType(tt, BDLocation.BDLOCATION_GCJ02_TO_BD09LL);
System.out.println(ri.getNextRoadName() + ",condition=" + ri.getRoadCondition() + ",coordinate=[" + tt.getLongitude() + "," + tt.getLatitude() + "]");
}
}