0

我可以从 ArcGIS Android SDK-100.1.0 下载地图,但之后我将如何编辑此地图,即添加或删除标记点,在此编辑之后,我需要将离线编辑数据同步到 ArcGIS Map 服务器。这是我的离线地图代码-

private MapView mMapView;
private ArcGISMap map;
private ArcGISTiledLayer tiledLayer;
private Geodatabase geodatabase;
private Activity activity;

public void loadOfflineMap() {
    Toast.makeText(activity, activity.getFilesDir().getAbsolutePath(), Toast.LENGTH_LONG).show();

    //--- get links to cached resources
    String strTpkPath = activity.getFilesDir().getAbsolutePath()+"/tiles.tpk";
    String strGeoDbPath = activity.getFilesDir().getAbsolutePath()+"/layers.geodatabase";

    File sdCard = Environment.getExternalStorageDirectory();
    File dir = new File (sdCard.getAbsolutePath() + "/arcGIS");
    dir.mkdir();
    File file = new File(sdCard.getAbsolutePath() + "/testfile.txt");
    if (!file.exists()) {
        try {
            file.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    //--- create a tiled layer using the tile package
    TileCache tileCache = new TileCache(strTpkPath);
    tiledLayer = new ArcGISTiledLayer(tileCache);

    //--- set tiled layer as basemap
    Basemap basemap = new Basemap(tiledLayer);

    //--- create a map with the basemap
    map = new ArcGISMap(basemap);
    mMapView.setMap(map);

    //--- instantiate geodatabase with name
    geodatabase = new Geodatabase(strGeoDbPath);

    //--- load the geodatabase for feature tables
    geodatabase.loadAsync();

    //--- add feature layer from geodatabase to the ArcGISMap
    geodatabase.addDoneLoadingListener(new Runnable() {
        @Override
        public void run() {
            for (GeodatabaseFeatureTable geoDBTable: geodatabase.getGeodatabaseFeatureTables()) {
                mMapView.getMap().getOperationalLayers().add(new FeatureLayer(geoDBTable));
            }
        }
    });
}

我无法使用此版本的 ArcGIS SDK 找到任何解决方案。请帮我。

4

1 回答 1

0

您是否看过编辑指南: https ://developers.arcgis.com/android/latest/guide/editing.htm

和同步: https ://developers.arcgis.com/android/latest/guide/sync-offline-edits.htm

还有编辑附件的示例代码: https ://developers.arcgis.com/android/latest/sample-code/edit-feature-attachments.htm

如果这些不能回答您的任何问题,请告诉我,我会尽力提供进一步的帮助。

于 2017-08-31T22:10:28.150 回答