From: Jordan Augé Date: Tue, 5 Aug 2014 16:27:49 +0000 (+0200) Subject: updated maps X-Git-Tag: myslice-1.0~30 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=754158ae8e3a6b8e1d5cfeed23de32e4ad941a29 updated maps --- diff --git a/plugins/googlemap/__init__.py b/plugins/googlemap/__init__.py index 08f2a7bc..8005de29 100644 --- a/plugins/googlemap/__init__.py +++ b/plugins/googlemap/__init__.py @@ -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 diff --git a/plugins/googlemap/static/js/googlemap.js b/plugins/googlemap/static/js/googlemap.js index 3d187571..a3d9ba27 100644 --- a/plugins/googlemap/static/js/googlemap.js +++ b/plugins/googlemap/static/js/googlemap.js @@ -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); }, /************************************************************************** diff --git a/portal/sliceresourceview.py b/portal/sliceresourceview.py index 2d603b43..e887ff7a 100644 --- a/portal/sliceresourceview.py +++ b/portal/sliceresourceview.py @@ -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, ) # --------------------------------------------------------------------------