updated maps
authorJordan Augé <jordan.auge@lip6.fr>
Tue, 5 Aug 2014 16:27:49 +0000 (18:27 +0200)
committerJordan Augé <jordan.auge@lip6.fr>
Tue, 5 Aug 2014 16:27:49 +0000 (18:27 +0200)
plugins/googlemap/__init__.py
plugins/googlemap/static/js/googlemap.js
portal/sliceresourceview.py

index 08f2a7b..8005de2 100644 (file)
@@ -8,7 +8,7 @@ class GoogleMap (Plugin):
     # googlemap_key :   mandatory googlemap API v3 key
     # latitude,longitude, zoom : the starting point
     # apparently at some point there has been support for a boolean 'checkboxes' input arg but seems dropped
-    def __init__ (self, query, googlemap_api_key=None, latitude=43., longitude=7., zoom=4, **settings):
+    def __init__ (self, query, googlemap_api_key=None, latitude=50., longitude=50, zoom=3, **settings):
         Plugin.__init__ (self, **settings)
         self.query=query
         self.googlemap_api_key=googlemap_api_key
index 3d18757..a3d9ba2 100644 (file)
@@ -83,8 +83,11 @@ GOOGLEMAP_BGCOLOR_REMOVED = 2;
 
         on_show: function(e) {
                if (debug) messages.debug("googlemap.on_show");
-            var googlemap = e.data;
-            google.maps.event.trigger(googlemap.map, 'resize');
+            var self = e.data;
+            var center = new google.maps.LatLng(self.options.latitude, self.options.longitude);
+
+            google.maps.event.trigger(self.map, 'resize');
+            self.map.setCenter(center);
         }, 
 
         /**************************************************************************
index 2d603b4..e887ff7 100644 (file)
@@ -164,10 +164,11 @@ class SliceResourceView (LoginRequiredView, ThemeView):
             # the key to use at init-time
             init_key   = main_query_init_key,
             checkboxes = True,
-            # center on Paris
-            latitude   = 49.,
-            longitude  = 9,
-            zoom       = 8,
+            
+            # To center around Europe : 53,9 / 3
+            latitude   = 53.,
+            longitude  = 9.,
+            zoom       = 3,
         )
 
         # --------------------------------------------------------------------------