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

when the map is wrapped bounds returns whole canvas

parent 4797561e
No related branches found
No related tags found
1 merge request!341Resolve "Export to SBML not exporting all the bioentities in the map"
Pipeline #
...@@ -190,7 +190,7 @@ AbstractCustomMap.prototype.registerMapClickEvents = function () { ...@@ -190,7 +190,7 @@ AbstractCustomMap.prototype.registerMapClickEvents = function () {
var polygon = ""; var polygon = "";
polygon += x1 + "," + y1 + ";"; polygon += x1 + "," + y1 + ";";
polygon += x2 + "," + y2 + ";"; polygon += x2 + "," + y1 + ";";
polygon += x2 + "," + y2 + ";"; polygon += x2 + "," + y2 + ";";
polygon += x1 + "," + y2 + ";"; polygon += x1 + "," + y2 + ";";
self.getTopMap().setSelectedPolygon(polygon); self.getTopMap().setSelectedPolygon(polygon);
......
...@@ -425,7 +425,14 @@ OpenLayerCanvas.prototype.getBounds = function () { ...@@ -425,7 +425,14 @@ OpenLayerCanvas.prototype.getBounds = function () {
if (p1.x > maxWidth / 2) { if (p1.x > maxWidth / 2) {
p1.x -= maxWidth; p1.x -= maxWidth;
} }
return new Bounds(p1, p2); var bounds = new Bounds(p1, p2);
//if the world is wrapped (it's a workaround and might not work for browser with huge resolution)
if (!bounds.contains(self.getCenter())) {
p1.x = -maxWidth / 2;
p2.x = maxWidth / 2;
bounds = new Bounds(p1, p2)
}
return bounds;
}; };
OpenLayerCanvas.prototype.turnOnDrawing = function () { OpenLayerCanvas.prototype.turnOnDrawing = function () {
......
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