From 402082e4356f794b41d0be30c8d25b89af0c8210 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Mon, 31 Jul 2017 18:22:57 +0200 Subject: [PATCH] fitbounds change also center --- frontend-js/src/test/js/google-map-mock.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend-js/src/test/js/google-map-mock.js b/frontend-js/src/test/js/google-map-mock.js index 952df9cbc6..9db90a0a3a 100644 --- a/frontend-js/src/test/js/google-map-mock.js +++ b/frontend-js/src/test/js/google-map-mock.js @@ -80,6 +80,9 @@ var google = { getNorthEast : function() { return data.ne; }, + getCenter : function() { + return new google.maps.LatLng((data.ne.lat() + data.sw.lat()) / 2, (data.ne.lng() + data.sw.lng()) / 2); + }, isEmpty : function() { return data.ne === data.sw || (data.ne.lat() === data.sw.lat() && data.ne.lng() === data.sw.lng()); }, @@ -206,6 +209,7 @@ var google = { }, fitBounds : function(bounds) { this.setBounds(bounds); + this.setCenter(bounds.getCenter()); }, }; }, -- GitLab