From e11bc587eaa871df3f93e97d141353ecd30ffa08 Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Wed, 18 May 2022 10:51:27 +0200 Subject: [PATCH] fix: fix check in ZoomButton --- src/Button/ZoomButton/ZoomButton.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Button/ZoomButton/ZoomButton.tsx b/src/Button/ZoomButton/ZoomButton.tsx index 58f806a899..d57ea7da15 100644 --- a/src/Button/ZoomButton/ZoomButton.tsx +++ b/src/Button/ZoomButton/ZoomButton.tsx @@ -6,6 +6,7 @@ import { easeOut } from 'ol/easing'; import SimpleButton, { SimpleButtonProps } from '../SimpleButton/SimpleButton'; import { CSS_PREFIX } from '../../constants'; import { AnimationOptions as OlViewAnimationOptions } from 'ol/View'; +import _isNumber from 'lodash/isNumber'; interface OwnProps { /** @@ -82,7 +83,7 @@ class ZoomButton extends React.Component { view.cancelAnimations(); } const currentZoom = view.getZoom(); - if (!currentZoom) { + if (!_isNumber(currentZoom)) { return; } const zoom = currentZoom + delta;