This commit is contained in:
wangcongtao
2020-12-18 10:55:17 +08:00
parent bb85ba8cd1
commit 036d85df1e
35 changed files with 533 additions and 382 deletions

View File

@@ -0,0 +1,13 @@
package com.mogo.map;
public
/**
* @author congtaowang
* @since 2020/12/17
*
* 目前整个坐标按照高德火星坐标为准,故对于高德和自研地图,需要实现不同的转换,达到适应各自地图的目的
*/
interface CoordinatesTransformer {
double[] transform( double lat, double lon );
}

View File

@@ -49,4 +49,6 @@ interface IMogoMapApiBuilder extends IProvider {
IMogoTrafficSearch getTrafficSearch();
int getResIdByIconType( Context context, int iconType );
CoordinatesTransformer getCoordinatesTransformer();
}

View File

@@ -21,7 +21,7 @@ public class MogoLatLng implements Parcelable {
public MogoLatLng( double lat, double lon ) {
this.lat = lat;
this.lng = lon;
this.lon = lng;
this.lon = lon;
}
public double getLat() {

View File

@@ -5,6 +5,8 @@ import android.graphics.Bitmap;
import android.graphics.Point;
import android.view.animation.Interpolator;
import androidx.annotation.RawRes;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
@@ -281,14 +283,14 @@ public interface IMogoMarker {
* @param listener
*/
void startScaleAnimationWithAlpha( float fromX,
float toX,
float fromY,
float toY,
float fromAlpha,
float toAlpha,
int duration,
Interpolator interpolator,
OnMarkerAnimationListener listener );
float toX,
float fromY,
float toY,
float fromAlpha,
float toAlpha,
int duration,
Interpolator interpolator,
OnMarkerAnimationListener listener );
/**
@@ -319,15 +321,32 @@ public interface IMogoMarker {
*/
void startSmooth( List< MogoLatLng > points, int duration );
/**
* 开始平滑移动,毫秒
*
* @param points 坐标点
* @param duration 时长
*/
void startSmoothInMs( List< MogoLatLng > points, long duration );
/**
* info window 是否正在显示
*
* @return
*/
boolean isInfoWindowShowing();
/**
* 设置是否是gps
*
* @param isGps
*/
void setGps(boolean isGps);
void setGps( boolean isGps );
/**
* 使用3D资源
*/
default void use3DResource( @RawRes int model3D ) {
}
}

View File

@@ -73,9 +73,21 @@ public class MogoMarkerOptions extends Observable {
*/
private boolean mAutoManager = true;
private @RawRes int mIcon3DRes = 0;
private @RawRes
int mIcon3DRes = 0;
public MogoMarkerOptions position( MogoLatLng latLng ){
private boolean mIs3DMode = false;
public MogoMarkerOptions set3DMode( boolean is3DMode ) {
mIs3DMode = is3DMode;
return this;
}
public boolean is3DMode() {
return mIs3DMode;
}
public MogoMarkerOptions position( MogoLatLng latLng ) {
if ( latLng != null ) {
latitude( latLng.lat );
longitude( latLng.lon );
@@ -83,7 +95,7 @@ public class MogoMarkerOptions extends Observable {
return this;
}
public MogoMarkerOptions position( MogoLocation location ){
public MogoMarkerOptions position( MogoLocation location ) {
if ( location != null ) {
latitude( location.getLatitude() );
longitude( location.getLongitude() );
@@ -91,7 +103,7 @@ public class MogoMarkerOptions extends Observable {
return this;
}
public MogoMarkerOptions position( Location location ){
public MogoMarkerOptions position( Location location ) {
if ( location != null ) {
latitude( location.getLatitude() );
longitude( location.getLongitude() );
@@ -216,7 +228,7 @@ public class MogoMarkerOptions extends Observable {
return this;
}
public MogoMarkerOptions icon3DRes(@RawRes int icon3DRes){
public MogoMarkerOptions icon3DRes( @RawRes int icon3DRes ) {
this.mIcon3DRes = icon3DRes;
return this;
}