问题
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