From 4372e70c33674a6d0fb2950900118a854eadad3e Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Wed, 23 May 2018 15:51:42 +0200
Subject: [PATCH] resolution of exported image is set properly

---
 frontend-js/src/main/js/gui/AbstractGuiElement.js | 4 ++++
 frontend-js/src/main/js/gui/ContextMenu.js        | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/frontend-js/src/main/js/gui/AbstractGuiElement.js b/frontend-js/src/main/js/gui/AbstractGuiElement.js
index 5b8a2df578..59af4fa599 100644
--- a/frontend-js/src/main/js/gui/AbstractGuiElement.js
+++ b/frontend-js/src/main/js/gui/AbstractGuiElement.js
@@ -31,6 +31,10 @@ AbstractGuiElement.prototype.setMap = function (map) {
   this._map = map;
 };
 
+/**
+ *
+ * @returns {CustomMap}
+ */
 AbstractGuiElement.prototype.getMap = function () {
   return this._map;
 };
diff --git a/frontend-js/src/main/js/gui/ContextMenu.js b/frontend-js/src/main/js/gui/ContextMenu.js
index f28a44af6f..54724165bb 100644
--- a/frontend-js/src/main/js/gui/ContextMenu.js
+++ b/frontend-js/src/main/js/gui/ContextMenu.js
@@ -122,13 +122,14 @@ ContextMenu.prototype.createExportAsImageSubmenu = function () {
     converters.forEach(function (converter) {
       submenu.addOption(converter.name, function () {
         return map.getVisibleDataOverlays().then(function (visibleDataOverlays) {
+          var submapId = map.getActiveSubmapId();
 
           return ServerConnector.getImageDownloadUrl({
             polygonString: map.getSelectedPolygon(),
-            modelId: map.getActiveSubmapId(),
+            modelId: submapId,
             handlerClass: converter.handler,
             backgroundOverlayId: map.getGoogleMap().getMapTypeId(),
-            zoomLevel: map.getGoogleMap().getZoom(),
+            zoomLevel: map.getSubmapById(submapId).getGoogleMap().getZoom(),
             overlayIds: extractDataOverlayIds(visibleDataOverlays)
           });
         }).then(function (url) {
-- 
GitLab