Пример #1
0
 def map_configuration(self):
     map_layers = getrec('geolocation.map_layers') or []
     config = {
         "fullscreencontrol":
         getrec('geolocation.fullscreen_control'),
         "locatecontrol":
         getrec('geolocation.locate_control'),
         "zoomcontrol":
         getrec('geolocation.zoom_control'),
         "minimap":
         getrec('geolocation.show_minimap'),
         "addmarker":
         getrec('geolocation.show_add_marker'),
         "geosearch":
         getrec('geolocation.show_geosearch'),
         "geosearch_provider":
         getrec('geolocation.geosearch_provider'),
         "default_map_layer":
         getrec('geolocation.default_map_layer'),
         "map_layers": [{
             "title": translate(_(l), context=self.request),
             "id": l
         } for l in map_layers],
     }
     if self.mode == 'input':
         # geosearch for input is always active
         config['geosearch'] = True
         # zoomcontrol for input is always active
         config['zoomcontrol'] = True
     return json.dumps(config)
Пример #2
0
 def map_configuration(self):
     map_layers = getrec("geolocation.map_layers") or []
     config = {
         "fullscreencontrol":
         getrec("geolocation.fullscreen_control"),
         "locatecontrol":
         getrec("geolocation.locate_control"),
         "zoomcontrol":
         getrec("geolocation.zoom_control"),
         "minimap":
         getrec("geolocation.show_minimap"),
         "addmarker":
         getrec("geolocation.show_add_marker"),
         "geosearch":
         getrec("geolocation.show_geosearch"),
         "geosearch_provider":
         getrec("geolocation.geosearch_provider"),
         "default_map_layer":
         getrec("geolocation.default_map_layer"),
         "map_layers": [{
             "title": translate(_(layer), context=self.request),
             "id": layer
         } for layer in map_layers],
         "latitude":
         getrec("geolocation.default_latitude") or None,
         "longitude":
         getrec("geolocation.default_longitude") or None,
     }
     if self.mode == "input":
         # geosearch for input is always active
         config["geosearch"] = True
         # zoomcontrol for input is always active
         config["zoomcontrol"] = True
     return json.dumps(config)
Пример #3
0
 def map_configuration(self):
     config = {
         "fullscreencontrol":
         getrec('geolocation.fullscreen_control'),
         "locatecontrol":
         getrec('geolocation.locate_control'),
         "zoomcontrol":
         getrec('geolocation.zoom_control'),
         "minimap":
         getrec('geolocation.show_minimap'),
         "default_map_layer":
         self.settings.default_map_layer,
         "map_layers": [{
             "title": translate(_(it), context=self.request),
             "id": it
         } for it in self.settings.map_layers],
     }
     return json.dumps(config)
 def map_configuration(self):
     map_layers = getrec('geolocation.map_layers') or []
     config = {
         "fullscreencontrol": getrec('geolocation.fullscreen_control'),
         "locatecontrol": getrec('geolocation.locate_control'),
         "zoomcontrol": getrec('geolocation.zoom_control'),
         "minimap": getrec('geolocation.show_minimap'),
         "addmarker": getrec('geolocation.show_add_marker'),
         "geosearch": getrec('geolocation.show_geosearch'),
         "geosearch_provider": getrec('geolocation.geosearch_provider'),
         "default_map_layer": getrec('geolocation.default_map_layer'),
         "map_layers": [
             {"title": translate(_(l), context=self.request), "id": l}
             for l in map_layers],
     }
     if self.mode == 'input':
         # geosearch for input is always active
         config['geosearch'] = True
         # zoomcontrol for input is always active
         config['zoomcontrol'] = True
     return json.dumps(config)