发布的服务需要选择WMS功能
wmsLayer = new T.TileLayer.WMS("http://127.0.0.1:6080/arcgis/services/Demo/Default20180706/MapServer/WMSServer", { CRS: "EPSG:4326", //地图投影类型 request: "GetMap", //操作名称 version: "1.3.0", //请求服务的版本 services: "wms", //服务类型标识符 layers: "0,1,2,3", //用","分隔的多个图层列表 transparent: true, //输出图像背景是否透明 style: "default", //每个请求图层的用","分隔的描述样式 format: "image/png", //输出图像的类型 }); //将WMS图层添加到地图上 map.addLayer(wmsLayer);
参数可以在WMS服务路径(
http://127.0.0.1:6080/arcgis/services/Demo/Default20180706/MapServer/WMSServer
)下直接查看