【问题标题】:Loading webmap fails, most layers not loaded加载 webmap 失败,大多数图层未加载
【发布时间】:2018-06-06 12:46:09
【问题描述】:

我正在尝试加载此网络地图 (https://oebb.maps.arcgis.com/home/item.html?id=f89eab37e55540f7b2e25a88cd0a07d5),但大多数图层未显示。 它可以在网络上运行,但在 Android 上失败(使用最新的 sdk,100.2.1)。

class MainActivity : AppCompatActivity() {

    lateinit var mMapView: MapView

    private lateinit var map: ArcGISMap

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // inflate MapView from layout
        mMapView = findViewById(R.id.mapview)


        val leftPoint = Point(16.374120968073157, 48.186396114084104, SpatialReferences.getWgs84())
        val rightPoint = Point(16.38101960965946, 48.18357774813336, SpatialReferences.getWgs84())
        val initialExtent = Envelope(leftPoint, rightPoint)

        //construct a map from the portal item
        map = ArcGISMap("https://oebb.maps.arcgis.com/home/item.html?id=f89eab37e55540f7b2e25a88cd0a07d5")

        // set starting envelope for the ArcGISMap
        map.initialViewpoint = Viewpoint(initialExtent)

        // Pass a WebMap to the MapView constructor overload to display it.
        mapview.map = map

    }

    override fun onPause() {
        super.onPause()
        mMapView.pause()
    }

    override fun onResume() {
        super.onResume()
        mMapView.resume()
    }

    override fun onDestroy() {
        super.onDestroy()
        mMapView.dispose()
    }
}

10 个图层中有 9 个出现异常(map.operationalLayer[0].loadError: ArcGISRuntimeException: Invalid JSON.

【问题讨论】:

    标签: android arcgis arcgis-android-api


    【解决方案1】:

    您的代码似乎没问题,问题可能出在加载网络地图的 100.2.1 Android SDK 内部。这个问题应该会在几周后发布的版本 100.3.0 中得到解决。我在内部构建中运行了您的代码,并且您的图层和符号呈现类似于网络版本。

    【讨论】:

    • 谢谢!我会在它发布时尝试一下。另外仅供参考,java sdk 也有同样的问题。
    猜你喜欢
    • 2019-09-27
    • 2021-04-07
    • 1970-01-01
    • 2020-06-24
    • 1970-01-01
    • 2020-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多