|
|
@@ -49,8 +49,11 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
private MarkersController markersController;
|
|
|
|
|
|
+ private final int viewId;
|
|
|
+
|
|
|
|
|
|
public AmapView(Context context, Activity activity, BinaryMessenger messenger, int viewId, Map<String, Object> args, LifecycleOwner lifecycleProvider) {
|
|
|
+ this.viewId = viewId;
|
|
|
channel = new MethodChannel(messenger, Constants.MAP_VIEW_CHANNEL_NAME + viewId);
|
|
|
channel.setMethodCallHandler(this);
|
|
|
myMethodCallHandlerMap = new HashMap<>(8);
|
|
|
@@ -59,7 +62,6 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
mapView = new TextureMapView(context);
|
|
|
AMap amap = mapView.getMap();
|
|
|
initMapDefaultSetting(amap);
|
|
|
-
|
|
|
markersController = new MarkersController(context, channel, amap);
|
|
|
mapController = new MapController(context, channel, amap);
|
|
|
|
|
|
@@ -108,7 +110,7 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
@Override
|
|
|
public void dispose() {
|
|
|
- LogUtil.i(TAG, "dispose==>");
|
|
|
+ LogUtil.i(TAG, "dispose==>" + viewId);
|
|
|
try {
|
|
|
if (disposed) {
|
|
|
return;
|
|
|
@@ -143,7 +145,7 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
@Override
|
|
|
public void onCreate(@NonNull LifecycleOwner owner) {
|
|
|
- LogUtil.i(TAG, "onCreate==>");
|
|
|
+ LogUtil.i(TAG, "onCreate==>" + viewId);
|
|
|
try {
|
|
|
if (disposed) {
|
|
|
return;
|
|
|
@@ -158,13 +160,13 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
@Override
|
|
|
public void onStart(@NonNull LifecycleOwner owner) {
|
|
|
- LogUtil.i(TAG, "onStart==>");
|
|
|
+ LogUtil.i(TAG, "onStart==>" + viewId);
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public void onResume(@NonNull LifecycleOwner owner) {
|
|
|
- LogUtil.i(TAG, "onResume==>");
|
|
|
+ LogUtil.i(TAG, "onResume==>" + viewId);
|
|
|
try {
|
|
|
if (disposed) {
|
|
|
return;
|
|
|
@@ -179,7 +181,7 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
@Override
|
|
|
public void onPause(@NonNull LifecycleOwner owner) {
|
|
|
- LogUtil.i(TAG, "onPause==>");
|
|
|
+ LogUtil.i(TAG, "onPause==>" + viewId);
|
|
|
try {
|
|
|
if (disposed) {
|
|
|
return;
|
|
|
@@ -192,12 +194,12 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
@Override
|
|
|
public void onStop(@NonNull LifecycleOwner owner) {
|
|
|
- LogUtil.i(TAG, "onStop==>");
|
|
|
+ LogUtil.i(TAG, "onStop==>" + viewId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onDestroy(@NonNull LifecycleOwner owner) {
|
|
|
- LogUtil.i(TAG, "onDestroy==>");
|
|
|
+ LogUtil.i(TAG, "onDestroy==>" + viewId);
|
|
|
try {
|
|
|
if (disposed) {
|
|
|
return;
|
|
|
@@ -210,7 +212,7 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
@Override
|
|
|
public void onSaveInstanceState(@NonNull Bundle bundle) {
|
|
|
- LogUtil.i(TAG, "onDestroy==>");
|
|
|
+ LogUtil.i(TAG, "onSaveInstanceState==>" + viewId);
|
|
|
try {
|
|
|
if (disposed) {
|
|
|
return;
|
|
|
@@ -223,7 +225,7 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
|
|
|
|
|
|
@Override
|
|
|
public void onRestoreInstanceState(@Nullable Bundle bundle) {
|
|
|
- LogUtil.i(TAG, "onDestroy==>");
|
|
|
+ LogUtil.i(TAG, "onRestoreInstanceState==>" + viewId);
|
|
|
try {
|
|
|
if (disposed) {
|
|
|
return;
|