This commit is contained in:
azivner 2018-10-30 21:28:41 +01:00
parent a2434f200e
commit f33f99134b

View file

@ -121,17 +121,13 @@ function initPanZoom() {
}); });
if (mapData.transform) { if (mapData.transform) {
console.log(mapData.transform);
pz.moveTo(mapData.transform.x, mapData.transform.y);
pz.zoomTo(0, 0, mapData.transform.scale); pz.zoomTo(0, 0, mapData.transform.scale);
pz.moveTo(mapData.transform.x, mapData.transform.y);
} }
pz.on('zoom', function (e) { pz.on('zoom', function (e) {
mapData.transform = pz.getTransform(); mapData.transform = pz.getTransform();
console.log(mapData.transform);
saveData(); saveData();
}); });
@ -141,17 +137,8 @@ function initPanZoom() {
saveData(); saveData();
}, true); }, true);
$zoomInButton.click(() => { $zoomInButton.click(() => pz.zoomTo(0, 0, 1.2));
const transform = pz.getTransform(); $zoomOutButton.click(() => pz.zoomTo(0, 0, 0.8));
pz.zoomTo(0, 0, 1.2);
});
$zoomOutButton.click(() => {
const transform = pz.getTransform();
pz.zoomTo(0, 0, 0.8);
});
} }
async function initJsPlumb () { async function initJsPlumb () {