This commit is contained in:
wangcongtao
2020-01-10 16:34:18 +08:00
parent 3597505a34
commit fdecf6a2de
8 changed files with 72 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ package com.mogo.map.impl.amap;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Point;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
@@ -495,7 +496,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
return null;
}
@Override public MogoLatLng getTarget() {
@Override
public MogoLatLng getTarget() {
try {
return ObjectUtils.fromAMap( mMapView.getMap().getCameraPosition().target );
} catch ( Exception e ) {
@@ -512,4 +514,16 @@ public class AMapNaviViewWrapper implements IMogoMapView,
mMapView.setViewOptions( options );
}
}
@Override
public Point getLocationPointInScreen( MogoLatLng latLng ) {
if ( checkAMapView() ) {
try {
return mMapView.getMap().getProjection().toScreenLocation( ObjectUtils.fromMogo2( latLng ) );
} catch ( Exception e ) {
return null;
}
}
return null;
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.map.impl.amap.marker;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.view.View;
import com.amap.api.maps.model.BitmapDescriptor;
@@ -281,4 +282,11 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
public String getOwner() {
return this.mOwner == null ? mMogoMarkerOptions.getOwner() : mOwner;
}
@Override
public void setPositionByPixels( Point position ) {
if ( mMarker != null ) {
mMarker.setPositionByPixels( position.x, position.y );
}
}
}

View File

@@ -1,5 +1,7 @@
package com.mogo.map.impl.amap.uicontroller;
import android.graphics.Point;
import com.mogo.map.MogoLatLng;
import com.mogo.map.MogoMap;
import com.mogo.map.uicontroller.EnumMapUI;
@@ -143,4 +145,12 @@ public class AMapUIController implements IMogoMapUIController {
mClient.setPointToCenter( mapCenterX, mapCenterY );
}
}
@Override
public Point getLocationPointInScreen( MogoLatLng latLng ) {
if ( mClient != null ) {
return mClient.getLocationPointInScreen( latLng );
}
return null;
}
}