终于OK
internal class AMapPlatformView(context: Context, id: Int, options: AMapOptions) :
PlatformView {
private lateinit var mapView: TextureMapView
private lateinit var amap: AMap
override fun getView(): View {
return mapView
}
override fun dispose() {
mapView.onDestroy()
}
init {
MapsInitializer.updatePrivacyShow(context, true, true);
MapsInitializer.updatePrivacyAgree(context, true);
mapView = TextureMapView(context, options)
amap = mapView.map
mapView.onCreate(null)
}
}