欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

skyline加载arcgis发布的wms服务

程序员文章站 2022-03-21 17:32:43
function AddWMSLayer(LayerName) {var _WMSUrl =“http://10.0.4.141:6080/arcgis/services/poss1/MapServer/WmsServer”;var layerGroup = sg.ProjectTree.FindI ......

function addwmslayer(layername) {
var _wmsurl =“http://10.0.4.141:6080/arcgis/services/poss1/mapserver/wmsserver”;
var layergroup = sg.projecttree.finditem(“layers”);
if (layergroup == “”){
layergroup = sg.projecttree.creategroup(“layers”, “”);
}

if (layername != null && layername != "") {
var itemidlayer = sg.projecttree.finditem("layers\\" + layername);
if (itemidlayer != ""){
sg.projecttree.deleteitem(itemidlayer);
}

var wmsstr =
"[info]\n" +
"meters=1.2m\n" +
"mpp=0.000027578125" + "\n"
+"url=" + _wmsurl + "?request=getmap&version=1.3.0&service=wms&crs=crs:84&bbox=113.54910763279433,24.5858358542103,113.57569495732433,24.628050567114293&height=256&width=256&layers=0&styles=&format=image/png\n"
+ "xul=113.54910763279433" + "\n" +
"ylr=24.5858358542103" + "\n" +
"xlr=113.57569495732433" + "\n" +
"yul=24.628050567114293" + "\n";
var imagelayer = sg.creator.createimagerylayer("wms",113.54910763279433, 24.5858358542103,113.57569495732433,24.628050567114293, "<ext><extinfo><![cdata[" + wmsstr + "]]></extinfo><exttype>wms</exttype></ext>", "gisplg.rct", layergroup, layername);
imagelayer.coordinatesystem = sg.terrain.coordinatesystem;
}

}

修改一下

————————————————
版权声明:本文为csdn博主「li_ming_yue」的原创文章,遵循cc 4.0 by-sa 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/li_ming_yue/article/details/88990584