skyline加载arcgis发布的wms服务

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, "wms", "gisplg.rct", layerGroup,  LayerName);
    imagelayer.CoordinateSystem = sg.Terrain.CoordinateSystem;
}

}

你可能感兴趣的:(skyline二次开发)