首页 / 浏览问题 / 移动GIS / 问题详情
地图无法显示
4EXP 2021年03月17日

地图提供给我一个类似这样一个地址url:

http://192.168.120.41:8091/iserver/services/map-china400/rest/maps/China, 按照 SuperMap iMobile Lite for Android的代码实现:
URL:http://端口/mapapi_v03/map-mongodb-420000_SL_0518_SKY_20200620-3k6ybamafh/rest/maps/420000_SL_0518_SKY_20200620";
protected MapView mapView;
//创建地图窗口
mapView = (MapView) this.findViewById(R.id.mapview);
//创建地图图层,并指向iServer提供的地图服务
LayerView layerView = new LayerView(this);
layerView.setURL(DEFAULT_URL);
//設置相关的参数
Credential.CREDENTIAL=new Credential("key","UUaV8peu81aNSEYBFyKCnEuo");
CoordinateReferenceSystem crs=new CoordinateReferenceSystem();
crs.wkid=4490;
layerView.setCRS(crs);
//加载地图图层
mapView.addLayer(layerView);
//设置地图缩放
mapView.setBuiltInZoomControls(true);
mapView.getController().setZoom(14);
mapView.getController().setCenter(new Point2D(110.805406,32.634872));
mapView.refresh();

程序没有报错,地图控件处能显示缩放,但是地图控件显示白色。控制台消息是

2021-03-17 10:31:58.932 14239-14298/com.xzq.supermaptest D/com.supermap.android.maps.fstilecache: key(FSTILECACHE_ADDTILE_NOTFOUND) not found in resources.
    java.io.FileNotFoundException: /storage/emulated/0/supermap/tiles/rest-map_1/420000_SL_0518_SKY_20200620/4490_18056_16384_8193_420000_SL_0518_SKY_20200620 (Permission denied)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:308)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:238)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:180)
        at com.supermap.imobilelite.maps.FSTileCache.addTile(FSTileCache.java:82)
        at com.supermap.imobilelite.maps.ThreadBasedTileDownloader$TileDownloadThread.addToDiskCache(ThreadBasedTileDownloader.java:787)
        at com.supermap.imobilelite.maps.ThreadBasedTileDownloader$TileDownloadThread.processTile(ThreadBasedTileDownloader.java:802)
        at com.supermap.imobilelite.maps.ThreadBasedTileDownloader$TileDownloadThread.run(ThreadBasedTileDownloader.java:824)
2021-03-17 10:32:00.999 14239-14301/com.xzq.supermaptest W/libEGL: EGLNativeWindowType 0x7df2d08010 disconnect failed
2021-03-17 10:32:02.656 14239-14239/com.xzq.supermaptest D/AwareBitmapCacher: handleInit switch not opened pid=14239

1个回答

您好,目前iMobile Lite产品已经开源,可以下载源码进行调试看数据是否打开成功,具体源码地址:

https://github.com/SuperMap/iMobile-Lite-for-Android

<!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6IjE4NzQtMTYwOTc0ODkzOTAyNSIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI6InBhcmFncmFwaCIsInJpY2hUZXh0Ijp7ImRhdGEiOlt7ImNoYXIiOiJoIn0seyJjaGFyIjoidCJ9LHsiY2hhciI6InQifSx7ImNoYXIiOiJwIn0seyJjaGFyIjoicyJ9LHsiY2hhciI6IjoifSx7ImNoYXIiOiIvIn0seyJjaGFyIjoiLyJ9LHsiY2hhciI6ImcifSx7ImNoYXIiOiJpIn0seyJjaGFyIjoidCJ9LHsiY2hhciI6ImgifSx7ImNoYXIiOiJ1In0seyJjaGFyIjoiYiJ9LHsiY2hhciI6Ii4ifSx7ImNoYXIiOiJjIn0seyJjaGFyIjoibyJ9LHsiY2hhciI6Im0ifSx7ImNoYXIiOiIvIn0seyJjaGFyIjoiUyJ9LHsiY2hhciI6InUifSx7ImNoYXIiOiJwIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6InIifSx7ImNoYXIiOiJNIn0seyJjaGFyIjoiYSJ9LHsiY2hhciI6InAifSx7ImNoYXIiOiIvIn0seyJjaGFyIjoiaSJ9LHsiY2hhciI6Ik0ifSx7ImNoYX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