PolygonGraphic
's textureCoordinates
need a PolygonHierarchy
of Cartesian2
, but PolygonHierarchy
requires Cartesian3
#12366
Labels
What happened?
I use typescript. When I create an entity with a polygon and assign texture coordinates to it, I get the error:
TS2322: Type 'Cartesian2' is not assignable to type 'Cartesian3'
This is because the
textureCoordinates
expects x-y-values (Cartesian2
).But the
PolygonHierarchy
is only defined with x-y-z-values (Cartesian3
).Workarounds
@ts-ignore
to hide the error.Cartesian3(x, y, anyZ)
to make the error go away. Cesium will still work, but having a z-coordinate for texture coordinates suggests that 3D textures are used.Reproduction steps
Create an Entity with a polygon with texture coordinates in typescript.
Sandcastle example
https://sandcastle.cesium.com/#c=vVRNb9swDP0rhC91gEy2ZMfx3DTYkB0L7NBgl7koFId1tMlSICnp3KL/fXLitlmaAT1stQ8mqfdIih+utLIOtgLv0MAFKLyDGVqxaci3nS0sg2qnz7RyXCg0ZTA4L1W14xmsnGft6QSVE06gJXy5DB9KBaB4g0UnAJTBWsu21qoMhp2l1wp42J+vBBpuqlVbPCUw48Z5iauE3BrdfMHaINrPxvA2/L4nvTwfKKMkpSOWpinL6SjLhseQNCEs/0izzCPibJS/RrzBSTImsUfFGUvzJGHZ+ISTOCE0p3lKMzZO6Dj9P07+dp3rQS+sUNQrVwDrdYe/3MbgTGuzFIr72j4Xv2uH9b3zTS3goLYH4/DcDRbGQ6CDIUQRwPyKJYwVMG/XCGcvmDMQFpR2wK0VteILieA0uD9hyRl5Q6z4vWLR9431z2t43Tf6sf82vsdGcFn45SMkEg2v0Ub7XG4uda1vZlpqQ36s634pO+Zjt97d22/1vdbNXIdHOz44h2AYTKxrJU6fEvgkmrU2DjZGhj6gw2YtuzmLFpvqJzpSWds576CT6JA6WYotiOXFiZ8NVNLf35/cbqS8EvdYBtNJ5PGvqFJzP9f11y0aydsOtqLTy72REDKJvHqa6bSWC26OPP8G
Environment
CesiumJS Version: 1.124
Typescript Version: 5.5.4
The text was updated successfully, but these errors were encountered: