TypeScript: VectorSource<Feature<Point>>
can't be used as a source for VectorLayer
#15832
Labels
VectorSource<Feature<Point>>
can't be used as a source for VectorLayer
#15832
Describe the bug
I have a somewhat surprising typing issue where TypeScript will not let me use a
VectorSource<Feature<Point>>
as source for aVectorLayer
, which seems surprising:This gives the error:
It looks similar to #15356, but that should have been fixed and I'm using 9.2.0 when I see this error.
To Reproduce
Steps to reproduce the behavior:
source
is provided toVectorLayer
's contstructor, see error message aboveThis issue occurred in my app code which of course is a lot more complicated. It used to work, but after an upgrade (probably updating my TypeScript version), several errors like this one occurred. I tried upgrading to latest OpenLayers, but the issue persists.
Expected behavior
I expect to be able to use a
VectorSource<Feature<Point>>
as a source forVectorLayer
without having to resort to type casting.The text was updated successfully, but these errors were encountered: