Search in sources :

Example 1 with MyLocationData

use of com.baidu.mapapi.map.MyLocationData in project AndroidStudy by tinggengyan.

the class BaiduMapUtil method setCurrentLocation.

public void setCurrentLocation(float accuracy, float direction, double lng, double lat, int satellitesNum, float speed) {
    MyLocationData locData = new MyLocationData.Builder().accuracy(accuracy).direction(direction).latitude(lat).longitude(lng).satellitesNum(satellitesNum).speed(speed).build();
    this.mBaiduMap.setMyLocationData(locData);
}
Also used : MyLocationData(com.baidu.mapapi.map.MyLocationData)

Example 2 with MyLocationData

use of com.baidu.mapapi.map.MyLocationData in project KL2 by jweihao.

the class BaiduActivity method navigateTo.

private void navigateTo(BDLocation location) {
    if (isFirstLocate) {
        LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
        MapStatusUpdate update = MapStatusUpdateFactory.newLatLng(latLng);
        mBaiduMap.animateMapStatus(update);
        update = MapStatusUpdateFactory.zoomTo(16f);
        mBaiduMap.animateMapStatus(update);
        isFirstLocate = false;
    }
    MyLocationData.Builder locationBuilder = new MyLocationData.Builder();
    locationBuilder.latitude(location.getLatitude());
    locationBuilder.longitude(location.getLatitude());
    MyLocationData myLocationData = locationBuilder.build();
    mBaiduMap.setMyLocationData(myLocationData);
}
Also used : MapStatusUpdate(com.baidu.mapapi.map.MapStatusUpdate) MyLocationData(com.baidu.mapapi.map.MyLocationData) LatLng(com.baidu.mapapi.model.LatLng)

Aggregations

MyLocationData (com.baidu.mapapi.map.MyLocationData)2 MapStatusUpdate (com.baidu.mapapi.map.MapStatusUpdate)1 LatLng (com.baidu.mapapi.model.LatLng)1