Ignore:
Timestamp:
28/03/08 15:26:39 (11 years ago)
Author:
mkochan
Message:

Extended StationConvertor? to handle colouring of stations. Added config file for the ECN dataset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DPPP/kml/csml2kml/python/csml2kml/csml2kml/KML.py

    r3654 r3698  
    150150    to be associated with C{KMLPlacemark} objects. 
    151151    @type iconURL: C{str} 
     152    @ivar iconColor: Can contain a color to be blended with the icon image, in hexadecimal RGBA format 
     153    (for example, "00ff00ff" would mean green with 100% alpha). 
     154    @type iconColor: C{str} 
    152155    @ivar balloonTemplate: Can contain a HTML template with variables that are substituted during build 
    153156    using from C{KMLPlacemark.data} attributes; 
     
    160163    ''' 
    161164 
    162     def __init__(self, id, iconURL = None, balloonTemplate = None, listItemType = None): 
     165    def __init__(self, id, iconURL = None, iconColor = 'ffffffff', balloonTemplate = None, listItemType = None): 
    163166        self.id = id 
    164167        self.iconURL = iconURL 
     168        self.iconColor = iconColor 
    165169        self.balloonTemplate = balloonTemplate 
    166170        if listItemType: 
     
    178182        if self.iconURL: 
    179183            iconStyleElement = SubElement(styleElement, 'IconStyle') 
    180             SubElement(iconStyleElement, 'scale').text = '1.2' 
     184            SubElement(iconStyleElement, 'scale').text = '1.2'             
     185            SubElement(iconStyleElement, 'color').text = self.iconColor 
    181186            iconElement = SubElement(iconStyleElement, 'Icon') 
    182187            SubElement(iconElement, 'href').text = self.iconURL 
     
    202207    @rtype: C{KMLStyle} 
    203208    ''' 
    204     return KMLStyle(id, iconURL, balloonTemplate) 
     209    return KMLStyle(id, iconURL = iconURL, balloonTemplate = balloonTemplate) 
    205210 
    206211class KMLPlacemark(KMLElement): 
Note: See TracChangeset for help on using the changeset viewer.