代码如下;
<!DOCTYPE html>
<html>
<head>
<!--<meta charset="utf-8">-->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>FIRST</title>
<script src="libs/SuperMap.Include.js"></script>
<script type="text/javascript">
var map,layer;
// 设置访问的GIS服务地址
var url = "http://localhost:8090/iserver/services/map-ChinaProvinces/rest/maps/ChinaProvinces";
// var url = "http://localhost:8090/iserver/services/map-LinBan/rest/maps/map-LinBan";
function onPageLoad() {
// 创建地图对象
map = new SuperMap.Map("map");
// 创建图层对象
layer = new SuperMap.Layer.TiledDynamicRESTLayer("ChinaProvinces", url,{transparent: true, cacheEnabled: true}, {maxResolution:"auto"});
layer.events.on({"layerInitialized": addLayer});
}
function addLayer() {
// 向Map中添加图层
map.addLayer(layer);
map.setCenter(new SuperMap.LonLat(0, 0), 0);
}
</script>
</head>
<body onload=onPageLoad()>
<!--地图显示的div-->
<div id="map" style="position:absolute;left:0px;right:0px;width:800px;height:500px;">
</div>
</body>
</html>