Java Code Examples for com.baidu.location.LocationClientOption#setIsNeedAltitude()

The following examples show how to use com.baidu.location.LocationClientOption#setIsNeedAltitude() . 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: BaiduMapRouteFragment.java    From BmapLite with GNU General Public License v3.0 6 votes vote down vote up
public void initLocationSDK() {
    // 定位初始化
    mLocClient = new LocationClient(getActivity());
    mLocClient.registerLocationListener(this);
    LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
    option.setCoorType("gcj02");
    option.setOpenGps(true);
    option.setScanSpan(1000);
    option.setIsNeedAltitude(true);
    option.setIsNeedAddress(false);

    mLocClient.setLocOption(option);

    MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
    mBaiduMap.setMyLocationConfiguration(configuration);

    mLocClient.start();
    isFirstLoc = false;

}
 
Example 2
Source File: BaiduMapSelectPoiFragment.java    From BmapLite with GNU General Public License v3.0 6 votes vote down vote up
public void initBaiduSdk() {
    // 定位初始化
    mLocClient = new LocationClient(getActivity());
    mLocClient.registerLocationListener(this);
    LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
    option.setCoorType("gcj02");
    option.setOpenGps(true);
    option.setScanSpan(1000);
    option.setIsNeedAltitude(true);
    option.setIsNeedAddress(false);

    mLocClient.setLocOption(option);

    MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
    mBaiduMap.setMyLocationConfiguration(configuration);

    mLocClient.start();

}
 
Example 3
Source File: RouteBaiduBusActivity.java    From BmapLite with GNU General Public License v3.0 6 votes vote down vote up
public void initLocationSDK() {
// 定位初始化
        mLocClient = new LocationClient(this);
        mLocClient.registerLocationListener(this);
        LocationClientOption option = new LocationClientOption();
        option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
        option.setCoorType("gcj02");
        option.setOpenGps(true);
        option.setScanSpan(1000);
        option.setIsNeedAltitude(true);
        option.setIsNeedAddress(false);

        mLocClient.setLocOption(option);

        MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
        mBaiduMap.setMyLocationConfiguration(configuration);

        mLocClient.start();

        isFirstLoc = false;

    }
 
Example 4
Source File: BaiduMapRouteFragment.java    From BmapLite with Apache License 2.0 6 votes vote down vote up
public void initLocationSDK() {
    // 定位初始化
    mLocClient = new LocationClient(getActivity());
    mLocClient.registerLocationListener(this);
    LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
    option.setCoorType("gcj02");
    option.setOpenGps(true);
    option.setScanSpan(1000);
    option.setIsNeedAltitude(true);
    option.setIsNeedAddress(false);

    mLocClient.setLocOption(option);

    MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
    mBaiduMap.setMyLocationConfiguration(configuration);

    mLocClient.start();
    isFirstLoc = false;

}
 
Example 5
Source File: BaiduMapSelectPoiFragment.java    From BmapLite with Apache License 2.0 6 votes vote down vote up
public void initBaiduSdk() {
    // 定位初始化
    mLocClient = new LocationClient(getActivity());
    mLocClient.registerLocationListener(this);
    LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
    option.setCoorType("gcj02");
    option.setOpenGps(true);
    option.setScanSpan(1000);
    option.setIsNeedAltitude(true);
    option.setIsNeedAddress(false);

    mLocClient.setLocOption(option);

    MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
    mBaiduMap.setMyLocationConfiguration(configuration);

    mLocClient.start();

}
 
Example 6
Source File: RouteBaiduBusActivity.java    From BmapLite with Apache License 2.0 6 votes vote down vote up
public void initLocationSDK() {
// 定位初始化
        mLocClient = new LocationClient(this);
        mLocClient.registerLocationListener(this);
        LocationClientOption option = new LocationClientOption();
        option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
        option.setCoorType("gcj02");
        option.setOpenGps(true);
        option.setScanSpan(1000);
        option.setIsNeedAltitude(true);
        option.setIsNeedAddress(false);

        mLocClient.setLocOption(option);

        MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
        mBaiduMap.setMyLocationConfiguration(configuration);

        mLocClient.start();

        isFirstLoc = false;

    }
 
Example 7
Source File: GeolocationModule.java    From react-native-baidu-map with MIT License 6 votes vote down vote up
private void initLocationClient(String coorType) {
    if(context.getCurrentActivity() != null) {
        AppUtils.checkPermission(context.getCurrentActivity(), Manifest.permission.ACCESS_FINE_LOCATION);
    }
    LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationMode.Hight_Accuracy);
    option.setCoorType(coorType);
    option.setIsNeedAddress(true);
    option.setIsNeedAltitude(true);
    option.setIsNeedLocationDescribe(true);
    option.setOpenGps(true);
    locationClient = new LocationClient(context.getApplicationContext());
    locationClient.setLocOption(option);
    Log.i("locationClient", "locationClient");
    locationClient.registerLocationListener(this);
}
 
Example 8
Source File: BaiduMapFragment.java    From BmapLite with GNU General Public License v3.0 5 votes vote down vote up
public void initLocationSdk() {
    // 定位初始化
    mLocClient = new LocationClient(getActivity());
    mLocClient.registerLocationListener(this);
    LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
    option.setCoorType("gcj02");
    option.setOpenGps(true);
    option.setScanSpan(1000);
    option.setIsNeedAltitude(true);
    option.setIsNeedAddress(false);

    mLocClient.setLocOption(option);

    MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
    mBaiduMap.setMyLocationConfiguration(configuration);

    mLocClient.start();

    try {
        LocationManager locManager = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);
        if (!locManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
            onMessage(getResources().getString(R.string.gps_enabled_false));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }


}
 
Example 9
Source File: BaiduMapFragment.java    From BmapLite with Apache License 2.0 5 votes vote down vote up
public void initLocationSdk() {
    // 定位初始化
    mLocClient = new LocationClient(getActivity());
    mLocClient.registerLocationListener(this);
    LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
    option.setCoorType("gcj02");
    option.setOpenGps(true);
    option.setScanSpan(1000);
    option.setIsNeedAltitude(true);
    option.setIsNeedAddress(false);

    mLocClient.setLocOption(option);

    MyLocationConfiguration configuration = new MyLocationConfiguration(MyLocationConfiguration.LocationMode.NORMAL, true, null);
    mBaiduMap.setMyLocationConfiguration(configuration);

    mLocClient.start();

    try {
        LocationManager locManager = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);
        if (!locManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
            onMessage(getResources().getString(R.string.gps_enabled_false));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }


}
 
Example 10
Source File: ClientOptionFactory.java    From RxLocation with Apache License 2.0 5 votes vote down vote up
/***
 * @return Default LocationClientOption
 * 详情请查看{ http://wiki.lbsyun.baidu.com/cms/androidloc/doc/v7.1/index.html }
 */
private LocationClientOption getDefaultLocationClientOption() {
    final LocationClientOption option = new LocationClientOption();
    option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
    option.setIsNeedAddress(true);
    option.setIsNeedLocationDescribe(true);
    option.setNeedDeviceDirect(false);
    option.setLocationNotify(false);
    option.setIgnoreKillProcess(true);
    option.setIsNeedLocationDescribe(true);
    option.setIsNeedLocationPoiList(true);
    option.SetIgnoreCacheException(false);
    option.setIsNeedAltitude(false);
    return option;
}