各位大佬,当前场景是,地图初始化的时候会加载个sci影像,后面会根据需求动态加载矢量数据,加载后进行叠加分析如果关闭界面关闭图层和数据源时,经常性的会发生anr和异常崩溃,
try { mMapView!!.removeAllCallOut(); mMap!!.trackingLayer.clear() mMap!!.layers.clear() mWorkspace!!.maps.clear() mWorkspace!!.datasources.closeAll() // mWorkspace!!.datasources.close("MapUdb") } catch (e: Exception) { }
var index=mWorkspace!!.datasources.count for(i in 0 until index){ mWorkspace!!.datasources.close(i) index=mWorkspace!!.datasources.count }