@evergis/react 2.0.83 → 2.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.esm.js CHANGED
@@ -374,12 +374,26 @@ function useMapViewActions() {
374
374
  const zoomAround = useCallback(event => {
375
375
  map.zoom(1, getEventPoint(event));
376
376
  }, [getEventPoint, map]);
377
+ const changeZoomLevel = useCallback(level => {
378
+ const {
379
+ tileScheme
380
+ } = map;
381
+ let tileLevel = tileScheme.levels.find((_ref2) => {
382
+ let {
383
+ zIndex
384
+ } = _ref2;
385
+ return zIndex === level;
386
+ });
387
+ const resolution = tileLevel ? tileLevel.resolution : map.resolution;
388
+ map.animateSetResolution(resolution, map.position);
389
+ }, [map]);
377
390
  return {
378
391
  zoomTo,
379
392
  zoomIn,
380
393
  zoomOut,
381
394
  zoomAround,
382
- animateTo
395
+ animateTo,
396
+ changeZoomLevel
383
397
  };
384
398
  }
385
399