react-leaflet-cluster
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -63,6 +63,6 @@ "use strict"; | ||
var clusterGroup = new leaflet_1.default.MarkerClusterGroup(clusterProps); | ||
react_1.useEffect(function () { | ||
(0, react_1.useEffect)(function () { | ||
Object.entries(clusterEvents).forEach(function (_a) { | ||
var eventAsProp = _a[0], callback = _a[1]; | ||
var clusterEvent = "cluster" + eventAsProp.substring(2).toLowerCase(); | ||
var clusterEvent = "cluster".concat(eventAsProp.substring(2).toLowerCase()); | ||
clusterGroup.on(clusterEvent, callback); | ||
@@ -73,3 +73,3 @@ }); | ||
var eventAsProp = _a[0]; | ||
var clusterEvent = "cluster" + eventAsProp.substring(2).toLowerCase(); | ||
var clusterEvent = "cluster".concat(eventAsProp.substring(2).toLowerCase()); | ||
clusterGroup.removeEventListener(clusterEvent); | ||
@@ -89,3 +89,3 @@ }); | ||
}; | ||
var MarkerClusterGroup = core_1.createPathComponent(createMarkerCluster, updateMarkerCluster); | ||
var MarkerClusterGroup = (0, core_1.createPathComponent)(createMarkerCluster, updateMarkerCluster); | ||
exports.default = MarkerClusterGroup; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e}).apply(this,arguments)},__rest=this&&this.__rest||function(e,r){var t={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var core_1=require("@react-leaflet/core"),leaflet_1=__importDefault(require("leaflet"));require("leaflet.markercluster"),require("leaflet.markercluster/dist/MarkerCluster.css"),require("leaflet.markercluster/dist/MarkerCluster.Default.css");var react_1=require("react");function getPropsAndEvents(e){var a={},n={},e=(e.children,__rest(e,["children"]));return Object.entries(e).forEach(function(e){var r,t=e[0],e=e[1];t.startsWith("on")?n=__assign(__assign({},n),((r={})[t]=e,r)):a=__assign(__assign({},a),((r={})[t]=e,r))}),[a,n]}function createMarkerCluster(e,r){var t=getPropsAndEvents(e),e=t[0],a=t[1],n=new leaflet_1.default.MarkerClusterGroup(e);return react_1.useEffect(function(){return Object.entries(a).forEach(function(e){var r=e[0],e=e[1],r="cluster"+r.substring(2).toLowerCase();n.on(r,e)}),function(){Object.entries(a).forEach(function(e){e="cluster"+e[0].substring(2).toLowerCase();n.removeEventListener(e)})}},[a,n]),{instance:n,context:__assign(__assign({},r),{layerContainer:n})}}delete leaflet_1.default.Icon.Default.prototype._getIconUrl,leaflet_1.default.Icon.Default.mergeOptions({iconRetinaUrl:require("leaflet/dist/images/marker-icon-2x.png").default,iconUrl:require("leaflet/dist/images/marker-icon.png").default,shadowUrl:require("leaflet/dist/images/marker-shadow.png").default});var updateMarkerCluster=function(e,r,t){r.showCoverageOnHover,t.showCoverageOnHover},MarkerClusterGroup=core_1.createPathComponent(createMarkerCluster,updateMarkerCluster);exports.default=MarkerClusterGroup; | ||
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e}).apply(this,arguments)},__rest=this&&this.__rest||function(e,r){var t={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},core_1=(Object.defineProperty(exports,"__esModule",{value:!0}),require("@react-leaflet/core")),leaflet_1=__importDefault(require("leaflet")),react_1=(require("leaflet.markercluster"),require("leaflet.markercluster/dist/MarkerCluster.css"),require("leaflet.markercluster/dist/MarkerCluster.Default.css"),require("react"));function getPropsAndEvents(e){var a={},n={},e=(e.children,__rest(e,["children"]));return Object.entries(e).forEach(function(e){var r,t=e[0],e=e[1];t.startsWith("on")?n=__assign(__assign({},n),((r={})[t]=e,r)):a=__assign(__assign({},a),((r={})[t]=e,r))}),[a,n]}function createMarkerCluster(e,r){var e=getPropsAndEvents(e),t=e[0],a=e[1],n=new leaflet_1.default.MarkerClusterGroup(t);return(0,react_1.useEffect)(function(){return Object.entries(a).forEach(function(e){var r=e[0],e=e[1],r="cluster".concat(r.substring(2).toLowerCase());n.on(r,e)}),function(){Object.entries(a).forEach(function(e){e=e[0],e="cluster".concat(e.substring(2).toLowerCase());n.removeEventListener(e)})}},[a,n]),{instance:n,context:__assign(__assign({},r),{layerContainer:n})}}delete leaflet_1.default.Icon.Default.prototype._getIconUrl,leaflet_1.default.Icon.Default.mergeOptions({iconRetinaUrl:require("leaflet/dist/images/marker-icon-2x.png").default,iconUrl:require("leaflet/dist/images/marker-icon.png").default,shadowUrl:require("leaflet/dist/images/marker-shadow.png").default});var updateMarkerCluster=function(e,r,t){r.showCoverageOnHover,t.showCoverageOnHover},MarkerClusterGroup=(0,core_1.createPathComponent)(createMarkerCluster,updateMarkerCluster);exports.default=MarkerClusterGroup; |
{ | ||
"name": "react-leaflet-cluster", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "React-leaflet-cluster is a plugin for react-leaflet. A wrapper component of Leaflet.markercluster.", | ||
@@ -16,3 +16,3 @@ "main": "lib/index.js", | ||
"minify": "uglifyjs --compress --mangle --output lib/index.min.js -- lib/index.js", | ||
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"format": "prettier --write \"src/**/*.tsx\"", | ||
"lint": "tslint -p tsconfig.json", | ||
@@ -25,37 +25,37 @@ "prepublishOnly": "npm test && npm run lint", | ||
"dependencies": { | ||
"leaflet.markercluster": "^1.4.1" | ||
"leaflet.markercluster": "^1.5.3" | ||
}, | ||
"peerDependencies": { | ||
"leaflet": "^1.7.1", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"react-leaflet": "^3.0.2" | ||
"leaflet": "^1.8.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-leaflet": "^3.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/leaflet": "^1.5.21", | ||
"@types/leaflet.markercluster": "^1.4.3", | ||
"@types/node": "^14.14.31", | ||
"@types/react": "^17.0.0", | ||
"@types/react-dom": "^17.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.13.0", | ||
"@typescript-eslint/parser": "^4.13.0", | ||
"eslint": "^7.18.0", | ||
"@types/leaflet": "^1.7.11", | ||
"@types/leaflet.markercluster": "^1.5.0", | ||
"@types/node": "^14.18.21", | ||
"@types/react": "^17.0.45", | ||
"@types/react-dom": "^17.0.17", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"eslint": "^7.32.0", | ||
"eslint-loader": "^4.0.2", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"eslint-plugin-react": "^7.22.0", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"leaflet": "^1.7.1", | ||
"prettier": "^2.2.1", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"react-leaflet": "^3.0.2", | ||
"ts-loader": "^8.0.14", | ||
"eslint-plugin-prettier": "^3.4.1", | ||
"eslint-plugin-react": "^7.30.0", | ||
"eslint-plugin-react-hooks": "^4.5.0", | ||
"leaflet": "^1.8.0", | ||
"prettier": "^2.6.2", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-leaflet": "^3.2.5", | ||
"ts-loader": "^8.4.0", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^4.1.3", | ||
"uglify-js": "^3.5.15" | ||
"typescript": "^4.7.3", | ||
"uglify-js": "^3.16.0" | ||
}, | ||
"author": "akursat", | ||
"homepage": "https://akursat.gitbook.io/marker-cluster/", | ||
"license": "MIT", | ||
"license": "SEE LICENSE IN <LICENSE>", | ||
"repository": "https://github.com/akursat/react-leaflet-cluster", | ||
@@ -67,4 +67,5 @@ "keywords": [ | ||
"cluster", | ||
"map" | ||
"map", | ||
"react-leaflet-v3" | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
# react-leaflet-cluster | ||
# react-leaflet-cluster [![npm version](https://img.shields.io/npm/v/react-leaflet-cluster.svg)](https://www.npmjs.com/package/react-leaflet-cluster) | ||
@@ -3,0 +3,0 @@ - [x] React-leaflet v3 support |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11738
1
Updatedleaflet.markercluster@^1.5.3