概述:本节讲述Arcgis for Js加载ArcgisServer和GeoServer发布的wms服务。
1、定义resourceInfo
var resourceInfo = {
extent: new Extent(-126.40869140625,31.025390625,-109.66552734375,41.5283203125,{wkid: 4326}),
layerInfos: [],
version : '1.1.1'
};
2、加载ArcgisServer的wms
var agsWmsUrl = "http://localhost:6080/arcgis/services/road/MapServer/WMSServer";
var agsWmsLayer = new WMSLayer(agsWmsUrl,{resourceInfo: resourceInfo});
agsWmsLayer.setImageFormat("png");
agsWmsLayer.setVisibleLayers([0]);
map.addLayer(agsWmsLayer);
3、