Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to add a wms-Layer to QGIS Desktop from my plugin(c++)

QString uri= "crs=EPSG:28992&layers=natura2000:natura2000&styles=&format=image/png&url=

QString myProviderName      = "wms";
QgsRasterLayer* lyr= mQGisIface->addRasterLayer(uri ,"test", myProviderName);

But in QGis i get the Message, the extent of the layer could not be calculated because of unknown dataprovider.

What do i wrong? In QGIs Desktop manually adding this wms-layer is possible without problems. I also tested several other wms with same result.

Thanks for all help.

share|improve this question
Sorry, i have an error in building the uri. the code is correct. the plugin is working now. – schmiddor Dec 12 '12 at 15:32
I'm having similar problem, can you explain how you fixed it? Sorry to put this in "answer" and not in comment, but as a new user I'm not allowed to leave comments. – Mauricio Vidulin Jun 27 '14 at 9:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.