Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip ?request=getcapabilities from request before add request=getmap #287

Open
pvgenuchten opened this issue Apr 12, 2022 · 2 comments
Open

Comments

@pvgenuchten
Copy link
Contributor

not sure if this is an openlayers or wegue issue

if you add a wms layer by url example.com/ows?service=wms&request=getcapabilities

the viewer adds; request=getmap to the querystring, without removing request=getcapabilities

just to verify, the getmap request is send to the submitted getcapabilites url or the onlineresource as advertised in capabilities?

@JakobMiksch
Copy link
Collaborator

JakobMiksch commented May 3, 2022

I can reproduce it with

{
    "type": "WMS",
    "lid": "ahocevar-wms",
    "format": "image/png",
    "layers": "topp:states",
    "url": "https://ahocevar.com/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities",
    "XXXurl": "https://ahocevar.com/geoserver/wms",
    "transparent": true,
    "singleTile": false,
    "projection": "EPSG:3857",
    "attribution": "",
    "isBaseLayer": false,
    "visible": true,
    "displayInLayerList": true
  },

As far I can see from the code the url is taken as is and no parsing of the capabilities is done.

createWmsLayer (lConf) {

Does it work for you to just skip the query params of your provided url?

@pvgenuchten
Copy link
Contributor Author

Yes it works without the query, a typical use case is to find a record in a catalogue, take the wms url from the record as-is, this url often has the ?request=getcapabilities postfix, splitting at ? Is not a good idea, because some wms urls include a required parameter, like mapserver; map=foo.map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants