1 from unfold.plugin import Plugin
3 class GoogleMap (Plugin):
5 # set checkboxes if a final column with checkboxes is desired
6 # pass columns as the initial set of columns
7 # if None then this is taken from the query's fields
8 # latitude,longitude, zoom : the starting point
9 def __init__ (self, query, query_all_uuid = None, latitude=43., longitude=7., zoom=4, **settings):
10 Plugin.__init__ (self, **settings)
12 self.query_all_uuid = query_all_uuid
13 self.latitude=latitude
14 self.longitude=longitude
17 def template_file (self):
18 return "googlemap.html"
20 def template_env (self, request):
24 def requirements (self):
26 'js_files' : [ "https://maps.googleapis.com/maps/api/js?sensor=false",
28 "/js/markerclusterer.js",
29 "js/manifold.js", "js/manifold-query.js",
30 "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js",
31 "js/unfold-helper.js",
33 'css_files' : [ "css/googlemap.css",
38 # the list of things passed to the js plugin
39 def json_settings_list (self): return ['plugin_uuid','query_uuid', 'query_all_uuid', 'latitude', 'longitude', 'zoom', ]