本文整理汇总了Python中pykml.factory.KML_ElementMaker.outline方法的典型用法代码示例。如果您正苦于以下问题:Python KML_ElementMaker.outline方法的具体用法?Python KML_ElementMaker.outline怎么用?Python KML_ElementMaker.outline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykml.factory.KML_ElementMaker
的用法示例。
在下文中一共展示了KML_ElementMaker.outline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _makeStyle
# 需要导入模块: from pykml.factory import KML_ElementMaker [as 别名]
# 或者: from pykml.factory.KML_ElementMaker import outline [as 别名]
def _makeStyle(name, color):
"""
Build swath pairs and map...
"""
# style for the normal state of a swath
stylen = KML.Style(
KML.IconStyle(
KML.scale('0.4'),
KML.Icon(
KML.href('http://maps.google.com/mapfiles/kml/shapes/star.png')
)
),
KML.LineStyle(
KML.color('ff{}'.format(color)),
KML.width(2.0)
),
KML.LabelStyle(
KML.color('990000ff'),
KML.width('2')
),
KML.PolyStyle(
KML.color('00{}'.format(color)),
KML.fill('1'),
KML.outline('1')
),
id='{}n'.format(name)
)
# style for the 'mouse-over' state of a swath
styleh = KML.Style(
KML.IconStyle(
KML.scale('0.8'),
KML.Icon(
KML.href('http://maps.google.com/mapfiles/kml/shapes/star.png')
)
),
KML.LineStyle(
KML.color('ffff4158'),
KML.width(1.5)
),
KML.LabelStyle(
KML.color('990000ff'),
KML.width('2')
),
KML.PolyStyle(
KML.color('fff7fff'),
KML.fill('1'),
KML.outline('1')
),
id='{}h'.format(name)
)
# mapping of above styles
stylem = KML.StyleMap(
KML.Pair(
KML.key('normal'),
KML.styleUrl('#{}n'.format(name))
),
KML.Pair(
KML.key('highlight'),
KML.styleUrl('#{}h'.format(name))
),
id='{}stylemap'.format(name)
)
# Expand to make the style simpler...
# kurl = 'http://maps.google.com/mapfiles/kml/shapes/star.png'
# style1 = KML.Style(
# KML.IconStyle(
# KML.scale('0.4'),
# KML.Icon(
# KML.href(kurl)
# )
# ),
# KML.LabelStyle(
# KML.color('990000ff'),
# KML.width('2')
# ),
# KML.LineStyle(
# KML.color('ff0000ff'),
# KML.width(2.0)
# ),
# KML.PolyStyle(
# KML.color('997f7fff'),
# KML.fill('1'),
# KML.outline('1')
# ),
# id='{}1'.format(name),
# )
return stylen, styleh, stylem