Label font property not working properly for certain values

Hi,

I am trying to create custom data source with points and labels. When I use font property as ‘20px Arial’ label is half visible. I tried for different font sizes but it’s working for few values. Also when I add same labels and points as entities to viewer it’s working fine. Please find the below piece of code and attached screen shots. Please let me know if there is any bug in custom data source?

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var customDatasource = new Cesium.CustomDataSource(‘custom’);

viewer.dataSources.add(customDatasource);

customDatasource.entities.add({

position : Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222),

point : {

pixelSize : 50,

color : Cesium.Color.RED,

},

label : {

text : ‘10’,

font : ‘15px Arial’,

style: Cesium.LabelStyle.FILL,

fillColor : Cesium.Color.fromCssColorString(’#FFF’),

horizontalOrigin : Cesium.HorizontalOrigin.CENTER,

verticalOrigin : Cesium.VerticalOrigin.CENTER

}

});

Thanks,

Gowtham.

Hello,

This looks like a z-fighing issue. You can move the label in front of the point using the eyeOffset property like this:
eyeOffset: new Cesium.Cartesian3(0,0,-300)

``

A negative z value moves it closer to the screen

Best,

Hannah

Thanks Hannah. I will check this.

Hi Hannah,

I tried eye Offset property as you mentioned but it is not working. Also the same code is working fine in Cesium 1.8. Could you please check?

Thanks,

Gowtham.

I didn’t specify, but the eyeOffset is a property for the label. Like this:

label : {

text : ‘10’,

font : '15px Arial',  

style: Cesium.LabelStyle.FILL,

fillColor : Cesium.Color.fromCssColorString(’#FFF’),

horizontalOrigin : Cesium.HorizontalOrigin.CENTER,

verticalOrigin : Cesium.VerticalOrigin.CENTER,
eyeOffset:new Cesium.Cartesian3(0,0,-300)

}

``

If the label is still appearing behind the point at certain camera angles, you can try larger negative numbers for the eye offset value.

If it’s still not working, can you please paste a code sample? Thanks