It is a Draw tools for mapbox-gl-js. Draw only works after the Mapbox GL JS map has loaded, so interact with Draw only after your map's load event.
Questions tagged [mapbox-gl-draw]
53 questions
1
vote
1 answer
What are the consequences of using other geojson projections while creating vector tiles using tippecannoe?
I have written my own vector tiles service based on vt-pbf, which queries a really large source of geojsons which specify different kinds of projections to be used.
While using tippecanoe tool I am getting warnings like
Warning: GeoJSON specified…

Amit Gore
- 421
- 4
- 12
1
vote
1 answer
How to rotate/transform mapbox-gl-draw features?
I'm using mapbox-gl-draw to add move-able features to my map. In addition to movability functionality, I am needing rotate/transform -ability functionality for the features akin to Leaflet.Path.Transform.
At current, would my only option to achieve…

Shawn Goulet
- 108
- 1
- 8
0
votes
0 answers
How can I get mouse cursor position in 'draw.selectionchange' event handler?
I am using @mapbox/mapbox-gl-draw to draw polygons on a map and would like to show context popup when user selects a polygon.
I think the only feasible event I can use is draw.selectionchange which is a custom event therefore no mouse cursor…

Eric Xin Zhang
- 1,230
- 15
- 20
0
votes
1 answer
Is there a draw event for a single click of a feature in mapbox-gl-draw?
I'm playing around with react-map-gl and mapbox-gl-draw to draw polygons on to my map
I'm wondering if there is a better way to get the details of a selected feature on click, rather than using the draw.selectionchange event? This event handles…

Saterz
- 33
- 5
0
votes
0 answers
Method does nothing when used inside of throttle
I wanted to throttle down some mouse events to reduce CPU impact, but it seems that one method stops working while inside of throttle.
Before:
DrawPolygon.onMouseMove = function(state, e) {
if (isVertex(e) || isMidpoint(e)) {
…

Crow
- 4,635
- 3
- 14
- 21
0
votes
1 answer
MapBox control buttons are empty
The polygon and Trash Control Buttons for MapBox are seen empty as below (functionality works perfectly).
Output
this.draw = new MapboxDraw({
userProperties: true,
displayControlsDefault: false,
controls: {
combine_features:…

Viral Panchal
- 1
- 2
0
votes
2 answers
mapbox-gl-draw data driven style on LineString
I use Mapbox GL Draw and I want to customize the fill color of my LineString Feature using data driven.
I have a set userProperties: true and I have a property prefixed with user_ .
here is my style configuration :
{
id:…

Hepatus
- 73
- 8
0
votes
2 answers
Mapbox-gl Draw controls don't display in Vue
My problem
Hello all,
I am trying to use Mapbox-gl Draw in a Vue application. I already use Mapbox-gl and it's working quite well.
When I try to use Mapbox-gl Draw, the control container is displayed, but the control icons are not displayed.
I am…

LeoDebTellae
- 31
- 4
0
votes
0 answers
Draw circle after map is loading in mapbox
I want to draw circle after map is loading. For example, when user click a button, it creates a circle on the map.
var center = turf.point(droneLocation);
var radius = 0.5;
var options = {
steps: 80,
units: 'kilometers'
};
var circle =…

Mehmet Can BOZ
- 129
- 2
- 11
0
votes
1 answer
with Mapbox gl draw, after overriding polygon features' circle-radius, how to enlarge the selected vertex's circle-radius?
in the official demo, after creating a polygon in the "draw_polygon" mode, as you direct_select a vertex on the polygon, that vertex will be enlarged. https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
In this js fiddle:…

Frank Zhang
- 1
- 2
0
votes
1 answer
Mapbox-gl-draw change drawing style after click a button
I am trying to let the user choose their paint color and then paint polygon on map. I know there is a setFeatureProperty method, but it needs to pass in a feature ID and thus user will need to draw the shape first and then change style. Is there…
0
votes
1 answer
Svelte Mapbox-gl-draw: how to get polygon coords to the parent component?
I use Mapbox in an Svelte-Sapper application, according to the Context API example in the Svelte Tutorial. I want to use Mapbox-Draw for drawing polygons to limit an area to search for objects, based on their coordinates. I have extended the…

haenf
- 1
- 3
0
votes
1 answer
PHP JSON encode numerical array in MySQL
i try save and edit lines in Mapbox GL Draw, for this i use MySQL and PHP (requirements), and only save the coordinates in MySQL, but i make query and encode in JSON, program return this
"geometry": {
"coordinates":…

Sebastian Guajardo
- 23
- 6
0
votes
1 answer
How do I change my map's font to Noto Kufi Arabic?
I have a native app that uses Mapbox, my app is mainly for Kurdish customers.
I have a really big problem, the texts and addresses shown on the app use a font that displays the Kurdish texts poorly, I like to make the map show all texts and…

plain.js
- 64
- 1
- 6
0
votes
0 answers
Is it possible to make mapbox.com draw tools to appear in a custom DIV?
As title. Because of the requests of my GIS project, I need to make the buttons of mapbox.com draw tools shown in a DIV, to make the DIV look like one of my created toolboxes. I've searched on Google using "mapbox.com draw tool in another div "…

Gary Lu
- 53
- 1
- 2
- 11