Commit 3511390615bab0a09eccf43242c0df9a1ba29782

Authored by 杨帅
1 parent 05fef780

1 修复轨迹工具无法实时绘制轨迹问题

config.gradle
@@ -21,7 +21,7 @@ ext { @@ -21,7 +21,7 @@ ext {
21 //编译方式 21 //编译方式
22 debug : false, 22 debug : false,
23 //版本号 23 //版本号
24 - version: "0.7.3", 24 + version: "0.7.4",
25 //Lib库前缀 25 //Lib库前缀
26 packeg : "com.cnlive.module", 26 packeg : "com.cnlive.module",
27 //Lib库名称 27 //Lib库名称
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
@@ -653,20 +653,18 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener @@ -653,20 +653,18 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
653 fragment.binding.ivGpsState.setBackground(getContext().getResources().getDrawable(R.drawable.rt_training_gps_3)); 653 fragment.binding.ivGpsState.setBackground(getContext().getResources().getDrawable(R.drawable.rt_training_gps_3));
654 } 654 }
655 } 655 }
656 - if (followMyLocation == null || followMyLocation.latitude == 0 || followMyLocation.longitude == 0) {  
657 - return;  
658 - }  
659 - MapStatus.Builder builder = new MapStatus.Builder();  
660 - mCurrentAccracy = location.getRadius();  
661 - followMyLocation = new MyLocationData.Builder()  
662 - .accuracy(location.getRadius())  
663 - // 此处设置开发者获取到的方向信息,顺时针0-360  
664 - .direction(mCurrentDirection).latitude(location.getLatitude())  
665 - .longitude(location.getLongitude()).build(); 656 +
666 //第一次定位 657 //第一次定位
667 if (isFirstLoc) { 658 if (isFirstLoc) {
668 isFirstLoc = false; 659 isFirstLoc = false;
  660 + mCurrentAccracy = location.getRadius();
  661 + followMyLocation = new MyLocationData.Builder()
  662 + .accuracy(location.getRadius())
  663 + // 此处设置开发者获取到的方向信息,顺时针0-360
  664 + .direction(mCurrentDirection).latitude(location.getLatitude())
  665 + .longitude(location.getLongitude()).build();
669 baiduMap.setMyLocationData(followMyLocation); 666 baiduMap.setMyLocationData(followMyLocation);
  667 + MapStatus.Builder builder = new MapStatus.Builder();
670 builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM); 668 builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM);
671 baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); 669 baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
672 } else { 670 } else {
@@ -675,6 +673,12 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener @@ -675,6 +673,12 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
675 if (location.getRadius() > Constant.LOCA_ACCURACY) { 673 if (location.getRadius() > Constant.LOCA_ACCURACY) {
676 return; 674 return;
677 } 675 }
  676 + mCurrentAccracy = location.getRadius();
  677 + followMyLocation = new MyLocationData.Builder()
  678 + .accuracy(location.getRadius())
  679 + // 此处设置开发者获取到的方向信息,顺时针0-360
  680 + .direction(mCurrentDirection).latitude(location.getLatitude())
  681 + .longitude(location.getLongitude()).build();
678 if (null != currentWalkPoints) { 682 if (null != currentWalkPoints) {
679 if (currentWalkPoints.size() > 0) { 683 if (currentWalkPoints.size() > 0) {
680 //进行判断 684 //进行判断
@@ -689,7 +693,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener @@ -689,7 +693,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
689 currentWalkPoints.add(new LatLng(location.getLatitude(), 693 currentWalkPoints.add(new LatLng(location.getLatitude(),
690 location.getLongitude())); 694 location.getLongitude()));
691 } 695 }
692 -  
693 //判断当前集合列表是否可以划线(至少两个点) 696 //判断当前集合列表是否可以划线(至少两个点)
694 if (currentWalkPoints != null && currentWalkPoints.size() > 1) { 697 if (currentWalkPoints != null && currentWalkPoints.size() > 1) {
695 //判断当前是否已经在地图上画点 698 //判断当前是否已经在地图上画点
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/StartTraceFragmentView.java
@@ -347,8 +347,6 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { @@ -347,8 +347,6 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener {
347 option.setCoorType("gcj02"); // 设置坐标类型 347 option.setCoorType("gcj02"); // 设置坐标类型
348 //可选,默认false,设置是否开启Gps定位 348 //可选,默认false,设置是否开启Gps定位
349 option.setOpenGps(true); 349 option.setOpenGps(true);
350 - //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者,该模式下开发者无需再关心定位间隔是多少,定位SDK本身发现位置变化就会及时回调给开发者  
351 - option.setOpenAutoNotifyMode();  
352 //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备 350 //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备
353 option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy); 351 option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
354 //可选,设置是否需要地址信息,默认不需要 352 //可选,设置是否需要地址信息,默认不需要