Exemplo n.º 1
0
 def test_inasafeMap(self):
     """Test making a pdf using the ISMap class."""
     myLayer, myType = loadLayer('test_shakeimpact.shp')
     del myType
     myCanvasLayer = QgsMapCanvasLayer(myLayer)
     CANVAS.setLayerSet([myCanvasLayer])
     myMap = ISMap(IFACE)
     myRect = QgsRectangle(106.7894, -6.2308, 106.8004, -6.2264)
     CANVAS.setExtent(myRect)
     CANVAS.refresh()
     myMap.setImpactLayer(myLayer)
     myPath = os.path.join(getTempDir(), 'outCustom.pdf')
     if os.path.exists(myPath):
         os.remove(myPath)
     myMap.makePdf(myPath)
     assert os.path.exists(myPath)
     # ,, note:: Template writing is experimental
     myMap.writeTemplate(os.path.join(getTempDir(), 'template.qpt'))