Skip to content
Snippets Groups Projects
Commit 402082e4 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fitbounds change also center

parent 9820f362
No related branches found
No related tags found
1 merge request!99Resolve "Link from literature file to the related reaction in the map does not work"
...@@ -80,6 +80,9 @@ var google = { ...@@ -80,6 +80,9 @@ var google = {
getNorthEast : function() { getNorthEast : function() {
return data.ne; 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() { isEmpty : function() {
return data.ne === data.sw || (data.ne.lat() === data.sw.lat() && data.ne.lng() === data.sw.lng()); return data.ne === data.sw || (data.ne.lat() === data.sw.lat() && data.ne.lng() === data.sw.lng());
}, },
...@@ -206,6 +209,7 @@ var google = { ...@@ -206,6 +209,7 @@ var google = {
}, },
fitBounds : function(bounds) { fitBounds : function(bounds) {
this.setBounds(bounds); this.setBounds(bounds);
this.setCenter(bounds.getCenter());
}, },
}; };
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment