Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
mapseed-mapbox-gl-draw
Advanced tools
This fork of mapbox-gl-draw
is only intended to be used temporarily with our react-map-gl
setup. Please don't use this fork elsewhere!
Adds support for drawing and editing features on mapbox-gl.js maps. See a live example here
Requires mapbox-gl-js. Compatible versions are documented in the package.json
On NPM this package has recently moved from mapbox-gl-draw
to @mapbox/mapbox-gl-draw
npm install @mapbox/mapbox-gl-draw
Draw ships with CSS, make sure you include it in your build.
When using modules
require('@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css')
// or
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'
When using CDN
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.9/mapbox-gl-draw.css' type='text/css' />
When using modules
var mapboxgl = require('mapbox-gl');
var MapboxDraw = require('@mapbox/mapbox-gl-draw');
When using a CDN
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.9/mapbox-gl-draw.js'></script>
Example setup
mapboxgl.accessToken = 'YOUR_ACCESS_TOKEN';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v8',
center: [40, -74.50],
zoom: 9
});
var Draw = new MapboxDraw();
// Map#addControl takes an optional second argument to set the position of the control.
// If no position is specified the control defaults to `top-right`. See the docs
// for more details: https://www.mapbox.com/mapbox-gl-js/api/map#addcontrol
map.addControl(Draw, 'top-left');
map.on('load', function() {
// ALL YOUR APPLICATION CODE
});
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
yarn install
yarn 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
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.
1.1.1
FAQs
A drawing component for Mapbox GL JS
The npm package mapseed-mapbox-gl-draw receives a total of 1 weekly downloads. As such, mapseed-mapbox-gl-draw popularity was classified as not popular.
We found that mapseed-mapbox-gl-draw demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.