AnsweredAssumed Answered

Cannot read property 'on' of null     at Object.set (ExportWMSImageParameters.js:5)

Question asked by elerot on Aug 4, 2017
Latest reply on Oct 6, 2017 by khutchins-esristaff

Hi,

 

possilel bug issues about WMSLayer (api:4.4)

 

I am getting error while trying to use WMSLayer. 

 

ERROR: Cannot read property 'on' of null     at Object.set (ExportWMSImageParameters.js:5)

 

sample code from Sandbox: layers-wms

esriConfig.request.corsEnabledServers.push(
"mesonet.agron.iastate.edu");

layer = new WMSLayer({
// See http://mesonet.agron.iastate.edu/ogc/ for more WMS services from Iowa Environmental Mesonet (Iowa State University)
url: "https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi"
});

map = new Map({
//basemap: "dark-gray",
layers: [layer]
});
view = new MapView({
container: "viewDiv",
//center: [-123, 49],
//zoom: 5,
map: map
});

 

My code is smilar but it is typescript:

1- I am using for CORS:

esriConfig.request.corsEnabledServers.push(
"mesonet.agron.iastate.edu");

or:

urlUtils.addProxyRule({
urlPrefix: "https://mesonet.agron.iastate.edu",
proxyUrl: "/proxy"

});

and rest of the code:
var wmsLayer: any = new WMSLayer();
wmsLayer.url = "https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi"

this.mapManagerService.map.add(wmsLayer);

 

 

by the way I cant reach WMSLayer "url" property so I define it "any" type (Arcgis js Api: 4.4)

 

Thanks.

Outcomes