本文整理匯總了Python中safe_qgis.map.Map.getMapTitle方法的典型用法代碼示例。如果您正苦於以下問題:Python Map.getMapTitle方法的具體用法?Python Map.getMapTitle怎麽用?Python Map.getMapTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類safe_qgis.map.Map
的用法示例。
在下文中一共展示了Map.getMapTitle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_getMapTitle
# 需要導入模塊: from safe_qgis.map import Map [as 別名]
# 或者: from safe_qgis.map.Map import getMapTitle [as 別名]
def test_getMapTitle(self):
"""Getting the map title from the keywords"""
myLayer, _ = loadLayer('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.map import Map [as 別名]
# 或者: from safe_qgis.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, _ = loadLayer('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