On Mon, Mar 3, 2008 at 9:08 PM, Rob McCulley <[EMAIL PROTECTED]> wrote:
>
> Can a WMS Layer be added to an application built using the python bindings?
>
>
>
> I've tried to do it using a few variations of parameters with the
> QgsDataSourceURI(), but my lyr.isValid() is always false.
>
>
>
> Can I add a WMS Layer using the python bindings, and if so, how?

It *should* be possible. There's a following constructor (available
also from python) of raster layers which is used in case of WMS:

  QgsRasterLayer(int dummy,
                 const QString & baseName = QString(),
                 const QString & path = QString(),
                 const QString & providerLib = QString(),
                 const QStringList & layers = QStringList(),
                 const QStringList & styles = QStringList(),
                 const QString & format = QString(),
                 const QString & crs = QString(),
                 const QString & proxyHost = QString(),
                 int proxyPort = 80,
                 const QString & proxyUser = QString(),
                 const QString & proxyPass = QString());

I have never done something with WMS so can't supply you with a
working example, but to get an idea how to fill in the parameters, see
QgisApp::addWmsLayer() and debug output from QgisApp::addRasterLayer()
in src/app/qgisapp.cpp.

Regards
Martin
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user

Reply via email to