当前位置: 首页>>代码示例>>Python>>正文


Python KML_ElementMaker.outline方法代码示例

本文整理汇总了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
开发者ID:johnnycakes79,项目名称:pyops,代码行数:96,代码来源:maps.py


注:本文中的pykml.factory.KML_ElementMaker.outline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。