cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Primitive with heightReference have a wrong positioning in 2D mode

Open Jean-Dum opened this issue 11 months ago • 2 comments

What happened?

Hello!

I use Cesium version 1.127.0. When a primitive has a heightReference other than NONE, its position on map is wrong in 2D mode. In 3D or without the heightReference, the primitive is placed properly.

If the primitive is displayed at lattitude longitude [0, 0], it is correctly placed.

Thank you for your help!

Sandcastle with option to add a point with a heightReference set to CLAMP_TO_GROUND

Reproduction steps

  1. Add two primitives (point or billboard) with and without a heightReference different than NONE
  2. Set the map in 2D mode
  3. The two primitives are not placed at the same position on map

Sandcastle example

https://sandcastle.cesium.com/#c=vZRtb9owEMe/ipVXqcQMG6voKEVDgEalUhCk48UyVca5EGuOjWyHlk189zlPlNBMqzRpSEj4fP/z7467o1Jog3YMnkChGyTgCQ1BsyTGXzOb6zs0Ow+lMIQJUL5zce0LX+QarCkIwLEMwMoL6TK1Ta0JL4fj+/GHUSag2VNbyYSZS80Mk+JFMiTK2F9EtHGoZDyCjQLQ7rvOJb781Ol0GuhjC7faV1ft/PUwETSLQIJgnoZ0L9AvXyC0JCKgRBsOOADKiQK3dMmVqMgWgzAWAjS2926mRZYuB+tWORvlrbV1UeGLEJVcqu4xhfSEV5Nbb9woPbbsGfiS/YQuusxth+zukLIcUpyaVFbMRBNgm8gsIAQFgsIbsqtR/ZeEF+NRbbpHY1SFOsrPYPHwbjCdP3qzxy+L2cP9qL5cJwWwWXhS8jVRUxCJ+y11LEgNPFts3xkEQZ4DWt16k9mDV8AgVb7qOwWnbU7gQK3s+H+URU8/L212XZpOUCIblKeBK712wt/4K9w/k9V2zdtg/9A6Vf7veTedBFKgwdgRJnov6Gu4ousoiUERHPL9RMbgtvLI5y2pIJY7GHDuVu7z7WJAKbt75kruWHC+p8acs62WLPCqXnWBNlyu08nZmsgDbQYb669NIbRhQ8I1pK1mv07D6Wmz59Ava/iZxVupDEoUdzFuGoi3nNit1Vwn9AcYTLUuy9Zrnkp7AdshFtzU7FJkh1hrexMmPJsc3+n3mtb/lZRLEjCxme1AcbJP3aL3/bvciDHuNe2xXmnyKTmL/Bs

Environment

Browser: Chrome and Edge CesiumJS Version: 1.127.0 Operating System: Window 10 and 11

Jean-Dum avatar Mar 20 '25 14:03 Jean-Dum

I noticed the same issue on my end. Points/billboards with CLAMP_TO_GROUND are positioned incorrectly in 2D mode.

I tried running various older versions of Cesium, and it seems like the bug was introduced in version 1.114 because my billboards are positioned correctly in 1.113.

It also looks like the entity disappears entirely at certain coordinates like [110, 0]:

https://sandcastle.cesium.com/#c=bdDfT8IwEAfwf+Wyp5EsHeAbTqLZiD7ww4D6tISU7oDGrl3aDkTD/267oaLy1vv2PpfcMSWNhR3HPWq4AYl7SNHwuiQvTRbmAWvqVElLuUSdB53rXOayNcQwlEhKVaDjJ7rw2cRFZJGOpqN+dg5QWm45GkKLIvzIJUCljEuUHHz5lGrrXlRekbVWZYYbjWjCXq8bQbcTtYZLO4DGAzAllP7hviLzURa1vxV/Q7Hg7ziAfveUbZFvtnaOa9QoGX7bh985Scd3k8fl02x5P589TzOPj27E0d8giILE2IPAYTsT4JaXldIWai1CQmKLZSWoWyVe1ewVLWHGeOhbk/icJgXfAS9uLlwbmKDGuJ91LZot8mCYxK7/HxWKFlxuZjvUgh5827Y3HLchISSJXXlZWqXEiuo/kz8B

tigerchase96 avatar Mar 25 '25 18:03 tigerchase96

Hi @ggetz, is there a chance it will be fixed in a next release?

a-milenin avatar May 05 '25 07:05 a-milenin

This appears to be a regression from https://github.com/CesiumGS/cesium/pull/11604. It seems like a temporary workaround is possible by changing settings when switching to 2D mode, but the underlying issue should be fixed. The example example coordinates shared [0,0] , [110,0] provide some useful test cases.

lukemckinstry avatar Jul 29 '25 19:07 lukemckinstry