{"id":22148951,"url":"https://github.com/tav0/mapb-gl-draw","last_synced_at":"2025-03-24T12:43:29.497Z","repository":{"id":80624139,"uuid":"126136176","full_name":"Tav0/mapb-gl-draw","owner":"Tav0","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-24T22:16:29.000Z","size":3911,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T18:08:19.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tav0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-21T06:54:45.000Z","updated_at":"2018-03-24T22:16:30.000Z","dependencies_parsed_at":"2023-10-26T21:45:35.138Z","dependency_job_id":null,"html_url":"https://github.com/Tav0/mapb-gl-draw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tav0%2Fmapb-gl-draw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tav0%2Fmapb-gl-draw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tav0%2Fmapb-gl-draw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tav0%2Fmapb-gl-draw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tav0","download_url":"https://codeload.github.com/Tav0/mapb-gl-draw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245274985,"owners_count":20588883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T23:30:05.309Z","updated_at":"2025-03-24T12:43:29.469Z","avatar_url":"https://github.com/Tav0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @mapbox/mapbox-gl-draw\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/mapbox/mapbox-gl-draw.svg)](https://greenkeeper.io/) [![Build Status](https://travis-ci.org/mapbox/mapbox-gl-draw.svg?branch=master)](https://travis-ci.org/mapbox/mapbox-gl-draw)\n\nAdds support for drawing and editing features on [mapbox-gl.js](https://www.mapbox.com/mapbox-gl-js/) maps. [See a live example here](https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/)\n\n**Requires [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js). Compatible versions are documented in the package.json**\n\n**On NPM this package has recently moved from `mapbox-gl-draw` to `@mapbox/mapbox-gl-draw`**\n\n### Installing\n\n```\nnpm install @mapbox/mapbox-gl-draw\n```\n\nDraw ships with CSS, make sure you include it in your build.  \n**When using modules**\n ```js\nrequire('@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css')\n// or\nimport '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'\n ```\n\n**When using CDN**\n```html\n\u003clink rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.4/mapbox-gl-draw.css' type='text/css' /\u003e\n```\n\n### Usage in your application\n\n**When using modules**\n\n```js\nvar mapboxgl = require('mapbox-gl');\nvar MapboxDraw = require('@mapbox/mapbox-gl-draw');\n```\n\n**When using a CDN**\n\n```html\n\u003cscript src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.4/mapbox-gl-draw.js'\u003e\u003c/script\u003e\n```\n\n**Example setup**\n\n```js\nmapboxgl.accessToken = 'YOUR_ACCESS_TOKEN';\n\nvar map = new mapboxgl.Map({\n  container: 'map',\n  style: 'mapbox://styles/mapbox/streets-v8',\n  center: [40, -74.50],\n  zoom: 9\n});\n\nvar Draw = new MapboxDraw();\n\n// Map#addControl takes an optional second argument to set the position of the control.\n// If no position is specified the control defaults to `top-right`. See the docs \n// for more details: https://www.mapbox.com/mapbox-gl-js/api/map#addcontrol\n\nmap.addControl(Draw, 'top-left');\n\nmap.on('load', function() {\n  // ALL YOUR APPLICATION CODE\n});\n```\n\nhttps://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/\n\n### See [API.md](https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/API.md) for complete reference.\n\n### Enhancements and New Interactions\n\nFor additional functionality [check out our list of custom modes](https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/MODES.md#available-custom-modes).\n\nMapbox Draw accepts functionality changes after the functionality has been proven out via a [custom mode](https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/MODES.md#creating-modes-for-mapbox-draw). This lets users experiment and validate their mode before entering a review process, hopefully promoting innovation. When you write a custom mode, please open a PR adding it to our [list of custom modes](https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/MODES.md#available-custom-modes).\n\n### Developing and testing\n\nInstall dependencies, build the source files and crank up a server via:\n\n```\ngit clone git@github.com:mapbox/mapbox-gl-draw.git\nnpm install\nnpm start \u0026 open http://localhost:9966/debug/?access_token=\u003ctoken\u003e\n```\n\n### Testing\n\n```\nnpm run test\n```\n\n### Publishing\n\nTo github and npm\n\n```\nnpm version (major|minor|patch)\ngit push --tags\ngit push\nnpm publish\n```\n\nUpdate the version number in [the GL JS example](https://github.com/mapbox/mapbox-gl-js/blob/mb-pages/docs/_posts/examples/3400-01-25-mapbox-gl-draw.html).\n\n### Naming actions\n\nWe're trying to follow standards when naming things. Here is a collection of links where we look for inspiration.\n\n- http://turfjs.org/docs.html\n- http://toblerity.org/shapely/manual.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftav0%2Fmapb-gl-draw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftav0%2Fmapb-gl-draw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftav0%2Fmapb-gl-draw/lists"}