scaleByDistance

Gets or sets near and far scaling properties of a point based on the point's distance from the camera. A point's scale will interpolate between the NearFarScalar.nearValue and NearFarScalar.farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar.near and NearFarScalar.far. Outside of these ranges the point's scale remains clamped to the nearest bound. This scale multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined, scaleByDistance will be disabled.

// Example 1.
// Set a pointPrimitive's scaleByDistance to scale to 15 when the
// camera is 1500 meters from the pointPrimitive and disappear as
// the camera distance approaches 8.0e6 meters.
p.scaleByDistance = new NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
// Example 2.
// disable scaling by distance
p.scaleByDistance = undefined;

See also