private void LoadMY()
{
try {
String mainGeodatabaseFilePath =
YLPub。getMapData() + “/gismap/sl。
geodatabase”;
mMapView = (MapView) findViewById(R。id。mapView);
String tpk=YLPub。getMapData() + “/gismap/map。
tpk”;
TileCache vTileCache = new TileCache(tpk);
ArcGISTiledLayer mainArcGISTiledLayer = new ArcGISTiledLayer(vTileCache);
Basemap mainBasemap = new Basemap(mainArcGISTiledLayer);
pMap = new ArcGISMap(mainBasemap);
mMapView 。
setMap(pMap);
final Geodatabase mainGeodatabase = new Geodatabase(mainGeodatabaseFilePath);
mainGeodatabase。
loadAsync();
mainGeodatabase。addDoneLoadingListener(new Runnable() {
@Override
public void run() {
List<GeodatabaseFeatureTable> resultsGFT = mainGeodatabase。
getGeodatabaseFeatureTables();
int valueCount = resultsGFT。size();
for (int i = valueCount – 1; i > -1; i–) {
FeatureLayer valueFL = new FeatureLayer(resultsGFT。
get(i));
valueFL。setVisible(true);
LayerList mainLayerList = pMap。getOperationalLayers();
mainLayerList。
add(valueFL);
}
}
});
} catch (Exception e) {
}
}Arcgis Runtime for andriod 100 加载geodatabase。

相关推荐