示例#1
0
    def KML_file_header(self, icon, tour_name):
        if tour_name == "Stadium Tour":
            icon_ok = icon[0]
        else:
            icon_ok = "../img/"+icon[0]

        kml_doc = KML.kml(
                     KML.Document(
                       KML.Style(
                         KML.IconStyle(
                           KML.scale('2.5'),
                           KML.Icon(
                             KML.href(icon_ok)
                           ),
                         ),
                         KML.LabelStyle(
                           KML.color("ff80ccff"),
                           KML.scale(2)
                         ),
                         KML.BalloonStyle(
                           KML.text("$[description]")
                         ),
                         KML.LineStyle(
                             KML.color('bf00aaff'),
                             KML.width(5)
                         ),
                         id=stylename
                       ),
                       KML.Style(
                         KML.IconStyle(
                           KML.scale('2.5'),
                           KML.Icon(
                             KML.href("../img/"+icon[1])
                           ),
                         ),
                         KML.LabelStyle(
                           KML.color("ff80ccff"),
                           KML.scale(4)
                         ),
                         KML.LineStyle(
                           KML.color('FFFF0000'),
                           GX.outerColor('FF4CBB17'),
                           GX.physicalWidth('25000'),
                           GX.outerWidth('0.40')
                        ),
                        id=stylename2
                       ),
                       GX.Tour(
                         KML.name(tour_name),
                         GX.Playlist(),
                       ),
                       KML.Folder(
                         KML.name('Features'),
                         KML.Style(
                           KML.ListStyle(
                             KML.listItemType("checkHideChildren")
                           )
                         ),
                         id='features',
                       ),
                     ),
                  )

        return kml_doc