利用这种方法,可以在天地图上加上自己的图层,代码如下:
var map;
function init(){
var bounds = new GeoSurf.Bounds(
59.99166666666667,0.008333333333333304,152.49166666666667,90.00833333333334
);
var options = {
units: 'degrees'
};
map = new GeoSurf.PortalMap('map', options);
var ll = new GeoSurf.Layer.WMS(
"TerrainShade", "http://localhost:8080/geoserver/wms",
{
layers: 'wuhan:GG_TerrainShade',
tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
},
{
buffer: 0,
resolutions:[0.016666666666666666,0.033333333333333326,
0.06666666666666667,0.13333333333333333],
maxExtent: bounds,
displayOutsideMaxExtent: false
}
);
map.addLayer(ll);
map.zoomToExtent(bounds);
}
本文介绍如何在天地图上叠加自定义图层,通过调用天地图API和配置WMS服务地址,实现了将本地GeoServer提供的'wuhan:GG_TerrainShade'图层显示在地图上,详细展示了相关的代码实现和配置参数。
1631

被折叠的 条评论
为什么被折叠?



