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);
}
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);
}
Aggregations