merge
This commit is contained in:
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.2.4'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.2.6'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ class MapStyleController {
|
||||
private MapStyleController() {
|
||||
mVrAreaFilters.add( new ShunYiArea() );
|
||||
mVrAreaFilters.add( new OCHArea() );
|
||||
mVrAreaFilters.add( new HuiXinXiJieArea() );
|
||||
}
|
||||
|
||||
public static MapStyleController getInstance() {
|
||||
@@ -160,4 +161,27 @@ class MapStyleController {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static class HuiXinXiJieArea implements VrAreaFilter {
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLat() {
|
||||
return 39.96741320378243;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLon() {
|
||||
return 116.41045709250723;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLat() {
|
||||
return 39.98232698552779;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLon() {
|
||||
return 116.41879656379113;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return;
|
||||
}
|
||||
|
||||
List< LonLatPoint > newPoints = new ArrayList<>();
|
||||
ArrayList< LonLatPoint > newPoints = new ArrayList<>();
|
||||
for ( int i = 0; i < points.size(); i++ ) {
|
||||
LonLatPoint point = ObjectUtils.fromMogo( points.get( i ) );
|
||||
if ( point == null ) {
|
||||
@@ -480,6 +480,35 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// MarkerTranslateAnimation animation = new MarkerTranslateAnimation( newPoints );
|
||||
// animation.setDuration( duration );
|
||||
// animation.setAnimationListener( new MarkerAnimationListener() {
|
||||
// @Override
|
||||
// public void onAnimationStart( @NotNull Animation animation ) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAnimationEnd( @NotNull Animation animation ) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// long lastTime = 0L;
|
||||
//
|
||||
// @Override
|
||||
// public void onAnimationRepeat( @NotNull Animation animation ) {
|
||||
// if ( lastTime == 0L ) {
|
||||
// lastTime = System.currentTimeMillis();
|
||||
// return;
|
||||
// }
|
||||
// Logger.d( TAG, "frame cost = %s", System.currentTimeMillis() - lastTime );
|
||||
// lastTime = System.currentTimeMillis();
|
||||
// }
|
||||
// } );
|
||||
// mMarker.setTranslateAnimation( animation );
|
||||
// mMarker.startAnimation();
|
||||
|
||||
mMarker.startSmooth( newPoints, ( int ) duration );
|
||||
// mMarker.addDynamicAnchorPostion( newPoints.get( newPoints.size() - 1 ), ( int ) duration );
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
@@ -22,7 +23,10 @@ import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.MogoSearchBound;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptor;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
|
||||
@@ -65,11 +69,26 @@ public class ObjectUtils {
|
||||
if ( icon == null || icon.isRecycled() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
descriptors.add( new BitmapDescriptor( icon ) );
|
||||
}
|
||||
}
|
||||
|
||||
// 吸附到路边
|
||||
// if ( opt.isMatchOnRoadSide() ) {
|
||||
// double coors[] = new double[]{opt.getLongitude(), opt.getLatitude()};
|
||||
// if ( !opt.isGps() ) {
|
||||
// coors = CoordinateUtils.transformGcj02toWgs84( opt.getLatitude(), opt.getLongitude() );
|
||||
// opt.gps( true );
|
||||
// }
|
||||
// if ( coors != null ) {
|
||||
// SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad( ( ( float ) coors[0] ), ( ( float ) coors[1] ), ( ( float ) opt.getRotate() ), true, true );
|
||||
// double data[] = PointInterpolatorUtil.mergeToRoad( coors[0], coors[1], singlePointRoadInfo.getCoords() );
|
||||
// if ( data != null ) {
|
||||
// opt.longitude( data[0] ).latitude( data[1] );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
MarkerOptions markerOptions = new MarkerOptions()
|
||||
.position( new LonLatPoint( opt.getLongitude(), opt.getLatitude() ) )
|
||||
.anchor( opt.getU(), opt.getV() )
|
||||
@@ -85,7 +104,7 @@ public class ObjectUtils {
|
||||
// .draggable( opt.isDraggable() )
|
||||
.setInfoWindowOffset( opt.getOffsetX(), opt.getOffsetY() )
|
||||
.zIndex( opt.getzIndex() );
|
||||
if ( !TextUtils.isEmpty( opt.getResName() )) {
|
||||
if ( !TextUtils.isEmpty( opt.getResName() ) ) {
|
||||
markerOptions.setMarkerIconName( opt.getResName() );
|
||||
markerOptions.vrEnable( opt.is3DMode() );
|
||||
} else {
|
||||
|
||||
@@ -17,35 +17,6 @@ public class PointInterpolatorUtil {
|
||||
private static final String TAG = "PointInterpolatorUtil";
|
||||
private static final int DISTANCE_THRESHOLD = 2;
|
||||
|
||||
/**
|
||||
* 在两点之间插值
|
||||
*
|
||||
* @param start
|
||||
* @param end
|
||||
* @param frameInterval
|
||||
* @return
|
||||
*/
|
||||
public static List< MogoLatLng > interpolate( MogoLatLng start, MogoLatLng end, long frameInterval ) {
|
||||
if ( start == null || end == null ) {
|
||||
return null;
|
||||
}
|
||||
long locInterval = end.time - start.time;
|
||||
int interpolateFrame = ( int ) ( locInterval / frameInterval ) - 1;
|
||||
List< MogoLatLng > arrayList = new ArrayList<>();
|
||||
arrayList.add( start );
|
||||
if ( interpolateFrame > 0 ) {
|
||||
double lonStep = ( end.lon - start.lon ) / ( interpolateFrame + 1 );
|
||||
double latStep = ( end.lat - start.lat ) / ( interpolateFrame + 1 );
|
||||
for ( int i = 0; i < interpolateFrame; i++ ) {
|
||||
double lon = start.lon + lonStep * ( i + 1 );
|
||||
double lat = start.lat + latStep * ( i + 1 );
|
||||
arrayList.add( new MogoLatLng( lon, lat ) );
|
||||
}
|
||||
}
|
||||
arrayList.add( end );
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在(x1,y1) (x2,y2)中间插入一些点,使每两个点之间距离<={@link #DISTANCE_THRESHOLD},利用如下公式进行计算
|
||||
* xn = x1 + (x2 - x1)*n/a
|
||||
|
||||
@@ -17,7 +17,6 @@ public class MogoLatLng implements Parcelable {
|
||||
@Deprecated
|
||||
public final double lng;
|
||||
public final double lon;
|
||||
public long time;
|
||||
|
||||
public MogoLatLng( double lat, double lon ) {
|
||||
this.lat = lat;
|
||||
@@ -43,14 +42,6 @@ public class MogoLatLng implements Parcelable {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime( long time ) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object o ) {
|
||||
if ( this == o ) return true;
|
||||
@@ -83,14 +74,12 @@ public class MogoLatLng implements Parcelable {
|
||||
dest.writeDouble( this.lat );
|
||||
dest.writeDouble( this.lng );
|
||||
dest.writeDouble( this.lon );
|
||||
dest.writeLong( this.time );
|
||||
}
|
||||
|
||||
protected MogoLatLng( Parcel in ) {
|
||||
this.lat = in.readDouble();
|
||||
this.lng = in.readDouble();
|
||||
this.lon = in.readDouble();
|
||||
this.time = in.readLong();
|
||||
}
|
||||
|
||||
public static final Creator< MogoLatLng > CREATOR = new Creator< MogoLatLng >() {
|
||||
|
||||
@@ -86,6 +86,20 @@ public class MogoMarkerOptions extends Observable {
|
||||
*/
|
||||
private String mResName;
|
||||
|
||||
/**
|
||||
* 吸附在车道上
|
||||
*/
|
||||
private boolean mMatchOnRoadSide = true;
|
||||
|
||||
public MogoMarkerOptions matchOnRoadSide( boolean matchOnRoadSide ) {
|
||||
this.mMatchOnRoadSide = matchOnRoadSide;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isMatchOnRoadSide() {
|
||||
return mMatchOnRoadSide;
|
||||
}
|
||||
|
||||
public MogoMarkerOptions resName( String resName ) {
|
||||
this.mResName = resName;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user