# DistanceDisplayCondition

#### new Cesium.DistanceDisplayCondition(near, far)
Core/DistanceDisplayCondition.js 20

Determines visibility based on the distance to the camera. 决定在某个相机视角高度范围内图元是否可见。

Name | Type | Default | Description
--- | --- | --- | ---
`near` | Number | `0.0` | optional 最小的物体可见高度。The smallest distance in the interval where the object is visible.
`far` | Number | `Number.MAX_VALUE` | optional 最大的物体可见高度。The largest distance in the interval where the object is visible.

##### Example:

    // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
    // 让一个广告牌图元仅在10到20米的相机高度内可见.
    billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);

### Members

#### static Cesium.DistanceDisplayCondition.packedLength : Number
Core/DistanceDisplayCondition.js 63

The number of elements used to pack the object into an array.

#### far : Number
Core/DistanceDisplayCondition.js 49

The largest distance in the interval where the object is visible.

Default Value: `Number.MAX_VALUE`

#### near : Number
Core/DistanceDisplayCondition.js 35

The smallest distance in the interval where the object is visible.

Default Value: `0.0`

### Methods

#### static Cesium.DistanceDisplayCondition.clone(value, result) → DistanceDisplayCondition
Core/DistanceDisplayCondition.js 135

Duplicates a distance display condition instance.

Name | Type | Description
--- | --- | ---
`value` | DistanceDisplayCondition | optional The distance display condition to duplicate.
`result` | DistanceDisplayCondition | optional The result onto which to store the result.

##### Returns:

The duplicated instance.

#### static Cesium.DistanceDisplayCondition.equals(left, right) → Boolean
Core/DistanceDisplayCondition.js 124

Determines if two distance display conditions are equal.

Name | Type | Description
--- | --- | ---
`left` | DistanceDisplayCondition | A distance display condition.
`right` | DistanceDisplayCondition | Another distance display condition.

##### Returns:

Whether the two distance display conditions are equal.

#### static Cesium.DistanceDisplayCondition.pack(value, array, startingIndex) → Array.<Number>
Core/DistanceDisplayCondition.js 74

Stores the provided instance into the provided array.

Name | Type | Default | Description
--- | --- | --- | ---
`value` | DistanceDisplayCondition |  | The value to pack.
`array` | Array.<Number> |  | The array to pack into.
`startingIndex` | Number | `0` | optional The index into the array at which to start packing the elements.

##### Returns:

The array that was packed into

#### static Cesium.DistanceDisplayCondition.unpack(array, startingIndex, result) → DistanceDisplayCondition
Core/DistanceDisplayCondition.js 100

Retrieves an instance from a packed array.

Name | Type | Default | Description
--- | --- | --- | ---
`array` | Array.<Number> |  | The packed array.
`startingIndex` | Number | `0` | optional The starting index of the element to be unpacked.
`result` | DistanceDisplayCondition |  | optional The object into which to store the result.

##### Returns:

The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.

#### clone(result) → DistanceDisplayCondition
Core/DistanceDisplayCondition.js 155

Duplicates this instance.

Name | Type | Description
--- | --- | ---
`result` | DistanceDisplayCondition | optional The result onto which to store the result.

##### Returns:

The duplicated instance.

#### equals(other) → Boolean
Core/DistanceDisplayCondition.js 165

Determines if this distance display condition is equal to another.

Name | Type | Description
--- | --- | ---
`other` | DistanceDisplayCondition | Another distance display condition.

##### Returns:

Whether this distance display condition is equal to the other.