-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Feat] upgrade to fit [email protected]
#2411
Comments
Thanks. Do you have any suggestion on how we should handle this? Do we just make |
Hi. I didn't touch anything under the hood both of your library or new types due to absence of time. Also you seem to be maintaining backwards compatibility, so there may be another task along with just the types package updating. I'll check just running the latest version of both types and this library... or you'll do it faster 😁 |
I just tried to upgrade and ran into one incompatibility, but (perhaps obviously) it had no functional impact, just caused a type error. Specifically, I have defined a few layers like so:
This Layer is then wrapped in a Source before being rendered, like so:
With the new types however, I need to define a
Adding a random string such as My assumption is that this library uses mechanisms that renders the |
@jgarplind I don't think there is an export called |
@Pessimistress I think there is since the recent 3.5.0 release that this issue is about. The migration guide indicates it:
and other than |
Oh, you are importing it directly from |
That's right. Thanks for clarifying! I based my practice on your documentation, though I must have confused So if you think it is preferable to use the |
This error occurred when using
this is DrawControl.ts file: import MapboxDraw from '@mapbox/mapbox-gl-draw';
import { useControl } from 'react-map-gl';
import type { ControlPosition } from 'react-map-gl';
import type { MapContextValue } from 'react-map-gl/dist/esm/components/map';
import drawStyles from './draw-modes/draw-style';
type DrawControlProps = ConstructorParameters<typeof MapboxDraw>[0] & {
position?: ControlPosition;
onCreate: (evt: { features: object[] }) => void;
onUpdate: (evt: { features: object[]; action: string }) => void;
onDelete: (evt: any) => void;
};
export default function DrawControl(props: DrawControlProps) {
useControl<MapboxDraw>(
() => new MapboxDraw({
...props,
styles: drawStyles,
}),
({ map }: MapContextValue) => {
map.on('draw.create', props.onCreate);
map.on('draw.update', props.onUpdate);
map.on('draw.delete', props.onDelete);
},
({ map }: MapContextValue) => {
map.off('draw.create', props.onCreate);
map.off('draw.update', props.onUpdate);
map.off('draw.delete', props.onDelete);
},
{
position: props.position
}
);
return null;
}
DrawControl.defaultProps = {
onCreate: () => { },
onUpdate: () => { },
onDelete: () => { }
}; |
I’m getting the same errors as the above with using the draw control code example. Are there fixes for this? |
@JessiDeuxTrois I am using |
@Pessimistress, can you estimate the effort in supporting the latest mapbox version (3.5.0 and beyond)? It seems there are typing issues mapbox/mapbox-gl-js#13203 |
Target Use Case
mapbox/mapbox-gl-js#13203
Proposal
mapbox/mapbox-gl-js#13203
The text was updated successfully, but these errors were encountered: