Skip to content

Rendering error for entity at origin #12150

@javagl

Description

@javagl

When creating an entity at (0,0,0), it crashes with

TypeError: Cannot read properties of undefined (reading 'longitude')

Sandcastle:

https://sandcastle.cesium.com/index.html#c=dY/BSsQwEIZfZeiphZK6eFu7RehV8CB46iVtRh02nZRM2nWVfXeT9rLoCnPI/Pm+n2RwLAEWwhN6OADjCVoUmkf1umZ5lw3r3joOmhh9lxUPHW+GQg4UCEVpY/LvjgEmJzFxvL/uarUP8aT5Pr8rIU1RJrh3n3tYNQBDI7JEU/5TdyWkKRJ/if4lPSQrs1rC2WKz1QA80jg5H2D2NleqCjhOVseOqp+HIwY1iCQxoXV1rdaGFiBzuPFlGKwWiTdvs7Uv9IVd1tRV5P+o1mlD/P68oLf6nLCPXfO0hUqpuorrbTM4Z3vtfzX/AA

It's pretty simple:

const viewer = new Cesium.Viewer("cesiumContainer");
viewer.entities.add({
  position: new Cesium.Cartesian3(0, 0, 0),
  box: {
    dimensions: new Cesium.Cartesian3(1, 1, 1)
  },
});

This is caused here:

const cartographic = ellipsoid.cartesianToCartographic(

The cartesianToCartographic function is returning undefined when receiving the center.

(I'll just put it at (0, 0, 1e-15) for now...)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions