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 = None, latitude=43., longitude=7., zoom=4, **settings):
10 Plugin.__init__ (self, **settings)
12 self.query_all = query_all
13 self.query_all_uuid = query_all.query_uuid if query_all else None
14 self.latitude=latitude
15 self.longitude=longitude
18 def template_file (self):
19 return "googlemap.html"
21 def template_env (self, request):
25 def requirements (self):
27 'js_files' : [ "https://maps.googleapis.com/maps/api/js?sensor=false",
29 "/js/markerclusterer.js",
30 "js/manifold.js", "js/manifold-query.js",
31 "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js",
32 "js/unfold-helper.js",
34 'css_files' : [ "css/googlemap.css",
39 # the list of things passed to the js plugin
40 def json_settings_list (self): return ['plugin_uuid','query_uuid', 'query_all_uuid', 'latitude', 'longitude', 'zoom', ]