ArcGIS Runtime SDK For Android移除图层再加载不能更新问题
下载新的离线Geodatabase之前,先将原来的Geodatabase删除,再删除MapView中已经加载的原来Geodatabase的FeatureLayer;然后重新上服务器请求离线数据,等新的离线数据请求结束后,再重新加载离线Geodatabase数据。发现MapView显示的还是原来的数据。原来的图层确实从MapView移除了。
移除图层的代码:
layer.recycle();对图层进行回收,还是没有解决问题。
各位大神,有没有什么建议。
移除图层的代码:
for (Layer layer : mapView.getLayers()) {
if (layer instanceof FeatureLayer) {
mapView.removeLayer(layer);
layer.recycle();//Releases resources referenced by the Layer so that they can be recycled
}
}之前怀疑是FeatureLayer虽然从MapView中移除了,但是资源没有释放。但是已经使用layer.recycle();对图层进行回收,还是没有解决问题。
各位大神,有没有什么建议。
1 个回复
张赛
赞同来自:
另,如果新的geodatabase的名字和之前的名字不一样,直接加载新的geodatabase,是否可成功?
要回复问题请先登录或注册