使用Arcgis JavaScript 4.x添加Geoserver WMS层

时间:2019-12-12 19:08:31

标签: arcgis arcgis-js-api

我正在尝试将地理服务器层添加到arcgis javascript4.x。这是我到目前为止的内容:

var layer1 = new WMSLayerInfo({
    name: 'sf:layer01',
    title: 'sf:layer01'
});

var resourceInfo = {
    extent: new Extent(275935.148501, 2038404.844184, 276182.595821, 2038680.709887, {
    wkid: 2236
}),
    layerInfos: [layer1]
};

var wmsLayer = new WMSLayer('https://myserver/geoserver/sf/wms', {
    resourceInfo: resourceInfo,
    visibleLayers: ['sf:layer01']
});

map.addLayers([wmsLayer]);

到目前为止,我发现WMSLayerInfo object has been deprecated in 4.x。另外,如果我使用的是普通街道底图,如何告诉它使用EPSG:2236作为该层:

var map = new Map({
                basemap: "streets",
                layers: [miabasemaplayer]
            });

任何帮助将不胜感激。谢谢。

0 个答案:

没有答案