Try to add a label to the TerrainInspector sample. I got this error:Cannot call method ‘cartographicToCartesian’ of undefined.
I download Cesium-full-b25.zip; add following into index.html of TerrainInspector folder:
var ellipsoid = centralBody.getEllipsoid(); // or var ellipsoid = viewer.centralBody.getEllipsoid();
var labels = new Cesium.LabelCollection();
labels.add({
position : ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-75.10, 39.57)),
text : ‘Philadelphia’
});
scene.getPrimitives().add(labels);
if I add this one:
var labels = new Cesium.LabelCollection();
var label = labels.add();
scene.primitives.add(labels);
I will got this error: Cannot call method ‘add’ of undefined
what is wrong here? Thanks.