X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fgooglemap%2Fstatic%2Fjs%2Fgooglemap.js;h=a3d9ba2761d4eef4cd33927c89cba3ed9184ff58;hb=754158ae8e3a6b8e1d5cfeed23de32e4ad941a29;hp=c51eb4f4fa593fa8907e4ea4537b2154f3c2a65f;hpb=87d78646979a54137f613f94b080014af7ab8f66;p=unfold.git diff --git a/plugins/googlemap/static/js/googlemap.js b/plugins/googlemap/static/js/googlemap.js index c51eb4f4..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); }, /************************************************************************** @@ -173,7 +176,7 @@ GOOGLEMAP_BGCOLOR_REMOVED = 2; data = { state: STATE_SET, key : null, - op : this.checked ? STATE_SET_ADD : STATE_SET_REMOVED, + op : this.checked ? STATE_SET_ADD : STATE_SET_REMOVE, value: id } manifold.raise_event(self.options.query_uuid, FIELD_STATE_CHANGED, data);