Label above the polyline

Hi, I asked a question on stackoverflow.com but there is small interest.
https://stackoverflow.com/questions/46647663/cesium-label-above-the-polyline

I try to make tool to measure distance. You can pick on the map and draw dots, polylines and label with distance, but labels are below than polylines. It's possible to add Label above polyline in cesium library?

Img problem:

Example:

Thanks.

Hi Pawel,

Depending on the exact look you want, there are quite a few Label options you can play with. I’d recommend Label.eyeOffset.

Thanks!

Gabby

I used Label.eyeOffset but it works only in 3d view.

It should still work by setting the z component to a negative value. For example, the second label here renders in front of the first when in 2D and in 3D.

viewer.entities.add({

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

    label : {

        text : 'Under'

    }

});

viewer.entities.add({

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

    label : {

        text : 'Over',

        fillColor: Cesium.Color.SKYBLUE,

        eyeOffset : new Cesium.Cartesian3(0, 0, -1),

    }

});

You could also try label.DisableDepthTestDistance.

Thanks,

Gabby