[Qgis-developer] Tr : New QGis project, application : version is empty and wms layer invalid
Daniel
danielvaz at gmail.com
Sun Oct 6 16:27:18 PDT 2013
It works for me!
QString uri =
"crs=EPSG:4326&featureCount=10&format=image/gif&layers=osm_auto:all&styles=&url=
http://129.206.228.72/cached/osm";
QgsRasterLayer *rlayer = new QgsRasterLayer(uri, "layer_name", "wms",
false);
qDebug() << "layer is valid:" << rlayer->isValid();
connect( rlayer, SIGNAL(repaintRequested()), mapCanvas, SLOT(refresh())
);
QgsMapLayerRegistry::instance()->addMapLayer(rlayer);
QList <QgsMapCanvasLayer> myLayerSet;
myLayerSet.append(QgsMapCanvasLayer(rlayer, true));
//
mapCanvas->setExtent(rlayer->extent());
mapCanvas->enableAntiAliasing(true);
mapCanvas->freeze(false);
mapCanvas->setLayerSet(myLayerSet);
mapCanvas->setVisible(true);
mapCanvas->refresh();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131006/9ffc2981/attachment.html>
More information about the Qgis-developer
mailing list