Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@evergis/react

Package Overview
Dependencies
Maintainers
6
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evergis/react - npm Package Compare versions

Comparing version 0.1.13 to 0.1.14

14

dist/hooks/useMaxMinScale.js

@@ -6,3 +6,3 @@ "use strict";

const byScale = (scale) => ({ zIndex }) => zIndex === scale;
exports.useMaxMinScale = (minScale, maxScale) => {
exports.useMaxMinScale = (minScale, maxScale, currentPosition, currentResolution) => {
const { map } = MapContext_1.useMapContext();

@@ -23,9 +23,13 @@ react_1.useEffect(() => {

}
exports.updateMapResolution(map);
if (minScale !== undefined || maxScale !== undefined) {
exports.updateMapResolution(map, currentPosition, currentResolution);
}
}, [map, minScale, maxScale]);
};
exports.updateMapResolution = (map) => {
const newResolution = Math.min(Math.max(map.resolution, map.minResolution || 0), map.maxResolution || Number.MAX_VALUE);
map.animateTo(map.position, newResolution);
exports.updateMapResolution = (map, currentPosition, currentResolution) => {
if (currentPosition && currentResolution) {
const newResolution = Math.min(Math.max(currentResolution, map.minResolution || 0), map.maxResolution || Number.MAX_VALUE);
map.animateTo(currentPosition, newResolution);
}
};
//# sourceMappingURL=useMaxMinScale.js.map

@@ -20,3 +20,3 @@ "use strict";

useUpdateMapView_1.useUpdateMapView({ position, resolution });
useMaxMinScale_1.useMaxMinScale(minScale, maxScale);
useMaxMinScale_1.useMaxMinScale(minScale, maxScale, position, resolution);
useMapBboxChange_1.useMapBboxChange(handleBboxChange);

@@ -23,0 +23,0 @@ return (React.createElement("div", { className: className, ref: wrapperRef }, children));

import { Map } from '@evergis/sgis/es/Map';
export declare const useMaxMinScale: (minScale?: number | undefined, maxScale?: number | undefined) => void;
export declare const updateMapResolution: (map: Map) => void;
export declare const useMaxMinScale: (minScale?: number | undefined, maxScale?: number | undefined, currentPosition?: [number, number] | undefined, currentResolution?: number | undefined) => void;
export declare const updateMapResolution: (map: Map, currentPosition?: [number, number] | undefined, currentResolution?: number | undefined) => void;
import { useEffect } from 'react';
import { useMapContext } from '../MapContext';
const byScale = (scale) => ({ zIndex }) => zIndex === scale;
export const useMaxMinScale = (minScale, maxScale) => {
export const useMaxMinScale = (minScale, maxScale, currentPosition, currentResolution) => {
const { map } = useMapContext();

@@ -20,9 +20,13 @@ useEffect(() => {

}
updateMapResolution(map);
if (minScale !== undefined || maxScale !== undefined) {
updateMapResolution(map, currentPosition, currentResolution);
}
}, [map, minScale, maxScale]);
};
export const updateMapResolution = (map) => {
const newResolution = Math.min(Math.max(map.resolution, map.minResolution || 0), map.maxResolution || Number.MAX_VALUE);
map.animateTo(map.position, newResolution);
export const updateMapResolution = (map, currentPosition, currentResolution) => {
if (currentPosition && currentResolution) {
const newResolution = Math.min(Math.max(currentResolution, map.minResolution || 0), map.maxResolution || Number.MAX_VALUE);
map.animateTo(currentPosition, newResolution);
}
};
//# sourceMappingURL=useMaxMinScale.js.map

@@ -17,3 +17,3 @@ import * as React from 'react';

useUpdateMapView({ position, resolution });
useMaxMinScale(minScale, maxScale);
useMaxMinScale(minScale, maxScale, position, resolution);
useMapBboxChange(handleBboxChange);

@@ -20,0 +20,0 @@ return (React.createElement("div", { className: className, ref: wrapperRef }, children));

{
"name": "@evergis/react",
"version": "0.1.13",
"version": "0.1.14",
"description": "React components for creating GIS apps with evergis server",

@@ -5,0 +5,0 @@ "author": "everpoint",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc