You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-leaflet-custom-control

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-leaflet-custom-control - npm Package Compare versions

Comparing version

to
1.4.1

22

lib/Control.js

@@ -25,4 +25,9 @@ var __assign = (this && this.__assign) || function () {

var positionClass = ((props.position && POSITION_CLASSES[props.position]) || POSITION_CLASSES.topright);
var controlContainerRef = React.createRef();
var controlContainerRef = React.useRef(null);
var map = useMap();
/**
* Whenever the control container ref is created,
* Ensure the click / scroll propagation is removed
* This way click/scroll events do not bubble down to the map
*/
React.useEffect(function () {

@@ -34,2 +39,7 @@ if (controlContainerRef.current !== null) {

}, [controlContainerRef]);
/**
* Whenever the position is changed, go ahead and get the container of the map and the first
* instance of the position class in that map container
* Fixes #17
*/
React.useEffect(function () {

@@ -40,2 +50,6 @@ var mapContainer = map.getContainer();

}, [positionClass]);
/**
* Whenever the portal root is complete,
* append or prepend the control container to the portal root
*/
React.useEffect(function () {

@@ -51,3 +65,9 @@ if (portalRoot !== null) {

}, [portalRoot, props.prepend, controlContainerRef]);
/**
* Concatenate the props.container className to the class of the control div
*/
var className = (((_b = (_a = props.container) === null || _a === void 0 ? void 0 : _a.className) === null || _b === void 0 ? void 0 : _b.concat(' ')) || '') + 'leaflet-control';
/**
* Render
*/
return (React.createElement("div", __assign({}, props.container, { ref: controlContainerRef, className: className }), props.children));

@@ -54,0 +74,0 @@ };

2

package.json
{
"name": "react-leaflet-custom-control",
"version": "1.4.0",
"version": "1.4.1",
"description": "Creates a control wrapper around a React element",

@@ -5,0 +5,0 @@ "main": "lib/Control.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet