can pass starting lat/lon/zoom to googlemap
[myslice.git] / plugins / googlemap / googlemap.py
index ac2c798..d6ea883 100644 (file)
@@ -5,9 +5,13 @@ 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
-    def __init__ (self, query, **settings):
+    # latitude,longitude, zoom : the starting point
+    def __init__ (self, query, latitude=43., longitude=7., zoom=4, **settings):
         Plugin.__init__ (self, **settings)
         self.query=query
+        self.latitude=latitude
+        self.longitude=longitude
+        self.zoom=zoom
 
     def template_file (self):
         return "googlemap.html"
@@ -31,4 +35,4 @@ class GoogleMap (Plugin):
         return reqs
 
     # the list of things passed to the js plugin
-    def json_settings_list (self): return ['plugin_uuid','query_uuid']
+    def json_settings_list (self): return ['plugin_uuid','query_uuid', 'latitude', 'longitude', 'zoom', ]