{"_id":"@depyronick/leaflet-draw","name":"@depyronick/leaflet-draw","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.4":{"name":"@depyronick/leaflet-draw","version":"1.0.4","description":"Vector drawing plugin for Leaflet","devDependencies":{"eslint":"^3.5.0 <3.6.0","eslint-config-mourner":"^2.0.3","git-rev":"^0.2.1","happen":"^0.3.2","jake":"^8.0.15","karma":"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-coverage":"~1.1.1","karma-firefox-launcher":"~1.0.0","karma-mocha":"^1.2.0","karma-phantomjs-launcher":"^1.0.2","karma-safari-launcher":"~1.0.0","leafdoc":"^1.4.0","leaflet":"^1.0.1","mocha":"^3.5.3","phantomjs-prebuilt":"^2.1.16","prosthetic-hand":"^1.3.1","source-map":"^0.5.7","uglify-js":"^2.8.29","uglifycss":"0.0.25"},"main":"dist/leaflet.draw.js","style":"dist/leaflet.draw.css","directories":{"doc":"docs/","example":"docs/example","lib":"src/"},"scripts":{"build":"jake build -f ./Jakefile.js","test":"jake test","docs":"jake docs","release":"./build/publish.sh"},"repository":{"type":"git","url":"git+https://github.com/Leaflet/Leaflet.draw.git"},"keywords":["maps","leaflet","client","vector","drawing","draw"],"contributors":[{"name":"Jon West","email":"ddproxy@gmail.com"},{"name":"Jacob Toye"}],"license":"MIT","eslintConfig":{"root":true,"globals":{"L":true},"env":{"commonjs":true,"amd":true,"node":false},"extends":"mourner","rules":{"no-mixed-spaces-and-tabs":[2,"smart-tabs"],"indent":[2,"tab",{"VariableDeclarator":0}],"curly":2,"spaced-comment":2,"strict":0,"wrap-iife":0,"key-spacing":0,"consistent-return":0}},"gitHead":"90439566d9d4ee6ef86fa87fd3e4f7728e79aa1d","bugs":{"url":"https://github.com/Leaflet/Leaflet.draw/issues"},"homepage":"https://github.com/Leaflet/Leaflet.draw#readme","_id":"@depyronick/leaflet-draw@1.0.4","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-aHxLhb09BUo/qiL7bwqAMq8SsRGy+IHq99qaVdeMyUFMQQ+q1jxckZVvhsvjCa5UaBTulryLB3kjcKxGukfYvw==","shasum":"57f912a7fd4372ad442e4466aa9e33223cbdd10d","tarball":"https://registry.npmjs.org/@depyronick/leaflet-draw/-/leaflet-draw-1.0.4.tgz","fileCount":72,"unpackedSize":2493581,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDqA0f4G0RnP7VAAtxkU3atzkLMZuw0RWbPbpYgpws8FAIhALyw8e4zem6BhqAn1Y/yfobJxQW9r5t45wTkbvFQa9dz"}]},"_npmUser":{"name":"depyronick","email":"alidemirci@gmail.com"},"maintainers":[{"name":"depyronick","email":"alidemirci@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/leaflet-draw_1.0.4_1738061824974_0.8487488401627741"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-28T10:57:04.861Z","1.0.4":"2025-01-28T10:57:05.193Z","modified":"2025-01-28T10:57:05.503Z"},"maintainers":[{"name":"depyronick","email":"alidemirci@gmail.com"}],"description":"Vector drawing plugin for Leaflet","homepage":"https://github.com/Leaflet/Leaflet.draw#readme","keywords":["maps","leaflet","client","vector","drawing","draw"],"repository":{"type":"git","url":"git+https://github.com/Leaflet/Leaflet.draw.git"},"contributors":[{"name":"Jon West","email":"ddproxy@gmail.com"},{"name":"Jacob Toye"}],"bugs":{"url":"https://github.com/Leaflet/Leaflet.draw/issues"},"license":"MIT","readme":"[![GitHub version](https://badge.fury.io/gh/Leaflet%2Fleaflet.draw.svg)](https://badge.fury.io/gh/Leaflet%2Fleaflet.draw)\n[![npm version](https://badge.fury.io/js/leaflet-draw.svg)](https://badge.fury.io/js/leaflet-draw)\n[![NPM Downloads](https://img.shields.io/npm/dt/leaflet-draw.svg)](https://www.npmjs.com/package/leaflet-draw)\n[![Bower version](https://badge.fury.io/bo/leaflet.draw.svg)](https://badge.fury.io/bo/leaflet.draw)\n[![Build Status](https://travis-ci.org/Leaflet/Leaflet.draw.svg?branch=master)](https://travis-ci.org/Leaflet/Leaflet.draw)\n[![Leaflet.draw Chat](https://badges.gitter.im/Leaflet/Leaflet.draw.svg)](https://gitter.im/Leaflet/Leaflet.draw?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![GitHub issues](https://img.shields.io/github/issues/Leaflet/Leaflet.draw.svg)](https://github.com/Leaflet/Leaflet.draw/issues)\n[![GitHub forks](https://img.shields.io/github/forks/Leaflet/Leaflet.draw.svg)](https://github.com/Leaflet/Leaflet.draw/network)\n[![GitHub stars](https://img.shields.io/github/stars/Leaflet/Leaflet.draw.svg)](https://github.com/Leaflet/Leaflet.draw/stargazers)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Leaflet/Leaflet.draw/master/MIT-LICENSE.md)\n\n# Leaflet.draw\nAdds support for drawing and editing vectors and markers on [Leaflet maps](https://github.com/Leaflet/Leaflet).\n\nSupports [Leaflet](https://github.com/Leaflet/Leaflet/releases) 0.7.x and 1.0.0+ branches.\n\nPlease check out our [Api Documentation](https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html)\n\n#### Upgrading from Leaflet.draw 0.1\n\nLeaflet.draw 0.2.0 changes a LOT of things from 0.1. Please see [BREAKING CHANGES](https://github.com/Leaflet/Leaflet.draw/blob/master/BREAKINGCHANGES.md) for how to upgrade.\n\n## In this readme\n\n- [Customizing Language](#customizing-language-and-text-in-leafletdraw)\n- [Common tasks](#common-tasks)\n- [Contributing](#contributing)\n- [Thanks](#thanks)\n\n## Customizing language and text in Leaflet.draw\n\nLeaflet.draw uses the `L.drawLocal` configuration object to set any text used in the plugin. Customizing this will allow support for changing the text or supporting another language.\n\nSee [Leaflet.draw.js](https://github.com/Leaflet/Leaflet.draw/blob/master/src/Leaflet.draw.js) for the default strings.\n\nE.g.\n\n```js\n    // Set the button title text for the polygon button\n    L.drawLocal.draw.toolbar.buttons.polygon = 'Draw a sexy polygon!';\n    \n    // Set the tooltip start text for the rectangle\n    L.drawLocal.draw.handlers.rectangle.tooltip.start = 'Not telling...';\n```\n\n## Common tasks\n\nThe following examples outline some common tasks.\n\n### Example Leaflet.draw config\n\nThe following example will show you how to:\n\n1. Change the position of the control's toolbar.\n2. Customize the styles of a vector layer.\n3. Use a custom marker.\n4. Disable the delete functionality.\n\n```js\n    var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',\n        cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18}),\n        map = new L.Map('map', {layers: [cloudmade], center: new L.LatLng(-37.7772, 175.2756), zoom: 15 });\n    \n    var editableLayers = new L.FeatureGroup();\n    map.addLayer(editableLayers);\n    \n    var MyCustomMarker = L.Icon.extend({\n        options: {\n            shadowUrl: null,\n            iconAnchor: new L.Point(12, 12),\n            iconSize: new L.Point(24, 24),\n            iconUrl: 'link/to/image.png'\n        }\n    });\n    \n    var options = {\n        position: 'topright',\n        draw: {\n            polyline: {\n                shapeOptions: {\n                    color: '#f357a1',\n                    weight: 10\n                }\n            },\n            polygon: {\n                allowIntersection: false, // Restricts shapes to simple polygons\n                drawError: {\n                    color: '#e1e100', // Color the shape will turn when intersects\n                    message: '<strong>Oh snap!<strong> you can\\'t draw that!' // Message that will show when intersect\n                },\n                shapeOptions: {\n                    color: '#bada55'\n                }\n            },\n            circle: false, // Turns off this drawing tool\n            rectangle: {\n                shapeOptions: {\n                    clickable: false\n                }\n            },\n            marker: {\n                icon: new MyCustomMarker()\n            }\n        },\n        edit: {\n            featureGroup: editableLayers, //REQUIRED!!\n            remove: false\n        }\n    };\n    \n    var drawControl = new L.Control.Draw(options);\n    map.addControl(drawControl);\n    \n    map.on(L.Draw.Event.CREATED, function (e) {\n        var type = e.layerType,\n            layer = e.layer;\n    \n        if (type === 'marker') {\n            layer.bindPopup('A popup!');\n        }\n    \n        editableLayers.addLayer(layer);\n    });\n```\n\n### Changing a drawing handlers options\n\nYou can change a draw handlers options after initialisation by using the `setDrawingOptions` method on the Leaflet.draw control.\n\nE.g. to change the colour of the rectangle:\n\n```js\ndrawControl.setDrawingOptions({\n    rectangle: {\n    \tshapeOptions: {\n        \tcolor: '#0000FF'\n        }\n    }\n});\n```\n\n# Contributing\n \n## Testing\n\nTo test you can install the npm dependencies:\n\n    npm install\n\nand then use:\n\n    jake test\n\n## Documentation\n\nDocumentation is build with Leafdoc, to generate the documentation use\n\n    jake docs\n\nand the generated html documentation is saved to `./docs/leaflet-draw-latest.html`\n\n## Thanks\n\nTouch friendly version of Leaflet.draw was created by Michael Guild (https://github.com/michaelguild13).\n\nThe touch support was initiated due to a demand for it at National Geographic for their Map Maker Projected (http://mapmaker.education.nationalgeographic.com/) that was created by Michael Guild and Daniel Schep (https://github.com/dschep)\n\nThanks so much to [@brunob](https://github.com/brunob), [@tnightingale](https://github.com/tnightingale), and [@shramov](https://github.com/shramov). I got a lot of ideas from their Leaflet plugins.\n\nAll the [contributors](https://github.com/Leaflet/Leaflet.draw/graphs/contributors) and issue reporters of this plugin rock. Thanks for tidying up my mess and keeping the plugin on track.\n\nThe icons used for some of the toolbar buttons are either from http://glyphicons.com/ or inspired by them. <3 Glyphicons!\n\nFinally, [@mourner](https://github.com/mourner) is the man! Thanks for dedicating so much of your time to create the gosh darn best JavaScript mapping library around.\n","readmeFilename":"README.md"}