mapbox-gl-draw
mapbox-gl-draw copied to clipboard
MapboxDraw doesn't work with MapLibre 3.x
As of MapLibre 3.x, the MapboxDraw plugin is no longer working. The issue can be seen in this official MapLibre example.
This is because MapLibre no longer uses the Mapbox CSS classes that MapboxDraw is checking for, which has been discussed in this (closed) MapLibre issue. Obviously this is because of a change to MapLibre, but I think it would be great if MapboxDraw could be used in both Mapbox and MapLibre. A relatively easy option I see is to consolidate all of the CSS classes that MapboxDraw is using into its list of constants (many but not all of them are already there), and allow them to be updated either before or while instantiating a MapboxDraw instance. Thoughts on this?
Sounds like a good approach from my point of view. @pessimistress what is your solution for react-map-gl for these kind of issues? @stepankuzmin what do you think should be the approach?
Hey everyone! Overriding classes in GL JS Draw sounds like a good addition. We already have constants in src/constants.js
, so implementing overriding should be straightforward. Does anyone want to take a first stab at it?
I'll be happy to give it a go. I'm hoping to be able to work on it this week.
I tried this and it's okay
Note to people finding this issue: it looks like only the "display controls" are broken. I was able to hack together a PoC for my Vaadin integration by using a separate UI to trigger the draw mode (and using defaultMode constructor parameter to start drawing immediately): https://github.com/parttio/maplibre/commit/edb0a498d5c384a3a35e2b8fdcc408075860db4c
I tried this and it's okay
Worked for me.
This is not working for me. Any updates on this issue?
I tried this and it's okay
I'm using:
"maplibre-gl": "^4.1.1",
"@mapbox/mapbox-gl-draw": "^1.4.3",
Unfortunately I've had to prioritize other work. We are using the latest of both libraries, and the workaround I posted on the MapLibre side is still working.