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

QGISServer wms layers on OL3 #306

Open
stefan-simon opened this issue Jul 11, 2016 · 5 comments
Open

QGISServer wms layers on OL3 #306

stefan-simon opened this issue Jul 11, 2016 · 5 comments

Comments

@stefan-simon
Copy link

Hi,

when a layer url is server_url/qgisserver.fcgi?map=/location_to_qgs/proj.qgs,
in js code, "map=.." is encoded lyke "map%3D..." and this is causing error and
the qgis wms layer is not loaded

thanks,

Stefan

@tomchadwin
Copy link
Collaborator

OK. My testing was with Geoserver. I have no experience with QGIS server. What is the error?

@stefan-simon
Copy link
Author

stefan-simon commented Jul 11, 2016

Actually is not an error, is an wrong answer from qgis server.
Ex:

var lyr_layer_one = new ol.layer.Tile({
                        source: new ol.source.TileWMS(({
                          url: "http://11.22.33/cgi-bin/qgis_mapserv.fcgi?map%3D/var/home/project.qgs",
                          params: {"LAYERS": "layer%20one", "TILED": "true"},
                        })),
                        title: "layer one"
                      })

we have to change %3D with =
and %20 with ' ' (space character)
If we alter the url to: http://11.22.33/cgi-bin/qgis_mapserv.fcgi?map=/var/home/project.qgs and
layers param to: layer%20one we get the expected result: the layers are displayed in OL map.

Thanks,
Stefan

P.S. you've done a great job with this plugin :) . Thank you

@tomchadwin
Copy link
Collaborator

Ah, thanks for figuring this out so quickly. Nice one! So I need to be able to detect when a Web services layer is from QGIS, and unencode those characters. If I search for qgis_mapserv in the layer address, will that do it?

@tomchadwin
Copy link
Collaborator

Looks like we'll have to query the server to find out:

http://lists.osgeo.org/pipermail/qgis-developer/2016-July/043717.html

Thanks, @elpaso, for the pointer.

@stefan-simon
Copy link
Author

to check the project settings is a nice one :) . good luck..

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