解决小地图位置

This commit is contained in:
董宏宇
2021-04-15 16:22:25 +08:00
parent 5557ab7253
commit b399ea53af
2 changed files with 3 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import android.graphics.BitmapFactory;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import androidx.annotation.Nullable;
@@ -17,7 +18,6 @@ import com.amap.api.navi.AMapNaviView;
import com.amap.api.navi.AMapNaviViewOptions;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.small.map.animation.DirectionRotateAnimation;
import com.mogo.utils.FileUtils;
import java.io.IOException;
@@ -32,8 +32,6 @@ public class SmallMapDirectionView extends RelativeLayout {
private String styleFilePath = "/mnt/sdcard/amap/small_map_style.data";
private AMapNaviView mAMapNaviView;
private DirectionRotateAnimation mRotateAnimation;
private int lastAngle = 0;
private int zoomLevel = 15;
public SmallMapDirectionView(Context context) {
@@ -54,9 +52,9 @@ public class SmallMapDirectionView extends RelativeLayout {
}
private void initView(Context context) {
mRotateAnimation = new DirectionRotateAnimation(context, null);
AbsMogoApplication.getLayoutInflaterNoSkin().inflate(R.layout.module_small_map_view, this);
mAMapNaviView = findViewById(R.id.aMapNaviView);
mAMapNaviView.onCreate(null);
@@ -164,7 +162,6 @@ public class SmallMapDirectionView extends RelativeLayout {
try {
// 判断是否有样式文件存在
//File styleExit = new File(styleFilePath);
FileUtils.copy(
context.getAssets().open("small_map_style.data"),
styleFilePath,

View File

@@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/module_small_map_padding"
tools:parentTag="RelativeLayout">
@@ -12,6 +11,7 @@
android:layout_width="@dimen/module_small_map_view_border_width"
android:layout_height="@dimen/module_small_map_view_border_height"
android:layout_centerInParent="true"
android:layout_margin="@dimen/module_small_map_padding"
android:background="@drawable/module_small_map_view_border" />
<com.mogo.module.common.view.RoundLayout