Add OpenLayers layer from QGIS's Python console?

المشرف العام

Administrator
طاقم الإدارة
On QGIS 2.4.0-Chugiak the Openlayers plugin is found under Web menu rather than the Plugins menu. How can you use the Python console to add a Openlayers Google Maps layer?

The following code give us the error OpenLayers plugin not loaded.

try: olplugin = qgis.utils.plugins['openlayers'] ol_gphyslayertype = olplugin.olLayerTypeRegistry.getById(0) olplugin.addLayer(ol_gphyslayertype)except KeyError: print 'OpenLayers plugin not loaded.'

أكثر...
 
أعلى