Java Code Examples for com.baidu.location.BDLocation#getStreet()

The following examples show how to use com.baidu.location.BDLocation#getStreet() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MapPickerActivity.java    From o2oa with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void onReceiveLocation(BDLocation location) {
    if (null != location && location.getLocType() != BDLocation.TypeServerError) {
        //

        MyLocationData data = new MyLocationData.Builder()//
                // .direction(mCurrentX)//
                .accuracy(location.getRadius())//
                .latitude(location.getLatitude())//
                .longitude(location.getLongitude())//
                .build();
        mBaiduMap.setMyLocationData(data);
        // 设置自定义图标
        MyLocationConfiguration config = new MyLocationConfiguration(
                MyLocationConfiguration.LocationMode.NORMAL, true, null);
        mBaiduMap.setMyLocationConfigeration(config);
        mAddress = location.getAddrStr();
        mName = location.getStreet();
        mCity = location.getCity();

        LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
        mLoactionLatLng = currentLatLng;
        // 是否第一次定位
        if (isFirstLoc) {
            isFirstLoc = false;
            // 实现动画跳转
            MapStatusUpdate u = MapStatusUpdateFactory
                    .newLatLng(currentLatLng);
            mBaiduMap.animateMapStatus(u);
            mGeoCoder.reverseGeoCode((new ReverseGeoCodeOption())
                    .location(currentLatLng));
            return;
        }
    }

}
 
Example 2
Source File: BaiduUtils.java    From LocationProvider with Apache License 2.0 5 votes vote down vote up
public static void prinftBDLocation(BDLocation bdLocation) {
    Log.d("@@@", "====================BDLocation Strat====================");
    String str = "BDLocation{" + "locationID='" + bdLocation.getLocationID() + '\'' +
            ", locType=" + bdLocation.getLocType() +
            ", locTime='" + bdLocation.getTime() + '\'' +
            ", latitude=" + bdLocation.getLatitude() +
            ", longitude=" + bdLocation.getLongitude() +
            ", radius=" + bdLocation.getRadius() +
            ", addrStr=" + bdLocation.getAddrStr() +
            ", country='" + bdLocation.getCountry() + '\'' +
            ", countryCode='" + bdLocation.getCountryCode() + '\'' +
            ", city='" + bdLocation.getCity() + '\'' +
            ", cityCode='" + bdLocation.getCityCode() + '\'' +
            ", district='" + bdLocation.getDistrict() + '\'' +
            ", street='" + bdLocation.getStreet() + '\'' +
            ", streetNumber='" + bdLocation.getStreetNumber() + '\'' +
            ", locationDescribe='" + bdLocation.getLocationDescribe() + '\'' +
            ", buildingID='" + bdLocation.getBuildingID() + '\'' +
            ", buildingName='" + bdLocation.getBuildingName() + '\'' +
            ", floor='" + bdLocation.getFloor() + '\'' +
            ", speed=" + bdLocation.getSpeed() + '\'' +
            ", satelliteNumber=" + bdLocation.getSatelliteNumber() + '\'' +
            ", altitude=" + bdLocation.getAltitude() + '\'' +
            ", direction=" + bdLocation.getDirection() + '\'' +
            ", operators=" + bdLocation.getOperators() + '\'' +
            "}";
    Log.d("@@@", str);
    Log.d("@@@", "====================BDLocation End====================");
}