首页 / 浏览问题 / 云GIS / 问题详情
使用openlayer加载图层报错
10EXP 2018年12月25日

使用产品:iserver 9D(9.1.0)  操作系统:win2012 x64
数据类型: 文件型

在使用openlayer 加载图层信息的时候,js报错
Uncaught ha {message: "Assertion failed. See https://openlayers.org/en/v4.6.5/doc/errors/#58 for details.", code: 58, name: "AssertionError"}

var map = new ol.Map({
    target: 'map',
    controls: ol.control.defaults({attributionOptions: {collapsed: false}}),
    view: new ol.View({
        center: [24.36, 109.52],
        zoom: 10,
        projection: 'EPSG:4326'
    })
});
var layer = new ol.layer.Tile({
    source: new ol.source.TileSuperMapRest({
        url: mapList[i].mapUrl,
        //wrapX: true
    }),
    projection: 'EPSG:4326'
});

1个回答

您好,你这个是地图都出不来吧?请根据我写的代码检查自己的代码

<script type="text/javascript">
    var url = (window.isLocal ? window.server : "http://support.supermap.com.cn:8090")+"/iserver/services/map-world/rest/maps/World";
    map = new ol.Map({
        target: 'map',
        controls: ol.control.defaults({attributionOptions: {collapsed: false}})
            .extend([new ol.supermap.control.Logo()]),
        view: new ol.View({
            center: [0, 0],
            zoom: 3,
            projection: 'EPSG:4326'
        })
    });
    var layer = new ol.layer.Tile({
        source: new ol.source.TileSuperMapRest({
            url: url
        }),
        projection: 'EPSG:4326'
    });
    map.addLayer(layer);

</script>
55,828EXP 2018年12月26日
...