Draw cursor not set to "crosshair" if default cursor of map is set to "default" or "pointer"
Draw cursor not set to "crosshair" if default cursor of map is set to "default" ,"pointer" or anything else maybe.
The draw cursor is set to "crosshair" only when the cursor style is not explicitly set.
For example if I do
map.getCanvas().style.cursor = "default"
The draw cursor is also set to "default"
But if I just remove the above-mentioned line, the draw cursor is set to "crosshair" upon selecting a draw mode.
mapbox-gl-js 1.0.0: mapbox-gl-draw 1.1.2:
Steps to Trigger Behavior
- Set map cursor to anything explicitly, for example
map.getCanvas().style.cursor = "default" - Select a shape to draw
- See the cursor to be set as "default" instead of "crosshair"
Expected Behavior
Cursor is to be set to crosshair when a draw mode is selected.
Actual Behavior
Cursor is not set to crosshair when a draw mode is selected.
I'm not sure I understand this issue. It seems like you're explicitly forcing the cursor to be something else, but then you expect that the cursor still changes? Could you just remove the line that sets the cursor explicitly?
map.getCanvas().style.cursor = "unset";
I had the same problem. It's not as easy as "do not set the cursor then" as the other answers here suggest. Instead of:
map.getCanvas().style.cursor = 'default'
You should override the cursor with CSS:
.mapboxgl-canvas-container.mapboxgl-interactive,
.mapboxgl-canvas-container.mapboxgl-interactive:active {
cursor: default;
}
This way you can override the default cursor and have the correct drawing cursors.