opt
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.CoordinatesTransformer;
|
||||
import com.mogo.map.IMogoMapApiBuilder;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MapApiPath;
|
||||
@@ -114,6 +115,11 @@ class AMapApiBuilder implements IMogoMapApiBuilder {
|
||||
return IconTypeUtils.getResIdByIconType( context, iconType );
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoordinatesTransformer getCoordinatesTransformer() {
|
||||
return AMapCoordinatesTransformer.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
Logger.d( TAG, "init." );
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import com.mogo.map.CoordinatesTransformer;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/17
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class AMapCoordinatesTransformer implements CoordinatesTransformer {
|
||||
|
||||
private AMapCoordinatesTransformer() {
|
||||
// private constructor
|
||||
}
|
||||
|
||||
private static final class InstanceHolder {
|
||||
private static final AMapCoordinatesTransformer INSTANCE = new AMapCoordinatesTransformer();
|
||||
}
|
||||
|
||||
public static AMapCoordinatesTransformer getInstance() {
|
||||
return InstanceHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return InstanceHolder.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] transform( double lat, double lon ) {
|
||||
double[] coor = new double[2];
|
||||
coor[0] = lat;
|
||||
coor[1] = lon;
|
||||
return coor;
|
||||
// return new double[]{lat, lon};
|
||||
// return CoordinateUtils.transformGcj02toWgs84( lat, lon );
|
||||
}
|
||||
}
|
||||
@@ -525,6 +525,11 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
mMovingPointOverlay.startSmoothMove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startSmoothInMs( List< MogoLatLng > points, long duration ) {
|
||||
startSmooth( points, ( ( int ) ( duration / 1000 ) ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInfoWindowShowing() {
|
||||
if ( mMarker == null ) {
|
||||
|
||||
@@ -192,7 +192,7 @@ public class ObjectUtils {
|
||||
if ( latLng == null ) {
|
||||
return null;
|
||||
}
|
||||
return new LatLng( latLng.lat, latLng.lng );
|
||||
return new LatLng( latLng.lat, latLng.lon );
|
||||
}
|
||||
|
||||
public static MogoLatLng fromAMap( LatLonPoint point ) {
|
||||
|
||||
Reference in New Issue
Block a user