From 3ccc6c95acfe71fee5884ccb32c685adc53127cf Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 26 Sep 2017 19:34:17 +0200 Subject: Refactor zooming logic out to action This also enables a more straight-forward implementation of the functionality that the zoom buttons offer. --- src/components/app/map/controls/ZoomControlComponent.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/components/app/map/controls') diff --git a/src/components/app/map/controls/ZoomControlComponent.js b/src/components/app/map/controls/ZoomControlComponent.js index c5628d16..8406e8c1 100644 --- a/src/components/app/map/controls/ZoomControlComponent.js +++ b/src/components/app/map/controls/ZoomControlComponent.js @@ -1,26 +1,19 @@ import React from "react"; -import {MAP_MAX_SCALE, MAP_MIN_SCALE, MAP_SCALE_PER_EVENT} from "../MapConstants"; - -const ZoomControlComponent = ({mapScale, setMapScale}) => { - const zoom = (out) => { - const newScale = out ? mapScale / MAP_SCALE_PER_EVENT : mapScale * MAP_SCALE_PER_EVENT; - const boundedScale = Math.min(Math.max(MAP_MIN_SCALE, newScale), MAP_MAX_SCALE); - setMapScale(boundedScale); - }; +const ZoomControlComponent = ({zoomInOnCenter}) => { return ( -- cgit v1.2.3