首页 / 浏览问题 / 移动GIS / 问题详情
10i Lite 帮助文档示例代码地图无法加载
2EXP 2019年08月07日
I/MapView: LayView:China 第 1 次初始化地图参数失败,错误消息为:INITIALIZED_FAILED:key(LAYERVIEW_MAPPARAM_NULL) not found in resources.
W/com.supermap.android.maps.util: getJSON exception:socket failed: EPERM (Operation not permitted)
I/com.supermap.android.maps.layerview: key(LAYERVIEW_MAPPARAM_NULL) not found in resources.
I/MapView: LayView:China 第 2 次初始化地图参数失败,错误消息为:INITIALIZED_FAILED:key(LAYERVIEW_MAPPARAM_NULL) not found in resources.
W/com.supermap.android.maps.util: getJSON exception:socket failed: EPERM (Operation not permitted)
I/com.supermap.android.maps.layerview: key(LAYERVIEW_MAPPARAM_NULL) not found in resources.
W/MapView: LayView:China(http://support.supermap.com.cn:8090/iserver/services/map-china400/rest/maps/China)  第 3 次初始化地图参数失败,错误消息为:INITIALIZED_FAILED:key(LAYERVIEW_MAPPARAM_NULL) not found in resources., 将使用默认参数出图。

报错信息主要是这些,已参考之前的提问,加上了mapView.refresh(); 

但是依然报错...

  @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //创建地图窗口
        mapView = (MapView) this.findViewById(R.id.mapview);
        //创建地图图层,利用iServer地图服务
        LayerView layerView = new LayerView(this);
        layerView.setURL(DEFAULT_URL);
        //设置地图缩放
        mapView.setBuiltInZoomControls(true);
        //加载底图图层
        mapView.addLayer(layerView);
        mapView.refresh();
    }

1个回答

您好,在你设备上能够打开这个地址吗?http://support.supermap.com.cn:8090/iserver/services/map-china400/rest/maps/China

9,127EXP 2019年08月07日
可以打开的
您的代码是没有问题的,您那边有iserver吗?可以自己发布一个地图服务来测试一下,
这个链接也不行啊
...