A bug in GeoJsonDataSource?

I’ve noticed that when I used GeoJsonDataSource to add entities with a billboard, the billboard image is not displayed

in the center of the entity’s position. This happens because, for some reason the billboard created by the GeoJsonDataSource, have a verticalOrigin with value 1 (BOTTOM). Whenever I create a plain new entity with a billboard, there’s no verticalOrigin on the billboard graphics.

The code below demonstrates the issue - it creates two entities with the same position and the same billboard, which you can see are shown in

different positions. Currently as a workaround I will set the verticalOrigin to undefined after the parsed geojson is processed.

To reproduce- paste to sandcastle :
var viewer = new Cesium.Viewer(‘cesiumContainer’);

var facilityUrl = ‘…/images/facility.gif’;

var geoJson = {

type : "Point",

coordinates : [-75.5979392,40.0367852]



var entity = dataSource.entities.values[0];

entity.billboard.image = facilityUrl;

entity.billboard.color = Cesium.Color.RED.withAlpha(0.5);



var entity = new Cesium.Entity();

entity.position = Cesium.Cartesian3.fromDegrees(-75.5979392,40.0367852);

entity.billboard = new Cesium.BillboardGraphics();

entity.billboard.image = facilityUrl;

entity.billboard.color = Cesium.Color.YELLOW.withAlpha(0.5);



This isn’t a bug, it’s by design. Most GeoJsonData is on the ground and having the origin be the center for the pin image results in the billboard being half buried under ground. The bottom of the pin is meant to mark the true location of the object so we set the origin to bottom. Unsetting the value after load (or to something else that you want) is perfectly okay and the expected way to customize your visualization.

We may eventually have some global defaults for across all data sources in Cesium, but it’s not on the short-term roadmap.

Thanks, it didn’t occur to me that it is useful for pins, since my billboards are centered around their own center.