Commit 21f98ef3850dc01200ae88552216cde8dea80272

Authored by 杨帅
1 parent c0c5dec3

1 路径工具,绑定轨迹相关逻辑

moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
@@ -552,12 +552,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener @@ -552,12 +552,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
552 return; 552 return;
553 } 553 }
554 554
555 - mCurrentAccracy = location.getRadius();  
556 - followMyLocation = new MyLocationData.Builder()  
557 - .accuracy(location.getRadius())  
558 - // 此处设置开发者获取到的方向信息,顺时针0-360  
559 - .direction(mCurrentDirection).latitude(location.getLatitude())  
560 - .longitude(location.getLongitude()).build();  
561 // if (followMyLocation == null || followMyLocation.latitude == 0 || followMyLocation.longitude == 0) { 555 // if (followMyLocation == null || followMyLocation.latitude == 0 || followMyLocation.longitude == 0) {
562 // return; 556 // return;
563 // } 557 // }
@@ -565,8 +559,13 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener @@ -565,8 +559,13 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
565 //第一次定位 559 //第一次定位
566 if (isFirstLoc) { 560 if (isFirstLoc) {
567 isFirstLoc = false; 561 isFirstLoc = false;
568 - if (location.getRadius() > Constant.LOCA_ACCURACY) {  
569 - } 562 + mCurrentAccracy = location.getRadius();
  563 + followMyLocation = new MyLocationData.Builder()
  564 + .accuracy(location.getRadius())
  565 + // 此处设置开发者获取到的方向信息,顺时针0-360
  566 + .direction(mCurrentDirection).latitude(location.getLatitude())
  567 + .longitude(location.getLongitude()).build();
  568 +
570 baiduMap.setMyLocationData(followMyLocation); 569 baiduMap.setMyLocationData(followMyLocation);
571 builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM); 570 builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM);
572 baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); 571 baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
@@ -576,6 +575,12 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener @@ -576,6 +575,12 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
576 if (location.getRadius() > Constant.LOCA_ACCURACY) { 575 if (location.getRadius() > Constant.LOCA_ACCURACY) {
577 return; 576 return;
578 } 577 }
  578 + mCurrentAccracy = location.getRadius();
  579 + followMyLocation = new MyLocationData.Builder()
  580 + .accuracy(location.getRadius())
  581 + // 此处设置开发者获取到的方向信息,顺时针0-360
  582 + .direction(mCurrentDirection).latitude(location.getLatitude())
  583 + .longitude(location.getLongitude()).build();
579 if (null != currentWalkPoints && currentWalkPoints.size() > 0) { 584 if (null != currentWalkPoints && currentWalkPoints.size() > 0) {
580 //进行判断 585 //进行判断
581 LatLng lastLatLng = currentWalkPoints.get(currentWalkPoints.size() - 1); 586 LatLng lastLatLng = currentWalkPoints.get(currentWalkPoints.size() - 1);