I am trying to load the WMS layers into my JavaScript application, but I get a "failed to fetch” error message.
Her is my js code to just display the resource in an empty map:
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/WMSLayer"
], function(Map, MapView, WMSLayer) {
var layer = new WMSLayer({
url:
"http://apollo.cdngiportal.co.za/erdas-iws/ogc/wms/CDNGI_PORTAL_BACKDROP?",
sublayers: [
{
name: "CDNGI_2mil_Mosaic"
}
]
});
var map = new Map({
layers: [layer]
});
var view = new MapView({
container: "viewDiv",
map: map,
spatialReference: 4326,
});
});
Any guidance would be much appreciated,
Pieter