1

I'm trying out some code from the book "QGIS Python Programming Cookbook Second Edition" and would like to add a tiled imagery map to my QGIS Application. I minimally adapted the code from the book and it now looks like this:

arc_map_server = "http://server.arcgisonline.com/"        
arc_map_server += "ArcGIS/rest/services/World_Imagery/MapServer?f=json"
basemap = QgsRasterLayer(arc_map_server, "World Imagery") 
QgsMapLayerRegistry.instance().addMapLayer(basemap) 

When I use the same URL in QGIS normally (without the ?f=json) and add the layer, it works without problems. Adding shapefiles as vector layers and other raster layers inside the standalone QGIS application works as well without problems.

But when try to run the above code inside the application, I am blocked on Port: 80. Is that on purpose, or am I doing something wrong?

If it is on purpose, is there an easy way to add a tiled imagery map to my QGIS standalone application?

OpenLayers I used when building plugins, but so far I haven't been able to find a way to reliably access it with the application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.