Commit 84313101 authored by ambak's avatar ambak
Browse files

Update plugin.js, add info about zoom

parent 358e902f
Pipeline #7748 passed with stage
in 14 seconds
......@@ -3,6 +3,7 @@ minervaDefine(function () {
register: function (minervaObject) {
minervaObject.element.innerHTML = "<div>" +
"<label>Map: </label><input id='model-id'/><br/>" +
"<label>Zoom: </label><input id='zoom'/></br>" +
"<label>P1: </label><input id='left-top-corner'/><br/>" +
"<label>P2: </label2><input id='right-bottom-corner'/><br/>" +
"<label>Dialog content pos: </label><input id='dialog-left-top-corner'/><br/>" +
......@@ -14,9 +15,13 @@ minervaDefine(function () {
//listeners for bounds change
var persistBoundsData = function (modelId) {
var bounds = minervaObject.project.map.getBounds({modelId: modelId});
var zoom = minervaObject.project.map.getZoom({modelId: modelId});
$("#left-top-corner", minervaObject.element).val(Math.round(bounds.getTopLeft().x) + ";" + Math.round(bounds.getTopLeft().y));
$("#right-bottom-corner", minervaObject.element).val(Math.round(bounds.getRightBottom().x) + ";" + Math.round(bounds.getRightBottom().y));
return minervaObject.pluginData.setUserParam("bounds-" + modelId, Math.round(bounds.getTopLeft().x) + ";" + Math.round(bounds.getTopLeft().y) + " " + Math.round(bounds.getRightBottom().x) + ";" + Math.round(bounds.getRightBottom().y))
$("#zoom", minervaObject.element).val(Math.round(zoom));
return minervaObject.pluginData.setUserParam("bounds-" + modelId, Math.round(bounds.getTopLeft().x) + ";" + Math.round(bounds.getTopLeft().y) + " " + Math.round(bounds.getRightBottom().x) + ";" + Math.round(bounds.getRightBottom().y)).then(function () {
return minervaObject.pluginData.setUserParam("zoom-" + modelId, Math.round(zoom));
});
};
//listener for dialog position/size change
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment