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

fix on mock of latlng bounds.extend

parent 1669d630
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"
......@@ -81,28 +81,28 @@ var google = {
return data.ne;
},
isEmpty : function() {
return ne === sw || (data.ne.lat() === sw.lat() && data.ne.lng() === sw.lng());
return data.ne === data.sw || (data.ne.lat() === data.sw.lat() && data.ne.lng() === data.sw.lng());
},
extend : function(arg) {
if (data.sw === undefined) {
data.sw = arg;
data.sw = new google.maps.LatLng(arg.lat(), arg.lng());
} else {
if (arg.lng() < data.sw.lng()) {
data.sw.longitude = arg.lng();
}
if (arg.lat() < data.sw.lat()) {
data.sw.longitude = arg.lng();
data.sw.latitude = arg.lat();
}
}
if (data.ne === undefined) {
data.ne = arg;
data.ne = new google.maps.LatLng(arg.lat(), arg.lng());
} else {
if (arg.lng() > data.ne.lng()) {
data.ne.longitude = arg.lng();
}
if (arg.lat() > data.ne.lat()) {
data.ne.longitude = arg.lng();
data.ne.latitude = arg.lat();
}
}
},
......
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