arcgis for Android 100.3 ArcgisScene 加载本地TPK 不显示 10C

SceneView 加载TPK

        SceneView mapView = findViewById(R.id.arcgis);
        ArcGISScene arcGISMap = new ArcGISScene(new Basemap());
        mapView.setScene(arcGISMap);

        String path = FileUtil.getInstance().getMapTpkPath() + "dixing.tpk";
        TileCache tileCache = new TileCache(path);
        tileCache.loadAsync();
        tileCache.addDoneLoadingListener(() -> {
            if(tileCache.getLoadStatus() == LoadStatus.LOADED){
                ArcGISTiledLayer arcGISTiledLayer = new ArcGISTiledLayer(tileCache);
                arcGISTiledLayer.loadAsync();
                if(arcGISTiledLayer.getLoadStatus() == LoadStatus.LOADED){
                    arcGISMap.getBasemap().getBaseLayers().add(arcGISTiledLayer);
                    mapView.setViewpoint(new Viewpoint(arcGISTiledLayer.getFullExtent()));
                }else {
                    ArcGISRuntimeException exception = arcGISTiledLayer.getLoadError();
                    System.out.println();
                }
            }else {
                ArcGISRuntimeException exception = tileCache.getLoadError();
                System.out.println();
            }
        });

MapView 加载TPK

        MapView mapView = findViewById(R.id.mapView);
        ArcGISMap arcGISMap = new ArcGISMap(new Basemap());
        mapView.setMap(arcGISMap);

        String path = FileUtil.getInstance().getMapTpkPath() + "dixing.tpk";
        TileCache tileCache = new TileCache(path);
        tileCache.loadAsync();
        tileCache.addDoneLoadingListener(() -> {
            if(tileCache.getLoadStatus() == LoadStatus.LOADED){
                ArcGISTiledLayer arcGISTiledLayer = new ArcGISTiledLayer(tileCache);
                arcGISTiledLayer.loadAsync();
                if(arcGISTiledLayer.getLoadStatus() == LoadStatus.LOADED){
                    arcGISMap.getBasemap().getBaseLayers().add(arcGISTiledLayer);
                    mapView.setViewpoint(new Viewpoint(arcGISTiledLayer.getFullExtent()));
                }else {
                    ArcGISRuntimeException exception = arcGISTiledLayer.getLoadError();
                    System.out.println();
                }
            }else {
                ArcGISRuntimeException exception = tileCache.getLoadError();
                System.out.println();
            }
        });

差不多同样的逻辑,MapView加载TPK,毫无问题。SceneView不显示,也不报错

有没有遇到过类似问题同学?

是否说明ArcgisScene不支持TPK?

1个回答

han317426731
大王来寻春 请认真审题,大兄弟
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!