本文整理汇总了Python中safe_qgis.report.map.Map.getMapTitle方法的典型用法代码示例。如果您正苦于以下问题:Python Map.getMapTitle方法的具体用法?Python Map.getMapTitle怎么用?Python Map.getMapTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe_qgis.report.map.Map
的用法示例。
在下文中一共展示了Map.getMapTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getMapTitle
# 需要导入模块: from safe_qgis.report.map import Map [as 别名]
# 或者: from safe_qgis.report.map.Map import getMapTitle [as 别名]
def test_getMapTitle(self):
"""Getting the map title from the keywords"""
myLayer, _ = load_layer('test_floodimpact.tif')
myMap = Map(IFACE)
myMap.setImpactLayer(myLayer)
myTitle = myMap.getMapTitle()
myExpectedTitle = 'Penduduk yang Mungkin dievakuasi'
myMessage = 'Expected: %s\nGot:\n %s' % (myExpectedTitle, myTitle)
assert myTitle == myExpectedTitle, myMessage
示例2: test_handleMissingMapTitle
# 需要导入模块: from safe_qgis.report.map import Map [as 别名]
# 或者: from safe_qgis.report.map.Map import getMapTitle [as 别名]
def test_handleMissingMapTitle(self):
"""Missing map title from the keywords fails gracefully"""
# TODO running OSM Buildngs with Pendudk Jakarta
# wasthrowing an error when requesting map title
# that this test wasnt replicating well
myLayer, _ = load_layer('population_padang_1.asc')
myMap = Map(IFACE)
myMap.setImpactLayer(myLayer)
myTitle = myMap.getMapTitle()
myExpectedTitle = None
myMessage = 'Expected: %s\nGot:\n %s' % (myExpectedTitle, myTitle)
assert myTitle == myExpectedTitle, myMessage