代码优化
This commit is contained in:
@@ -53,6 +53,7 @@ import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
|
||||
import com.zhidaoauto.map.sdk.open.location.RTKAutopilotLocationBean;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnInfoWindowClickListener;
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener;
|
||||
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
|
||||
@@ -1020,13 +1021,22 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] matchRoad( double lon, double lat, double angle, boolean isRTK ) {
|
||||
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad( ( ( float ) lon ), ( ( float ) lat ), ( ( float ) angle ), !isRTK, isRTK );
|
||||
public double[] matchRoad( double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK ) {
|
||||
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad( ( ( float ) lon ), ( ( float ) lat ), ( ( float ) angle ), isGpsLocation, isRTK );
|
||||
if ( singlePointRoadInfo != null
|
||||
&& singlePointRoadInfo.getCoords() != null
|
||||
&& !singlePointRoadInfo.getCoords().isEmpty() ) {
|
||||
double matchedPoint[] = PointInterpolatorUtil.mergeToRoad(lon, lat, singlePointRoadInfo.getCoords());
|
||||
return CoordinateUtils.transformWgsToGcj( matchedPoint[1], matchedPoint[0] );
|
||||
double matchedPoint[] = PointInterpolatorUtil.mergeToRoad( lon, lat, singlePointRoadInfo.getCoords() );
|
||||
// return CoordinateUtils.transformWgsToGcj( matchedPoint[1], matchedPoint[0] );
|
||||
|
||||
matchedPoint = CoordinateUtils.transformWgsToGcj( matchedPoint[1], matchedPoint[0] );
|
||||
MarkerOptions options
|
||||
= new MarkerOptions( );
|
||||
options.markerIcon( R.drawable.marker_blue )
|
||||
.position( new LonLatPoint( matchedPoint[0],matchedPoint[1] ) )
|
||||
.setGps( false );
|
||||
mMapView.getMapAutoViewHelper().addMarker( options );
|
||||
return matchedPoint;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -315,9 +315,9 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] matchRoad( double lon, double lat, double angle, boolean isRTK ) {
|
||||
public double[] matchRoad( double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK ) {
|
||||
if ( mClient != null ) {
|
||||
return mClient.matchRoad( lon, lat, angle, isRTK );
|
||||
return mClient.matchRoad( lon, lat, angle, isGpsLocation, isRTK );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -281,10 +281,11 @@ public interface IMogoMapUIController {
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @param angle
|
||||
* @param isGpsLocation 是否是 gps 坐标
|
||||
* @param isRTK
|
||||
* @return
|
||||
*/
|
||||
default double[] matchRoad( double lon, double lat, double angle, boolean isRTK ) {
|
||||
default double[] matchRoad( double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,10 +355,10 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] matchRoad( double lon, double lat, double angle, boolean isRTK ) {
|
||||
public double[] matchRoad( double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK ) {
|
||||
initDelegate();
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.matchRoad( lon, lat, angle, isRTK );
|
||||
return mDelegate.matchRoad( lon, lat, angle, isGpsLocation, isRTK );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -190,11 +190,11 @@ class BaseDrawer {
|
||||
* @return
|
||||
*/
|
||||
protected double[] matchRoad( double lon, double lat, double angle, boolean isRtk ) {
|
||||
double amap[] = CoordinateUtils.transformGcj02toWgs84( lat, lon );
|
||||
double wgs[] = CoordinateUtils.transformGcj02toWgs84( lat, lon );
|
||||
return MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getMapServiceApi()
|
||||
.getMapUIController()
|
||||
.matchRoad( amap[0], amap[1], angle, isRtk );
|
||||
.matchRoad( wgs[0], wgs[1], angle, true, isRtk );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/28
|
||||
*
|
||||
* <p>
|
||||
* 云端数据绘制
|
||||
*/
|
||||
public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListener, IMogoStatusChangedListener {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -558,7 +558,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
case 47:
|
||||
mLocationMockHandler.sendEmptyMessageDelayed( 1, 100L );
|
||||
mLocationMockHandler.sendEmptyMessageDelayed( 2, 200L );
|
||||
mLocationMockHandler.sendEmptyMessageDelayed( 3, 100L );
|
||||
// mLocationMockHandler.sendEmptyMessageDelayed( 3, 100L );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user