Ignore:
Timestamp:
07/28/10 01:47:29 (22 months ago)
Author:
takanori
Message:

simple polyline support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/content/GPolyline.py

    r318 r332  
    3131    FloatField('opacity', 
    3232               default=1.0, 
     33               widget=StringWidget( 
     34                   label='Opacity', 
     35                   label_msgid='label_opacity', 
     36                   description_msgid='help_opacity', 
     37                   i18n_domain='googlemaps', 
     38                   size=8, 
     39                   ) 
    3340               ), 
    3441    IntegerField('weight', 
    35                  default=2, 
     42                 default=5, 
     43                 widget=StringWidget( 
     44                     label='Weight', 
     45                     label_msgid='label_weight', 
     46                     description_msgid='help_weight', 
     47                     i18n_domain='googlemaps', 
     48                     size=8, 
     49                     ) 
    3650                 ), 
     51    LinesField('coordinates', 
     52               widget=LinesWidget( 
     53                   label='Coordinates', 
     54                   label_msgid='label_path', 
     55                   description_msgid='help_path', 
     56                   i18n_domain='googlemaps', 
     57                   ) 
     58               ), 
    3759    ),) 
    3860gpolyline_schema = getattr(ATCTContent, 'schema', Schema(())).copy() + schema.copy() 
     
    5981        return latlng 
    6082 
     83    # return coordinates array string 
     84    def getCoordinatesArray(self): 
     85        coordinates_array = "[" 
     86        for coordinate in self.coordinates: 
     87             coordinates_array += "[%s]," % coordinate 
     88        coordinates_array = coordinates_array[:-1] + "]" 
     89        return coordinates_array 
     90 
    6191registerType(GPolyline, PROJECTNAME) 
Note: See TracChangeset for help on using the changeset viewer.