【问题标题】:How can I use Base map from GIBS in Arcgis android Sdk如何在 Arcgis android Sdk 中使用来自 GIBS 的基本地图
【发布时间】:2019-01-23 15:10:11
【问题描述】:

我想在 arcgis android sdk 中使用来自NSA GIBS 的最新图像,这可能吗? 我也可以从上述服务下载瓷砖到缓存/离线地图吗?

我尝试过: WMSLayer 来自 arcgis android 的类 和 WebTiledLayer
以下我用于 WebTiledLayer 的代码

    mMapView = (MapView) findViewById(R.id.mapView);


    String templateUri = "https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Terra_Aerosol/default/2014-04-09/GoogleMapsCompatible_Level6/{level}/{row}/{col}.png";

    // webtile layer
    final WebTiledLayer webTiledLayer = new WebTiledLayer(templateUri);
    webTiledLayer.loadAsync();
    webTiledLayer.addDoneLoadingListener(new Runnable() {
        @Override
        public void run() {
            if (webTiledLayer.getLoadStatus() == LoadStatus.LOADED) {
                // use webtile layer as Basemap

                final ArcGISMap map = new ArcGISMap(new Basemap(webTiledLayer));

                mMapView.setMap(map);

                // custom attributes
            }else {
                webTiledLayer.getLoadError().printStackTrace();
            }
        }
    });

结果是一张空地图

【问题讨论】:

  • 编辑工作做得很好!但是,对您的问题有一些近距离投票。 (你看不到它,但我可以,因为我在这里的代表级别。)你可能想要编辑更多 - 告诉我们当你尝试这些事情时发生了什么。如果您的代码 sn-ps 显示 WMSLayer 和 WebTiledLayer 如何不适合您,请包含它们。祝你好运!

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


【解决方案1】:

我刚刚测试了您的代码,它似乎工作得很好。您是否在清单中请求了互联网权限?

<uses-permission android:name="android.permission.INTERNET" />

尝试将您的代码放在this sample 的 onCreate 中——它会起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-29
    • 2017-01-26
    • 2015-05-30
    • 2016-05-12
    • 1970-01-01
    • 2017-06-30
    • 2012-07-16
    • 2015-07-10
    相关资源
    最近更新 更多