javascript调用我自己发布的iserver服务,地图不显示,但是调用原始提供的可以显示。
代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SuperMap REST 3857地图</title>
<script type="text/javascript" src="include-openlayers.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%">
<div id="map" style="width: 100%;height:100%"></div>
<script type="text/javascript">
var map, url = "http://ip:8090/iserver/services/map-MapWorldChina2/wms111/MapWorldChina";
map = new ol.Map({
target: 'map',
controls: ol.control.defaults({attributionOptions: {collapsed: false}})
.extend([new ol.supermap.control.Logo()]),
view: new ol.View({
center: [108.07 , 30.84],
zoom: 1,
projection: 'EPSG:3857'
})
});
var layer = new ol.layer.Tile({
source: new ol.source.TileSuperMapRest({
url: url,
wrapX: true
}),
projection: 'EPSG:3857'
});
map.addLayer(layer);
</script>
</body>
</html>
请大神帮忙解决!!谢谢!!