From 61be4181fdb036dcbc63b9427b34222ec5a2275e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Stra=C3=9Fburger?= Date: Thu, 3 Nov 2016 05:54:38 +0100 Subject: [PATCH] :hand: implementing zoom level based map movement --- src/Termap.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Termap.coffee b/src/Termap.coffee index edce507..6a365a1 100644 --- a/src/Termap.coffee +++ b/src/Termap.coffee @@ -156,10 +156,10 @@ module.exports = class Termap when "k" then @rotation += 15 when "l" then @rotation -= 15 - when "left" then @center.lon -= 1 - when "right" then @center.lon += 1 - when "up" then @center.lat += 1 - when "down" then @center.lat -= 1 + when "left" then @center.lon -= 8/Math.pow(2, @zoom) + when "right" then @center.lon += 8/Math.pow(2, @zoom) + when "up" then @center.lat += 6/Math.pow(2, @zoom) + when "down" then @center.lat -= 6/Math.pow(2, @zoom) else null