I have the same program running on two different machine, one with Qgis 2.0 and the other Qgis 2.2. The machine running 2.2 doesn't seem to render the map canvas. I thought it was how I has creating the layers but sorted all that out. As a test I have set the canvas colour to red, it still comes up white on the 2.2 version.
The start of the code is as follows
class trackerMain(QtGui.QMainWindow, Ui_trackerMain): def __init__(self): QtGui.QMainWindow.__init__(self) self.setupUi(self) # set the canvas to white and fix the panning self.mapCanvas.setCanvasColor(QtCore.Qt.red) self.toolPan = QgsMapToolPan(self.mapCanvas) self.mapCanvas.setMapTool(self.toolPan) self.mapCanvas.mapRenderer().setDestinationCrs(QgsCoordinateReferenceSystem(4326)) self.mapCanvas.mapRenderer().setMapUnits(QGis.DecimalDegrees) self.mapCanvas.mapRenderer().setProjectionsEnabled(True) # Custom map tools self.auvGotoTool = AuvGotoTool(self.mapCanvas)Is there some additional step needed in the 2.2 that I am not doing as nothing on the canvas will render. I also have a custom map tool that works, it gtes the correct coordinate. When I load my layers and set the canvas extent to that of the layer it also works so it is just a render problem?
أكثر...
The start of the code is as follows
class trackerMain(QtGui.QMainWindow, Ui_trackerMain): def __init__(self): QtGui.QMainWindow.__init__(self) self.setupUi(self) # set the canvas to white and fix the panning self.mapCanvas.setCanvasColor(QtCore.Qt.red) self.toolPan = QgsMapToolPan(self.mapCanvas) self.mapCanvas.setMapTool(self.toolPan) self.mapCanvas.mapRenderer().setDestinationCrs(QgsCoordinateReferenceSystem(4326)) self.mapCanvas.mapRenderer().setMapUnits(QGis.DecimalDegrees) self.mapCanvas.mapRenderer().setProjectionsEnabled(True) # Custom map tools self.auvGotoTool = AuvGotoTool(self.mapCanvas)Is there some additional step needed in the 2.2 that I am not doing as nothing on the canvas will render. I also have a custom map tool that works, it gtes the correct coordinate. When I load my layers and set the canvas extent to that of the layer it also works so it is just a render problem?
أكثر...