I'm creating a python plugin for different users that has the layers that each person need to use and work with in QGIS.

I have no trouble adding rasters from Geoserver using the following code:

        wmsTicketDSM= QgsRasterLayer('contextualWMSLegend=0&crs=EPSG:27700&dpiMode=7&featureCount=10&format=image/png&layers=Ticket_DSM&password=XXXXXXXXXXXX&styles=&url=', 'Ticket_DSM', 'wms')
        if not wmsTicketDSM.isValid():
            print "Layer wmsTicketDSM failed to load!"
            print "Raster Layer wmsTicketDSM loaded!"

Now I need to add basemaps. How to add a Google Satellite map on python?

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.