Gathering detailed insights and metrics for @mapbox/mapbox-gl-draw
Gathering detailed insights and metrics for @mapbox/mapbox-gl-draw
Gathering detailed insights and metrics for @mapbox/mapbox-gl-draw
Gathering detailed insights and metrics for @mapbox/mapbox-gl-draw
npm install @mapbox/mapbox-gl-draw
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
958 Stars
1,448 Commits
592 Forks
133 Watching
16 Branches
631 Contributors
Updated on 26 Nov 2024
JavaScript (98.65%)
HTML (1.35%)
Cumulative downloads
Total Downloads
Last day
-17.4%
39,921
Compared to previous day
Last week
-0.1%
222,271
Compared to previous week
Last month
7.5%
929,142
Compared to previous month
Last year
13.6%
10,751,957
Compared to previous year
7
27
Adds support for drawing and editing features on mapbox-gl.js maps. See a live example here
Requires mapbox-gl-js.
If you are developing with mapbox-gl-draw
, see API.md for documentation.
npm install @mapbox/mapbox-gl-draw
Draw ships with CSS, make sure you include it in your build.
When using modules
1import mapboxgl from 'mapbox-gl'; 2import MapboxDraw from "@mapbox/mapbox-gl-draw";
When using a CDN
1<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.4.3/mapbox-gl-draw.js'></script>
When using modules
1import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'
When using CDN
1<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.4.3/mapbox-gl-draw.css' type='text/css' />
Typescript definition files are available as part of the DefinitelyTyped package.
npm install @types/mapbox__mapbox-gl-draw
1mapboxgl.accessToken = 'YOUR_ACCESS_TOKEN';
2
3var map = new mapboxgl.Map({
4 container: 'map',
5 style: 'mapbox://styles/mapbox/streets-v12',
6 center: [40, -74.50],
7 zoom: 9
8});
9
10var Draw = new MapboxDraw();
11
12// Map#addControl takes an optional second argument to set the position of the control.
13// If no position is specified the control defaults to `top-right`. See the docs
14// for more details: https://docs.mapbox.com/mapbox-gl-js/api/#map#addcontrol
15
16map.addControl(Draw, 'top-left');
17
18map.on('load', function() {
19 // ALL YOUR APPLICATION CODE
20});
https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
For additional functionality check out our list of custom modes.
Mapbox Draw accepts functionality changes after the functionality has been proven out via a custom mode. 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.
Install dependencies, build the source files and crank up a server via:
git clone git@github.com:mapbox/mapbox-gl-draw.git
npm ci
npm start & open "http://localhost:9967/debug/?access_token=<token>"
npm run test
To GitHub and NPM:
npm version (major|minor|patch)
git push --tags
git push
npm publish
To CDN:
# make sure you are authenticated for AWS
git checkout v{x.y.z}
npm ci
npm run prepublish
aws s3 cp --recursive --acl public-read dist s3://mapbox-gl-js/plugins/mapbox-gl-draw/v{x.y.z}
Update the version number in the GL JS example.
We're trying to follow standards when naming things. Here is a collection of links where we look for inspiration.
No vulnerabilities found.
Reason
29 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
3 existing vulnerabilities detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More