{"analyzedAt":"2022-08-05T12:58:17.314Z","collected":{"metadata":{"name":"leaflet-measure-ext","scope":"unscoped","version":"3.2.1","description":"Coordinate, linear, and area measure tool for Leaflet maps","keywords":["leaflet","measure","measurement","control","coordinate","line","length","area","polygon","path","ex"],"date":"2022-08-05T12:52:01.028Z","author":{"name":"LJA Engineering, Inc - GIS","email":"gisdev@ljaengineering.com"},"publisher":{"username":"kstopa","email":"k.stopa86@gmail.com"},"maintainers":[{"username":"kstopa","email":"k.stopa86@gmail.com"}],"repository":{"type":"git","url":"git://github.com/kstopa/leaflet-measure-ext.git"},"links":{"npm":"https://www.npmjs.com/package/leaflet-measure-ext","homepage":"https://github.com/kstopa/leaflet-measure-ext#readme","repository":"https://github.com/kstopa/leaflet-measure-ext","bugs":"https://github.com/kstopa/leaflet-measure-ext/issues"},"license":"MIT","dependencies":{"@turf/area":"^5.1.5","@turf/length":"^5.1.5","lodash":"^4.17.21"},"devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.1","babel-runtime":"^6.26.0","copy-webpack-plugin":"^4.4.1","css-loader":"^0.28.9","eslint":"^4.17.0","eslint-plugin-import":"^2.8.0","extract-text-webpack-plugin":"^3.0.2","gh-pages":"^1.1.0","glob":"^7.1.2","html-loader":"^0.5.5","husky":"^0.14.3","i18n-webpack-plugin":"^1.0.0","lint-staged":"^6.1.0","node-sass":"^4.13.1","prettier":"^1.10.2","sass-loader":"^6.0.7","style-loader":"^0.20.1","webpack":"^3.12.0","webpack-dev-server":"^2.11.1"},"peerDependencies":{"leaflet":"^1.8.0"},"releases":[{"from":"2022-07-06T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":0},{"from":"2022-05-07T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":0},{"from":"2022-02-06T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":0},{"from":"2021-08-05T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":0},{"from":"2020-08-05T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":2}],"readme":"# leaflet-measure (Extended edition)\n\nCoordinate, linear, and area measure control for [Leaflet](http://leafletjs.com) maps. Extends [L.Control](http://leafletjs.com/reference.html#control).\n\n<hr>\n\n## Installation\n\nYou can download and build the repository (see bellow) or install it from `npm` by typing:\n\n    npm install leaflet-measure-ext\n\n## Demo\n\nTo see how it looks please check the official [Demo](http://ljagis.github.io/leaflet-measure).\n\n![](http://ljagis.github.io/leaflet-measure/assets/leaflet-measure.png)\n\n<hr>\n\n## Add control to a Leaflet map\n\n`leaflet-measure` adds `L.Control.Measure`. This control may be used with the\nstandard Leaflet control work flows [described in the Leaflet docs](http://leafletjs.com/reference.html#control).\n\nThe measure control can be instantiated directly and added to a map:\n```javascript\nvar myMap = L.map('mapElementId', options);\nvar measureControl = new L.Control.Measure(options);\nmeasureControl.addTo(myMap);\n```\n\nor instantiated via the factory:\n```javascript\nvar myMap = L.map('mapElementId', options);\nvar measureControl = L.control.measure(options);\nmeasureControl.addTo(myMap);\n```\n\nor added to a map using map options:\n```javascript\nvar myMap = L.map('mapElementId', {\n  measureControl: true\n});\n```\n\n<hr>\n\n\n## Control options\n\n### position\n\n`{ position: 'topright' }`\n\nStandard Leaflet control [position options](http://leafletjs.com/reference.html#control-positions)\n\n### primaryLengthUnit | secondaryLengthUnit\n\n`{ primaryLengthUnit: 'feet', secondaryLengthUnit: 'miles' }`\n\nUnits used to display length results. `secondaryLengthUnit` is optional.\n\nValid values are `feet`, `meters`, `miles`, and `kilometers`\n\n### primaryAreaUnit | secondaryAreaUnit\n\n`{ primaryAreaUnit: 'acres', secondaryAreaUnit: undefined }`\n\nUnits used to display area results. `secondaryAreaUnit` is optional.\n\nValid values are `acres`, `hectares`, `sqfeet`, `sqmeters`, and `sqmiles`\n\n### activeColor\n\n`{ activeColor: '#ABE67E' }`\n\nBase color to use for map features rendered while actively performing a measurement. Value should be a color represented as a hexadecimal string.\n\n### completedColor\n\n`{ completedColor: '#C8F2BE' }`\n\nBase color to use for features generated from a completed measurement. Value should be a color represented as a hexadecimal string.\n\n### popupOptions\n\n`popupOptions: { className: 'leaflet-measure-resultpopup', autoPanPadding: [10, 10] }`\n\nOptions applied to the popup of the resulting measure feature. Properties may be any standard Leaflet [popup options](http://leafletjs.com/reference.html#popup-options).\n\n### units\n\nCustom units to make available to the measurement calculator. Packaged units are `feet`, `meters`, `miles`, and `kilometers` for length and `acres`, `hectares`, `sqfeet`, `sqmeters`, and `sqmiles` for areas. Additional unit definitions can be added to the packaged units using this option.\n\nDefine units as\n\n```javascript\n{\n  someNewUnit: {\n    factor: 0.001, // Required. Factor to apply when converting to this unit. Length in meters or area in sq meters will be multiplied by this factor.\n    display: 'My New Unit', // Required. How to display in results, like.. \"300 Meters (0.3 My New Unit)\".\n    decimals: 2 // Number of decimals to round results when using this unit. `0` is the default value if not specified.\n  },\n  myOtherNewUnit: {\n    factor: 1234,\n    display: 'My Other Unit',\n    decimals: 0\n  }\n}\n```\n\n### captureZIndex\n\n`{ captureZIndex: 10000 }`\n\nZ-index of the marker used to capture measure clicks. Set this value higher than the z-index of all other map layers to disable click events on other layers while a measurement is active.\n\n### decPoint | thousandsSep\n\n`{ decPoint: '.', thousandsSep: ',' }`\n\nDecimal point and thousands separator used when displaying measurements. If not specified, values are defined by the localization.\n\n### labels\n\n`{ labels: { \"label\": \"Label translation\" }}`\n\nEnables to set user custom translations.\n\n\n## Events\n\nYou can subscribe to the following events on the [Map](http://leafletjs.com/reference.html#map-class) using [these methods](http://leafletjs.com/reference.html#events)\n\n### measurestart\n\nFired when measurement starts\n\n### measurefinish\n\nFired when measurement finishes with results of the measurement. Results data includes:\n\n- `area`: Area of a polygon measurement in sq meters. 0 for measurements with less than 3 points.\n\n- `areaDisplay`: Area formatted as displayed in the popup.\n\n- `lastCoord`: Last point clicked in both decimal degrees and degress/min/seconds.\n\n- `length`: Length of the measurement in meters. 0 for measurements with less than 2 points.\n\n- `lengthDisplay`: Length formatted as displayed in the popup.\n\n- `pointCount`: Number of points directly added by the user.\n\n- `points`: Array of points as [`LatLng`](http://leafletjs.com/reference.html#latlng) used to calculate the measurement. Number of items in the array may differ from `pointCoint` because an additional point is added to close polygons during polygon measurements.\n\n<hr>\n\n\n## Customizing map feature styles\n\nMap features may be styled using CSS SVG style attributes. Features generated from `leaflet-measure` measurements are given the following class names:\n\n- **layer-measurearea**: Feature displaying area of an active measurement\n\n- **layer-measureboundary**: Feature displaying the linear path of an active measurement\n\n- **layer-measurevertex**: Feature added at each vertex (measurement click) of an active measurement\n\n- **layer-measuredrag**: Symbol following cursor while moving during an active measurement\n\n- **layer-measure-resultarea**: Feature added to the map as a permanent layer resulting from an area (3+ points) measurement\n\n- **layer-measure-resultline**: Feature added to the map as a permanent layer resulting from a linear (2 point) measurement\n\n- **layer-measure-resultpoint**: Featured added to the map as a permanent layer resulting from a point (single click) measurement\n\n<hr>\n\n## Internationalization\n\n### Build-in translations\n\nTo use any of the translated versions you can load any of the available translated\nbuild at `dist/leaflet-measure.{locale}.js`. Currently there are more than 20\nbuild-in translations including en_us (default), en_gb, cz, de, fr, es, hu, pl,\npt, hu, ru, etc. (check at dist).\n\n### Using custom translations\n\nYou can use your custom translations by adding the `label` option when adding the control:\n\n```\nL.control.measure({\n  labels: {\n    measureDistancesAndAreas: 'Hello World!'\n  }\n}).addTo(map);\n```\n\nAll available labels with its default value are listed bellow:\n\n```\nlabels = {\n  \"measure\": \"Measure\",\n  \"measureDistancesAndAreas\": \"Measure distances and areas\",\n  \"createNewMeasurement\": \"Create a new measurement\",\n  \"startCreating\": \"Start creating a measurement by adding points to the map\",\n  \"finishMeasurement\": \"Finish measurement\",\n  \"lastPoint\": \"Last point\",\n  \"area\": \"Area\",\n  \"perimeter\": \"Perimeter\",\n  \"pointLocation\": \"Point location\",\n  \"areaMeasurement\": \"Area measurement\",\n  \"linearMeasurement\": \"Linear measurement\",\n  \"pathDistance\": \"Path distance\",\n  \"centerOnArea\": \"Center on this area\",\n  \"centerOnLine\": \"Center on this line\",\n  \"centerOnLocation\": \"Center on this location\",\n  \"cancel\": \"Cancel\",\n  \"delete\": \"Delete\",\n  \"acres\": \"Acres\",\n  \"feet\": \"Feet\",\n  \"kilometers\": \"Kilometers\",\n  \"hectares\": \"Hectares\",\n  \"meters\": \"Meters\",\n  \"miles\": \"Miles\",\n  \"sqfeet\": \"Sq Feet\",\n  \"sqmeters\": \"Sq Meters\",\n  \"sqmiles\": \"Sq Miles\",\n  \"decPoint\": \".\",\n  \"thousandsSep\": \",\"\n};\n```\n\n<hr>\n\n## Development\n\nThe build process uses npm (Node Package Management) which comes with Node.js. **Note that Node 15+ is not supported**.\n\nAfter you have Node.js installed you can do ```npm install``` to install dependencies and ```npm run-script start:dev``` to initialize a local server (localhost:8080) for leaflet-measure assets.\n\nIt detects modifications on source files and re-compiles to `/leaflet-measure.css` and `/leaflet-measure.js`.\n\n## Distribuition Build\n\nWith npm installed do ```npm install``` to install dependencies and ```npm run-script build``` to generate `dist/leaflet-measure.css` and `dist/leaflet-measure.js`.\n\nIt will also generate dist/leaflet-measure.{locale}.js files for each localization available."},"npm":{"downloads":[{"from":"2022-08-04T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":15},{"from":"2022-07-29T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":76},{"from":"2022-07-06T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":358},{"from":"2022-05-07T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":959},{"from":"2022-02-06T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":1968},{"from":"2021-08-05T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":3382}],"starsCount":0},"github":{"homepage":"https://github.com/kstopa/leaflet-measure-ext","forkOf":"pierotofy/leaflet-measure-ex","starsCount":1,"forksCount":1,"subscribersCount":2,"issues":{"count":1,"openCount":0,"distribution":{"3600":0,"10800":0,"32400":1,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":0},"isDisabled":true},"contributors":[{"username":"brandoncopeland","commitsCount":1},{"username":"Nyxelio","commitsCount":1},{"username":"ValMilkevich","commitsCount":2},{"username":"exequiel09","commitsCount":1},{"username":"dirceu-jr","commitsCount":2},{"username":"spatialhast","commitsCount":2},{"username":"ismyrnow","commitsCount":2},{"username":"pierotofy","commitsCount":7},{"username":"ErikNijland","commitsCount":2},{"username":"ThomasK0lasa","commitsCount":1},{"username":"haoliangyu","commitsCount":1},{"username":"nathanvda","commitsCount":1},{"username":"sandstormdrones","commitsCount":1},{"username":"simon04","commitsCount":4},{"username":"bekerov","commitsCount":2},{"username":"barbalex","commitsCount":2},{"username":"penpendede","commitsCount":4},{"username":"SatAgro","commitsCount":1},{"username":"pedroetb","commitsCount":3},{"username":"ulrikls","commitsCount":1},{"username":"schmidtpa","commitsCount":1},{"username":"Opadera","commitsCount":8},{"username":"brandonxiang","commitsCount":1},{"username":"nguyenning","commitsCount":2},{"username":"marigerr","commitsCount":1},{"username":"najafsen","commitsCount":1},{"username":"napo","commitsCount":1}],"commits":[{"from":"2022-07-29T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":2},{"from":"2022-07-06T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":2},{"from":"2022-05-07T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":2},{"from":"2022-02-06T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":2},{"from":"2021-08-05T00:00:00.000Z","to":"2022-08-05T00:00:00.000Z","count":2}]},"source":{"files":{"readmeSize":8253,"testsSize":0,"hasNpmIgnore":true,"hasChangelog":true},"linters":["eslint","prettier"],"outdatedDependencies":{"@turf/area":{"required":"^5.1.5","stable":"6.5.0","latest":"6.5.0"},"@turf/length":{"required":"^5.1.5","stable":"6.5.0","latest":"6.5.0"}}}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0,"health":0.5,"branding":0},"popularity":{"communityInterest":31,"downloadsCount":319.6666666666667,"downloadsAcceleration":1.0837899543378997,"dependentsCount":0},"maintenance":{"releasesFrequency":0.024657534246575345,"commitsFrequency":0.6180136986301369,"openIssues":0.7,"issuesDistribution":0.7}},"score":{"final":0.46025699596882874,"detail":{"quality":0.4907240221668953,"popularity":0.06423919072953344,"maintenance":0.830160207324067}}}