4

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=http://62.12.41.211:8080/geoserver/exchange_maps/wms&username=admin', 'Ticket_DSM', 'wms')
        if not wmsTicketDSM.isValid():
            print "Layer wmsTicketDSM failed to load!"
        else:
            print "Raster Layer wmsTicketDSM loaded!"
        QgsMapLayerRegistry.instance().addMapLayer(wmsTicketDSM,False)

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.