Commit 21f98ef3850dc01200ae88552216cde8dea80272
1 parent
c0c5dec3
1 路径工具,绑定轨迹相关逻辑
Showing
1 changed file
with
13 additions
and
8 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
| ... | ... | @@ -552,12 +552,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 552 | 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 | 555 | // if (followMyLocation == null || followMyLocation.latitude == 0 || followMyLocation.longitude == 0) { |
| 562 | 556 | // return; |
| 563 | 557 | // } |
| ... | ... | @@ -565,8 +559,13 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 565 | 559 | //第一次定位 |
| 566 | 560 | if (isFirstLoc) { |
| 567 | 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 | 569 | baiduMap.setMyLocationData(followMyLocation); |
| 571 | 570 | builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM); |
| 572 | 571 | baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); |
| ... | ... | @@ -576,6 +575,12 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 576 | 575 | if (location.getRadius() > Constant.LOCA_ACCURACY) { |
| 577 | 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 | 584 | if (null != currentWalkPoints && currentWalkPoints.size() > 0) { |
| 580 | 585 | //进行判断 |
| 581 | 586 | LatLng lastLatLng = currentWalkPoints.get(currentWalkPoints.size() - 1); | ... | ... |