{"analyzedAt":"2022-06-26T01:01:57.017Z","collected":{"metadata":{"name":"react-leaflet-measure","scope":"unscoped","version":"2.1.1","description":"React wrapper of leaflet-measure. Coordinate, linear, and area measure control for Leaflet maps.","keywords":["react","leaflet","react-leaflet","leaflet-measure","react-leaflet-measure"],"date":"2019-02-06T17:09:36.527Z","author":{"name":"M. Hasbie"},"publisher":{"username":"m_hasbie","email":"m_hasbie@yahoo.com"},"maintainers":[{"username":"m_hasbie","email":"m_hasbie@yahoo.com"}],"repository":{"type":"git","url":"git+https://github.com/mhasbie/react-leaflet-measure.git"},"links":{"npm":"https://www.npmjs.com/package/react-leaflet-measure","homepage":"https://mhasbie.github.io/react-leaflet-measure/","repository":"https://github.com/mhasbie/react-leaflet-measure","bugs":"https://github.com/mhasbie/react-leaflet-measure/issues"},"license":"MIT","dependencies":{"leaflet-measure":"^3.1.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-eslint":"^10.0.1","babel-jest":"^23.6.0","babel-loader":"^7.1.5","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","babel-register":"^6.26.0","css-loader":"^2.0.2","enzyme":"^3.8.0","enzyme-adapter-react-16":"^1.7.1","eslint":"^5.11.0","eslint-plugin-react":"^7.11.1","jest":"^23.6.0","jest-enzyme":"^7.0.1","leaflet":"^1.4.0","prop-types":"^15.5.10","react":"^16.5.2","react-dom":"^16.5.2","react-leaflet":"^2.2.0","style-loader":"^0.23.1","webpack":"^4.28.2","webpack-cli":"^3.1.2","webpack-dev-server":"^3.1.14"},"peerDependencies":{"leaflet":"^1.4.0","react-leaflet":"^1.9.1 || ^2.2.0"},"releases":[{"from":"2022-05-27T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-03-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-12-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2020-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0}],"hasTestScript":true,"readme":"# react-leaflet-measure\r\n\r\n[![travis build](https://img.shields.io/travis/mhasbie/react-leaflet-measure.svg?style=plastic)](https://travis-ci.org/mhasbie/react-leaflet-measure)\r\n[![version](https://img.shields.io/npm/v/react-leaflet-measure.svg?style=plastic)](http://npm.im/react-leaflet-measure)\r\n[![MIT License](https://img.shields.io/npm/l/react-leaflet-measure.svg?style=plastic)](http://opensource.org/licenses/MIT)\r\n[![dependencies](https://img.shields.io/david/mhasbie/react-leaflet-measure.svg?style=plastic)](https://david-dm.org/mhasbie/react-leaflet-measure)\r\n[![peer dependencies](https://img.shields.io/david/peer/mhasbie/react-leaflet-measure.svg?style=plastic)](https://david-dm.org/mhasbie/react-leaflet-measure?type=peer)\r\n[![downloads](https://img.shields.io/npm/dt/react-leaflet-measure.svg?style=plastic)](http://npm-stat.com/charts.html?package=react-leaflet-measure&from=2018-01-01)\r\n[![issues](https://img.shields.io/github/issues/mhasbie/react-leaflet-measure.svg?style=plastic)](https://github.com/mhasbie/react-leaflet-measure/issues)\r\n\r\nReact wrapper of [leaflet-measure](https://github.com/ljagis/leaflet-measure)\r\nfor [react-leaflet](https://github.com/PaulLeCam/react-leaflet).\r\n\r\nCoordinate, linear, and area measure control for [Leaflet](http://leafletjs.com) maps. Extends [L.Control](http://leafletjs.com/reference.html#control).\r\n\r\n*Tested with Leaflet 1.3.4 and React-Leaflet 1.9.1, React-Leaflet 2.1.4*\r\n\r\n\r\n## Demos\r\n\r\n[![Demo](http://ljagis.github.io/leaflet-measure/assets/leaflet-measure.png)](http://ljagis.github.io/leaflet-measure)\r\n\r\n[`Demo Page`](https://mhasbie.github.io/react-leaflet-measure/)\r\n\r\n## Installation\r\n\r\n### Install via NPM\r\n\r\n```bash\r\nnpm install react-leaflet-measure --save\r\n```\r\n\r\n## Usage example\r\n\r\n```javascript\r\nimport { Map, TileLayer } from 'react-leaflet';\r\nimport MeasureControl from 'react-leaflet-measure';\r\n\r\nconst measureOptions = {\r\n  position: 'topright',\r\n  primaryLengthUnit: 'meters',\r\n  secondaryLengthUnit: 'kilometers',\r\n  primaryAreaUnit: 'sqmeters',\r\n  secondaryAreaUnit: 'acres',\r\n  activeColor: '#db4a29',\r\n  completedColor: '#9b2d14'\r\n};\r\n\t\t\r\n<Map center={[101.483459, 2.938926]} zoom={12}>\r\n  <TileLayer\r\n    url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\r\n    attribution='&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\r\n  />\r\n\r\n  <MeasureControl {...measureOptions} />\r\n</Map>\r\n```\r\n\r\n### Usage with React-Leaflet v2\r\n\r\nThis plugin is compatible with version 2 of React-Leaflet, but you have to wrap the `MeasureControl` component using the [`withLeaflet` higher-order component](https://react-leaflet.js.org/docs/en/context.html) to give it access to the new context mechanism. For example:\r\n\r\n```javascript\r\nimport { Map, withLeaflet } from 'react-leaflet';\r\n\r\n// Import to a different variable so you don't have to update the rest of your codes\r\nimport MeasureControlDefault from 'react-leaflet-measure';\r\n\r\n// Wrap our new variable and assign it to the one we used before. The rest of the codes stays the same.\r\nconst MeasureControl = withLeaflet(MeasureControlDefault);\r\n\t\t\r\n<Map center={[101.483459, 2.938926]} zoom={12}>\r\n  <TileLayer\r\n    url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\r\n    attribution='&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\r\n  />\r\n\r\n  <MeasureControl />\r\n</Map>\r\n```\r\n\r\n### Control options\r\n\r\nAny props passed to MeasureControl are passed down to leaflet-measure.\r\n\r\nRefer [leaflet-measure control options](https://github.com/ljagis/leaflet-measure#control-options).\r\n\r\n\r\n## Events\r\n\r\n| Event | Data | Description\r\n| --- | --- | ---\r\n| onMeasurestart | this | Fired when measurement starts.\r\n| onMeasurefinish | result | Fired when measurement finishes with results of the measurement.\r\n\r\n\r\n# Credits\r\nCredits goes to all the [contributors](https://github.com/ljagis/leaflet-measure/graphs/contributors) for the original work.\r\n\r\n\r\n# License\r\n\r\nMIT License"},"npm":{"downloads":[{"from":"2022-06-25T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-06-19T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":208},{"from":"2022-05-27T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":1175},{"from":"2022-03-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":3684},{"from":"2021-12-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":7533},{"from":"2021-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":14550}],"starsCount":0},"github":{"starsCount":16,"forksCount":10,"subscribersCount":2,"issues":{"count":6,"openCount":5,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":1,"7873200":0,"23619600":0,"70858800":3,"212576400":2},"isDisabled":false},"contributors":[{"username":"mhasbie","commitsCount":34}],"commits":[{"from":"2022-06-19T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-05-27T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-03-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-12-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0}],"statuses":[{"context":"continuous-integration/travis-ci/push","state":"success"},{"context":"github/pages","state":"success"}]},"source":{"files":{"readmeSize":3858,"testsSize":1413,"hasNpmIgnore":true,"hasChangelog":true},"badges":[{"urls":{"original":"https://img.shields.io/travis/mhasbie/react-leaflet-measure.svg?style=plastic","service":"https://api.travis-ci.org/mhasbie/react-leaflet-measure.svg","shields":"https://img.shields.io/travis/mhasbie/react-leaflet-measure.svg","content":"https://img.shields.io/travis/mhasbie/react-leaflet-measure.json"},"info":{"service":"travis","type":"build"}},{"urls":{"original":"https://img.shields.io/npm/v/react-leaflet-measure.svg?style=plastic","shields":"https://img.shields.io/npm/v/react-leaflet-measure.svg","content":"https://img.shields.io/npm/v/react-leaflet-measure.json"},"info":{"service":"npm","type":"version","modifiers":{"type":"v"}}},{"urls":{"original":"https://img.shields.io/npm/l/react-leaflet-measure.svg?style=plastic","shields":"https://img.shields.io/npm/l/react-leaflet-measure.svg","content":"https://img.shields.io/npm/l/react-leaflet-measure.json"},"info":{"service":"npm","type":"license","modifiers":{"type":"l"}}},{"urls":{"original":"https://img.shields.io/david/mhasbie/react-leaflet-measure.svg?style=plastic","service":"https://david-dm.org/mhasbie/react-leaflet-measure.svg","shields":"https://img.shields.io/david/mhasbie/react-leaflet-measure.svg","content":"https://img.shields.io/david/mhasbie/react-leaflet-measure.json"},"info":{"service":"david","type":"dependencies","modifiers":{"statusType":"normal"}}},{"urls":{"original":"https://img.shields.io/david/peer/mhasbie/react-leaflet-measure.svg?style=plastic","service":"https://david-dm.org/mhasbie/react-leaflet-measure/peer-status.svg","shields":"https://img.shields.io/david/peer/mhasbie/react-leaflet-measure.svg","content":"https://img.shields.io/david/peer/mhasbie/react-leaflet-measure.json"},"info":{"service":"david","type":"dependencies","modifiers":{"statusType":"peer"}}},{"urls":{"original":"https://img.shields.io/npm/dt/react-leaflet-measure.svg?from=2018-01-01","shields":"https://img.shields.io/npm/dt/react-leaflet-measure.svg","content":"https://img.shields.io/npm/dt/react-leaflet-measure.json"},"info":{"service":"npm","type":"downloads","modifiers":{"type":"dt"}}}],"linters":["eslint"]}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0.85,"health":1,"branding":1},"popularity":{"communityInterest":29,"downloadsCount":1228,"downloadsAcceleration":0.32265981735159954,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6705036320768256,"detail":{"quality":0.9805191034015018,"popularity":0.07539888334626017,"maintenance":0.9998808339576686}}}