Unable to Request a WCSLayer - removeQueryParameters()

1328
2
02-12-2021 07:47 AM
BlairScriven
New Contributor

Hey everyone!

I am having difficulty requesting a WCSLayer from a Geoserver (version 2.17) using Javascript API (version 4.17).  I have the following code to send the request:

var layer = new WCSLayer({
url: "http://localhost:8083/geoserver/ows?service=wcs&version=1.1.1&request=GetCoverage&IDENTIFIER=datastore:example",
version: "1.1.1",
opacity: 0.5
});

AND THEN the following ERROR message:

 [esri.layers.mixins.ImageryTileMixin] removeQueryParameters() Url query parameters are not supported, the following parameters have been removed: service, version, request, IDENTIFIER

For whatever reason, I can send in a request for a WMSLayer and it works just fine with the parameters in place. For example, if run a script with a WMSLayer request using the following:

http://localhost:8083/geoserver/datastore/wms?service=WMS 

The "service" parameter is not removed and the WMS is properly added to the application. Anyone have any idea what I am doing wrong?

Blair

 

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there,

 

WCSLayer for that matter other layers do not support queryparameters in the url property.  The API takes the service end point only from the url and strips out all query parameters just like other layers. You do not need to set service=wcs (the api takes care of it for the WCSLayer). You can use the WCSLayer.coverageId property for the identifier.

Please try the following code and see if it works for you.

var layer = new WCSLayer({
  url: "http://localhost:8083/geoserver/ows",
  version: "1.1.1",
  opacity: 0.5,
  coverageId: "datastore:example"
});

 

Hope this helps,

-Undral

0 Kudos
BlairScriven
New Contributor

Thanks for the quick reply!

I tried using the code you suggested, but I came up with the following error:

error: TypeError: Cannot read property 'title' of undefined
at d.<anonymous>

I have tried to experiment a bit with the WCSLayer properties, including adding "title" and "customParameters" properties, but I get the same error. I will keeping playing with the code and I will also try to see if there is something wrong with how I set up Geoserver (although my WCS settings are default). Thanks again though for helping!

-Blair

0 Kudos