[Qgis-developer] Adding a WMS layer in QGIS 2.0 (python)

Luca Manganelli luca76 at gmail.com
Thu Oct 3 04:21:36 PDT 2013


On Wed, Oct 2, 2013 at 6:10 PM, Enzo Ciarmoli <enzo.ciarmoli at csi.it> wrote:

> **
> QgsRasterLayer constructor has changed, now it accept four arguments, the
> first is the uri string.
>
> To construct the uri string you must know what layers you want.
>
> You could try this:
>
> desired_layer = 'abcdefg'
> uri = 'crs=EPSG:25832&featureCount=10&format=image/png&layers=' +
> desired_layer + '&styles=&url=http://testsrv/mapaccel?map=ciao.map'
> rlayer = self.iface.addRasterLayer(uri, 'test', 'wms')
>
>
>
> Hope this helps!
>
>
>
> Enzo
>
>
>

This works! Thank you in advance :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131003/949e32c9/attachment.html>


More information about the Qgis-developer mailing list