Adding geoserver wms layer using arcgis javascript 4.x

社会主义新天地 提交于 2020-01-25 04:40:14

问题


I am trying to add a geoserver layer to arcgis javascript 4.x. Here is what I have so far:

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

So far, I found out that the WMSLayerInfo object has been deprecated in 4.x. Also how do I tell it to use EPSG: 2236 for this layer if I am using the normal streets base map:

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

Any help would be appreciate. Thank you.

来源:https://stackoverflow.com/questions/59311278/adding-geoserver-wms-layer-using-arcgis-javascript-4-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!