Prev: Android use Baidu lbs SDK (Baidu Map to achieve the basic use of records, track, optimize the smoothness of the trajectory, track viewing and sharing. )
Today, we summarize the use of distance measurement and speed measurement:
Calculate trajectory start point straight distance and route distance
Code:
// 直线距离 double linearDistance = DistanceUtil.getDistance(llStart, llEnd); // 轨迹距离 double0.0; for (int01; i++) { routeDistance = routeDistance + DistanceUtil.getDistance(points.get(i), points.get1)); }
:
Remove the Mapview zoom control and Baidu logo
Code:
mMapView = (MapView) findViewById(R.id.routeMap); // 去掉缩放控件和百度Logo int count = mMapView.getChildCount(); for (int0; i < count; i++) { View child = mMapView.getChildAt(i); ifinstanceofinstanceof ZoomControls) { child.setVisibility(View.INVISIBLE); } }
Write so much first, follow slowly add.
I'm in these places: CSDN GitHub Weibo
Android uses Baidu lbs SDK (ii)