Created
May 17, 2016 01:50
-
-
Save nyalldawson/1b389d87e2c70ef44bd7307365217dbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qgis.gui import * | |
othermap = QgsMapCanvasMap(iface.mapCanvas()) | |
othermap.setZValue(-9.0) | |
settings = QgsMapSettings(iface.mapCanvas().mapSettings()) | |
def updatemap(): | |
global job | |
global settings | |
othermap.setContent(job.renderedImage(), settings.visibleExtent()) | |
def redrawmap(): | |
global job | |
global settings | |
settings = QgsMapSettings(iface.mapCanvas().mapSettings()) | |
settings.setLayers([iface.activeLayer().id()]) | |
job = QgsMapRendererParallelJob(settings) | |
job.finished.connect(updatemap) | |
job.start() | |
iface.mapCanvas().extentsChanged.connect(redrawmap) | |
redrawmap() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment