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
-
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
validateStyle
in production. A simple example:The
validateStyle
prop is a valid maplibreMapOption
property: docsBut Typescript complains about this:
It seems that Typescript does not recognize the
validateStyle
option forMap
. But, following along the code, it seems like thevalidateStyle
option should be there:Map
is defined here. The props are of typeMapProps
.export type MapProps = _MapProps<MapOptions, MapStyle, MapCallbacks, MaplibreMap>;
source_MapProps
is defined here and will includeMapInitOptions<MapOptions>
type MapInitOptions<MapOptions> = Omit<MapOptions,'style' | 'container' | 'bounds' | 'fitBoundsOptions' | 'center'>;
. That means that theMapInitOptions
should include thevalidateStyle
prop at this moment:MapOptions
are originally imported inexports-maplibre.ts
frommaplibre-gl
. That one includesvalidateStyle
!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 isvalidateStyle
not supported forMap
?I'm using
[email protected]
and[email protected]
Beta Was this translation helpful? Give feedback.
All reactions