You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that Typescript does not recognize the validateStyle option for Map. But, following along the code, it seems like the validateStyle option should be there:
Map is defined here. The props are of type MapProps.
export type MapProps = _MapProps<MapOptions, MapStyle, MapCallbacks, MaplibreMap>;source
The _MapProps is defined here and will include MapInitOptions<MapOptions>
type MapInitOptions<MapOptions> = Omit<MapOptions,'style' | 'container' | 'bounds' | 'fitBoundsOptions' | 'center'>;. That means that the MapInitOptions should include the validateStyle prop at this moment:
The MapOptions are originally imported in exports-maplibre.ts from maplibre-gl. That one includes validateStyle!
But I'm still getting the typescript error and I'm not even sure if validateStyle is actually disabled for my map component. Is this a bug or is validateStyle not supported for Map?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Not sure if I should create an issue for this, because I am not sure whether this is an actual bug or intended.
In my map component, I'd like to disable
validateStylein production. A simple example:The
validateStyleprop is a valid maplibreMapOptionproperty: docsBut Typescript complains about this:
It seems that Typescript does not recognize the
validateStyleoption forMap. But, following along the code, it seems like thevalidateStyleoption should be there:Mapis defined here. The props are of typeMapProps.export type MapProps = _MapProps<MapOptions, MapStyle, MapCallbacks, MaplibreMap>;source_MapPropsis defined here and will includeMapInitOptions<MapOptions>type MapInitOptions<MapOptions> = Omit<MapOptions,'style' | 'container' | 'bounds' | 'fitBoundsOptions' | 'center'>;. That means that theMapInitOptionsshould include thevalidateStyleprop at this moment:MapOptionsare originally imported inexports-maplibre.tsfrommaplibre-gl. That one includesvalidateStyle!But I'm still getting the typescript error and I'm not even sure if
validateStyleis actually disabled for my map component. Is this a bug or isvalidateStylenot supported forMap?I'm using
[email protected]and[email protected]Beta Was this translation helpful? Give feedback.
All reactions