I'm trying to print out a map from Python console. The issue is that when I add a layer to the map composer, the property of the map is set to cache. However, I want to change it to render so that the map would look less blurry.
Below is my code to add a layer to the map composer:
map_settings = iface.mapCanvas().mapSettings() c = QgsComposition(map_settings) view = iface.createNewComposer() view.setComposition(c) composerMap = QgsComposerMap(c, 10 ,10, 160, 20) composerMap.setBackgroundEnabled(True) rect = QgsRectangle(map_settings.fullExtent()) composerMap.setNewExtent(rect) composerMap.updateItem() c.addComposerMap(composerMap)
I am wondering if there is any way to set the main property of map as render instead of cache from Python console.