-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument of type 'MapboxDraw' is not assignable to parameter of type 'IControl' #1257
Comments
Hi, @alamenai. Could you please try the latest GL JS v3.5.2? |
Hi @stepankuzmin , Thank you. Yes, I'll try it this weekend and get back to you. |
I am using It appears to be related to
|
It seems it's related to the |
I have a PR in for this: |
I don't know how versioning works, but that MR got merged. You should at least be able to manually set the branch/commit in your package.json. |
Apologies from my side. A new error has reared its head. The update works great when using I’m not sure how to fix these. Plus it’s hard to test, as everything works great when woking locally. |
Hi @brookjordan, Thanks for taking a stab at this. I think you could use the |
Could you help me out with the syntax. The types don’t seem to latch on properly. Maybe the way MapBox has transpiled everything has meant that TypeScript no longer recognises the namespaces? My attempt was changing from this: declare module "mapbox-gl" {
interface Map {
on<T extends MapboxDraw.DrawEventType>(type: T, listener: (event: EventOf<T>) => void): this;
off<T extends MapboxDraw.DrawEventType>(type: T, listener: (event: EventOf<T>) => void): this;
}
} to this: declare module "mapbox-gl" {
namespace mapboxgl {
interface Map {
on<T extends MapboxDraw.DrawEventType>(type: T, listener: (event: EventOf<T>) => void): this;
off<T extends MapboxDraw.DrawEventType>(type: T, listener: (event: EventOf<T>) => void): this;
}
}
} |
@mapbox/mapbox-gl-draw: ^1.4.3,
@mapbox/mapbox-gl-draw-static-mode: ^1.0.1,
mapbox-gl: ^3.2.0,
Steps to Trigger Behavior
Code
Expected Behavior
Types compatible
Actual Behavior
The text was updated successfully, but these errors were encountered: