【问题标题】:ArcGIS Runtime Android SDK100.1.0 Offlinemap edit and synchArcGIS Runtime Android SDK100.1.0 离线地图编辑与同步
【发布时间】:2018-02-09 01:53:22
【问题描述】:

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

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 找到任何解决方案。请帮帮我。

【问题讨论】:

    标签: android arcgis esri arcgis-runtime arcgis-android-api


    【解决方案1】:

    您是否查看过编辑指南: 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

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

    【讨论】:

    • 感谢您的回复,但您发送的只是一个链接,除了同步链接和以上三个链接我都看过几次。同步将在编辑后完成。所以我关心的一点是如何编辑下载的地图并在同步之后。编辑功能是不同的东西。
    • 编辑下载的地图是什么意思?您是否尝试修改要素图层?
    • yes.. 假设我想在特定点上添加标记,这个点将是同步的,它也将显示在下一次的在线服务和离线服务中
    猜你喜欢
    • 2018-07-17
    • 2016-02-29
    • 2018-10-21
    • 2016-02-11
    • 2019-03-20
    • 2018-01-02
    • 1970-01-01
    • 2019-02-02
    • 1970-01-01
    相关资源
    最近更新 更多