scaleByDistance at czml is not working ??

1. A concise explanation of the problem you’re experiencing.

czml label and scaleByDistance option is not working.

Is it normal??

or is there any thing i miss ??

Thank you!

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var czml = [{

“id” : “document”,

“name” : “Basic CZML billboard and label”,

“version” : “1.0”

}, {

“id” : “some-unique-id”,

“name” : “AGI”,

“description” : “

Analytical Graphics, Inc. (AGI) founded Cesium.


“billboard” : {


“scale” : 1.5


“label” : {

“fillColor” : {

“rgba” : [255, 255, 255, 255]


“font” : “12pt Lucida Console”,

“horizontalOrigin” : “LEFT”,

“pixelOffset” : {

“cartesian2” : [8, 0]


“style” : “FILL”,

“text” : “Test_Text”,

“scaleByDistance” : new Cesium.NearFarScalar(1.5e5, 0.1, 1.5e7, 0.01),

“showBackground” : true,

“backgroundColor” : {

“rgba” : [112, 89, 57, 200]



“position” : {

“cartographicDegrees” : [126.69248300366301, 37.45092668898614, 0.0]



3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I wanna show many czml label through mariadb

so label shown small to user

label is about building/bus stop/metro station information

4. The Cesium version you’re using, your operating system and browser.


latest Chrome

Win10 64bit

At czml-guide github there are description about scaleByDistance label.

but not working

You can’t add a direct instance of a CesiumJS class to CZML (since that’s not something you can store in a JSON document without serializing). So you need to replace:

“scaleByDistance” : new Cesium.NearFarScalar(1.5e5, 0.1, 1.5e7, 0.01),



“scaleByDistance” : {

“nearFarScalar”: [1.5e5, 0.1, 1.5e7, 0.01]



Since that’s how a nearFarScalar is written in CZML (from

Here’s a full Sandcastle you can run. Let me know if this helps!

Thats work !!

It was poor question.

Thank you Omar

I tried running your sandcastle. I uncommented the last line for scaleByDistance. I’m not seeing what difference it is making. I’m new to this site and I may not be understanding how the sample code works.

I was just trying to figure out if this is the feature I’m looking for.

Here’s a simpler Sandcastle showing how scaleByDistance works. It just allows you to change the size of the icon based on the distance to the camera. Try zooming in and out here to see.

Ok, thanks. That’s not what I was looking for.