X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fgooglemap%2F__init__.py;h=bce84f54a031fc441a3cc67fc76d077fb6105386;hb=d549b83164f10793e799da646e6704844607f190;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=ae7d0ec0f0affa0d30fcbbd0d2edd7ad81cf6c01;p=myslice.git diff --git a/plugins/googlemap/__init__.py b/plugins/googlemap/__init__.py index e69de29b..bce84f54 100644 --- a/plugins/googlemap/__init__.py +++ b/plugins/googlemap/__init__.py @@ -0,0 +1,40 @@ +from unfold.plugin import Plugin + +class GoogleMap (Plugin): + + # set checkboxes if a final column with checkboxes is desired + # pass columns as the initial set of columns + # if None then this is taken from the query's fields + # latitude,longitude, zoom : the starting point + def __init__ (self, query, query_all = None, latitude=43., longitude=7., zoom=4, **settings): + Plugin.__init__ (self, **settings) + self.query=query + self.query_all = query_all + self.query_all_uuid = query_all.query_uuid if query_all else None + self.latitude=latitude + self.longitude=longitude + self.zoom=zoom + + def template_file (self): + return "googlemap.html" + + def template_env (self, request): + env={} + return env + + def requirements (self): + reqs = { + 'js_files' : [ "https://maps.googleapis.com/maps/api/js?sensor=false", + "/js/googlemap.js", + "/js/markerclusterer.js", + "js/manifold.js", "js/manifold-query.js", + "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js", + "js/unfold-helper.js", + ], + 'css_files' : [ "css/googlemap.css", + ], + } + return reqs + + # the list of things passed to the js plugin + def json_settings_list (self): return ['plugin_uuid','query_uuid', 'query_all_uuid', 'latitude', 'longitude', 'zoom', ]