Skip to content
Permalink
Browse files

possibility to add WMS layers through plugin interface

git-svn-id: http://svn.osgeo.org/qgis/trunk@8593 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jun 5, 2008
1 parent 2b3bb91 commit 65f81d256b207e13866ae13991a91e225c0e7fe3
@@ -39,6 +39,8 @@ class QgisInterface : QObject
virtual QgsVectorLayer* addVectorLayer(QString vectorLayerPath, QString baseName, QString providerKey)=0;
//! Add a raster layer given a raster layer file name
virtual QgsRasterLayer* addRasterLayer(QString rasterLayerPath, QString baseName = QString())=0;
//! Add a WMS layer
virtual QgsRasterLayer* addRasterLayer(const QString& url, const QString& layerName, const QString& providerKey, const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs) = 0;

//! Add a project
virtual bool addProject(QString theProject)=0;
@@ -5216,7 +5216,7 @@ QgsRasterLayer* QgisApp::addRasterLayer(QString const & rasterFile, QString cons
\note Copied from the equivalent addVectorLayer function in this file
TODO Make it work for rasters specifically.
*/
void QgisApp::addRasterLayer(QString const & rasterLayerPath,
QgsRasterLayer* QgisApp::addRasterLayer(QString const & rasterLayerPath,
QString const & baseName,
QString const & providerKey,
QStringList const & layers,
@@ -5232,7 +5232,7 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,

if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
return 0;
}

mMapCanvas->freeze();
@@ -5278,6 +5278,7 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,
// draw the map
mMapCanvas->freeze(false);
mMapCanvas->refresh();
return layer;

// Let render() do its own cursor management
// QApplication::restoreOverrideCursor();
@@ -96,7 +96,7 @@ class QgisApp : public QMainWindow
* Note this is included to support WMS layers only at this stage,
* GDAL layer support via a Provider is not yet implemented.
*/
void addRasterLayer(QString const & rasterLayerPath,
QgsRasterLayer* addRasterLayer(QString const & rasterLayerPath,
QString const & baseName,
QString const & providerKey,
QStringList const & layers,
@@ -77,6 +77,12 @@ QgsRasterLayer* QgisAppInterface::addRasterLayer(QString rasterLayerPath, QStrin
return qgis->addRasterLayer(rasterLayerPath, baseName);
}

QgsRasterLayer* QgisAppInterface::addRasterLayer(const QString& url, const QString& baseName, const QString& providerKey, \
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs)
{
return qgis->addRasterLayer(url, baseName, providerKey, layers, styles, format, crs);
}


bool QgisAppInterface::addProject(QString theProjectName)
{
@@ -54,6 +54,9 @@ class QgisAppInterface : public QgisInterface
QgsVectorLayer* addVectorLayer(QString vectorLayerPath, QString baseName, QString providerKey);
//! Add a raster layer given its file name
QgsRasterLayer* addRasterLayer(QString rasterLayerPath, QString baseName);
//! Add a WMS layer
QgsRasterLayer* addRasterLayer(const QString& url, const QString& baseName, const QString& providerKey, \
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs);

//! Add a project
bool addProject(QString theProjectName);
@@ -72,6 +72,9 @@ class GUI_EXPORT QgisInterface : public QObject
virtual QgsVectorLayer* addVectorLayer(QString vectorLayerPath, QString baseName, QString providerKey)=0;
//! Add a raster layer given a raster layer file name
virtual QgsRasterLayer* addRasterLayer(QString rasterLayerPath, QString baseName = QString())=0;
//! Add a WMS layer
virtual QgsRasterLayer* addRasterLayer(const QString& url, const QString& layerName, const QString& providerKey, const QStringList& layers, \
const QStringList& styles, const QString& format, const QString& crs) = 0;

//! Add a project
virtual bool addProject(QString theProject)=0;

0 comments on commit 65f81d2

Please sign in to comment.
You can’t perform that action at this time.