2016-06-30 28 views
0

我正在使用ArcGIS jsapi。它適用於ArcGIS MapServers,但我想添加QGIS圖層。 我試圖用WmsLayer:如何在ArcGIS jsapi中添加QGIS圖層?

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); 

但它不工作。 我該如何解決這個問題?

+0

@Igorovics謝謝:) –

+0

歡迎您:) – Igorovics

回答

0

您需要提供所有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    
+0

** - getMapURL - 需要 - 爲GetMap請求的URL。如果必需在獲得性能的網址超過了網址的GetMap不同。** (https://developers.arcgis.com/javascript/3/jsapi/wmslayer.html) 我說這一點,併發送請求。靜止圖層不繪製。我會進一步找到解決方案。謝謝:) –

+0

請求沒有** SRS **參數。沒有** SRS **我無法獲得地圖圖像。要求:http://mrdata.usgs.gov/services/country?LAYERS=country&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&WIDTH=1620&HEIGHT=950&FORMAT=image/png&BBOX=4410576.073543704,7077960.229100895,4624889.001763704,7203637.563550896&TRANSPARENT=TRUE –

相關問題