ac2c7982880f84ab6ae7993babc2ea3194f0837b
[unfold.git] / plugins / googlemap / googlemap.py
1 from unfold.plugin import Plugin
2
3 class GoogleMap (Plugin):
4
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     def __init__ (self, query, **settings):
9         Plugin.__init__ (self, **settings)
10         self.query=query
11
12     def template_file (self):
13         return "googlemap.html"
14
15     def template_env (self, request):
16         env={}
17         return env
18
19     def requirements (self):
20         reqs = {
21             'js_files' : [ "https://maps.googleapis.com/maps/api/js?sensor=false", 
22                            "/js/googlemap.js",
23                            "/js/markerclusterer.js",
24                             "js/manifold.js", "js/manifold-query.js", 
25                             "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js", 
26                             "js/unfold-helper.js",
27                            ],
28             'css_files' : [ "css/googlemap.css",
29                             ],
30             }
31         return reqs
32
33     # the list of things passed to the js plugin
34     def json_settings_list (self): return ['plugin_uuid','query_uuid']