Ejemplo n.º 1
0
 def extend_gis_map(map_plugin, add_javascript, add_configuration):
     add_javascript("scripts/S3/s3.gis.climate.js")
     env = map_plugin.env
     SCRIPT = env.SCRIPT
     T = env.T
     import json
     application_name = env.request.application
             
     config_dict = dict(
         map_plugin.client_config,
         year_min = map_plugin.year_min,
         year_max = map_plugin.year_max,
         base_URL = "/%s/climate/" % application_name,            
         aggregation_names = [
             Aggregation.__name__ for Aggregation in aggregations
         ],
     )
     SampleTable.add_to_client_config_dict(config_dict)
     add_configuration(
         "\n".join((
             "window.climate_data_plugin = new ClimateDataMapPlugin("+
                 json.dumps(
                     config_dict,
                     indent = 4
                 )+
             ")",
             "registerPlugin(climate_data_plugin)",
         ))
     )