如何在 ArcGIS jsapi 中添加 QGIS 图层?

How to add QGIS layer in ArcGIS jsapi?

我正在使用 ArcGIS jsapi。它适用于 ArcGIS MapServers,但我想添加 QGIS 图层。 我尝试使用 WmsLayer:

var map = new EsriMap("cgis-map", {
    logo: false,
    slider: false,
    lods: this._buildLods()
});
map.addLayers(this._buildLayers());

var wmsLayerInfo = new WMSLayerInfo({ name: "country", title: "QGIS Layer" });
var resourceInfo = {
    extent: extent,
    layerInfos: [wmsLayerInfo]
};
var wmsLayer = new WMSLayer("http://mrdata.usgs.gov/services/country", {
    resourceInfo: resourceInfo,
    format: "PNG24",
    transparent: true,
    version: "1.1.1",
    visibleLayers: ["country"]
});
map.addLayer(wmsLayer);

但是没用。 我该如何解决这个问题?

您需要为 resourceInfo 提供所有必需的属性。以下是所有属性的列表。您缺少 getMapURL

 String             copyright           
 String             description         
 Extent             extent              Required
 String             featureInfoFormat   
 String             getFeatureInfoURL   
 String             getMapURL           Required
 WMSLayerInfo       layerInfos          Required
 Number             maxHeight           
 Number             maxScale            
 Number             maxWidth            
 Number             minScale            
 String             title               
 String             version