Exemplo n.º 1
0
 def _get_widgets(self, resource, context):
     # What type of map ?
     if resource.get_property('render') == 'google':
         gps_widget_cls = GoogleGPSWidget
     else:
         gps_widget_cls = OpenStreetMapGPSWidget
     # Map configuration
     config_map = {'width': resource.get_property('width'),
                   'height': resource.get_property('height'),
                   'address': resource.get_property('address'),
                   'latitude': resource.get_property('latitude'),
                   'longitude': resource.get_property('longitude'),
                   'zoom': resource.get_property('zoom')}
     # Return widgets
     return freeze(DBResource_Edit._get_widgets(self, resource, context)
             + [display_title_widget,
                SelectWidget('render', title=MSG(u'Render map with')),
                TextWidget('width', title=MSG(u'Map width'), size=6),
                TextWidget('height', title=MSG(u'Map height'), size=6),
                gps_widget_cls('gps', title=MSG(u'GPS'), resource=resource,
                               **config_map)])
Exemplo n.º 2
0
 def _get_widgets(self, resource, context):
     return freeze(DBResource_Edit._get_widgets(self, resource, context)
         + [SelectWidget('view', title=MSG(u'View'),
                         has_empty_option=False),
            TextWidget('breadcrumb_title', title=MSG(u'Breadcrumb title'))])