示例#1
0
 def init_qgisproject(self, doc):
     parser = ProjectParser(doc)
     canvasnode = parser.canvasnode
     self.canvas.freeze()
     self.canvas.mapRenderer().readXML(canvasnode)
     self.canvaslayers = parser.canvaslayers()
     self.canvas.setLayerSet(self.canvaslayers)
     #red = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorRedPart", 255 )[0];
     #green = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorGreenPart", 255 )[0];
     #blue = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorBluePart", 255 )[0];
     #color = QColor(red, green, blue);
     #self.canvas.setCanvasColor(color)
     self.canvas.updateScale()
     return self.canvas.mapRenderer().destinationCrs()
示例#2
0
文件: mapwidget.py 项目: xCherry/Roam
 def init_qgisproject(self, doc):
     parser = ProjectParser(doc)
     canvasnode = parser.canvasnode
     self.canvas.freeze()
     self.canvas.mapRenderer().readXML(canvasnode)
     self.canvaslayers = parser.canvaslayers()
     self.canvas.setLayerSet(self.canvaslayers)
     #red = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorRedPart", 255 )[0];
     #green = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorGreenPart", 255 )[0];
     #blue = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorBluePart", 255 )[0];
     #color = QColor(red, green, blue);
     #self.canvas.setCanvasColor(color)
     self.canvas.updateScale()
     return self.canvas.mapRenderer().destinationCrs()
示例#3
0
 def _readProject(self, doc):
     """
     readProject is called by QgsProject once the map layer has been
     populated with all the layers
     """
     parser = ProjectParser(doc)
     canvasnode = parser.canvasnode
     self.canvas.mapRenderer().readXML(canvasnode)
     self.canvaslayers = parser.canvaslayers()
     self.canvas.setLayerSet(self.canvaslayers)
     self.canvas.updateScale()
     self.canvas.freeze(False)
     self.canvas.refresh()
     self.projectOpened()
     self.showmap()
示例#4
0
 def _readProject(self, doc):
     """
     readProject is called by QgsProject once the map layer has been
     populated with all the layers
     """
     parser = ProjectParser(doc)
     canvasnode = parser.canvasnode
     self.canvas.freeze()
     self.canvas.mapRenderer().readXML(canvasnode)
     self.canvaslayers = parser.canvaslayers()
     self.canvas.setLayerSet(self.canvaslayers)
     #red = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorRedPart", 255 )[0];
     #green = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorGreenPart", 255 )[0];
     #blue = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorBluePart", 255 )[0];
     #color = QColor(red, green, blue);
     #self.canvas.setCanvasColor(color)
     self.canvas.updateScale()
     self.projectOpened()
     self.canvas.freeze(False)
     self.canvas.refresh()
     GPS.crs = self.canvas.mapRenderer().destinationCrs()
     self.showmap()
示例#5
0
 def _readProject(self, doc):
     """
     readProject is called by QgsProject once the map layer has been
     populated with all the layers
     """
     parser = ProjectParser(doc)
     canvasnode = parser.canvasnode
     self.canvas.freeze()
     self.canvas.mapRenderer().readXML(canvasnode)
     self.canvaslayers = parser.canvaslayers()
     self.canvas.setLayerSet(self.canvaslayers)
     #red = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorRedPart", 255 )[0];
     #green = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorGreenPart", 255 )[0];
     #blue = QgsProject.instance().readNumEntry( "Gui", "/CanvasColorBluePart", 255 )[0];
     #color = QColor(red, green, blue);
     #self.canvas.setCanvasColor(color)
     self.canvas.updateScale()
     self.projectOpened()
     self.canvas.freeze(False)
     self.canvas.refresh()
     GPS.crs = self.canvas.mapRenderer().destinationCrs()
     self.showmap()