当前位置: 首页>>代码示例>>Java>>正文


Java LocationClient.getBDLocationInCoorType方法代码示例

本文整理汇总了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);
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:13,代码来源:LocationAccessAdapter.java

示例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();
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:12,代码来源:BaiduAddress.java

示例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();
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:9,代码来源:BaiduAddress.java

示例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;
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:57,代码来源:NaviConfirmPointActivity.java

示例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() + "]");
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:53,代码来源:NaviSetLinePresenter.java


注:本文中的com.baidu.location.LocationClient.getBDLocationInCoorType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。