toCartesian3
Normalize a coordinate to Cartesian3
。
Usage
js
const pos1 = toCartesian3(new Cartesian3())
const pos2 = toCartesian3([100, 20])
const pos3 = toCartesian3([100, 20, 10])
const pos4 = toCartesian3(100, 20, 10)
const pos5 = toCartesian3({
longitude: 100,
latitude: 20
})
const pos6 = toCartesian3({
longitude: 100,
latitude: 20,
height: 10
})
Type Declarations
Details
ts
type NumberOrString = number | string
/**
* Normalized coordinates/Cartesian3/... to `Cesium.Cartesian3`.
*
* ## example
* ```js
* toCartesian3(120, 80)
* toCartesian3({ longitude: 120, latitude: 80 }) // Cesium.Cartesian3.fromDegrees(120, 80)
* toCartesian3(120, 80, 1000) // Cesium.Cartesian3.fromDegrees(120, 80)
* toCartesian3([120, 80, 1000]) // Cesium.Cartesian3.fromDegrees(120, 80, 1000)
* toCartesian3(new Cesium.Cartesian3(100, 200, 300)) // new Cesium.Cartesian3(100, 200, 300)
* ```
*/
export declare function toCartesian3(
longitude: NumberOrString,
latitude: NumberOrString,
altitude?: NumberOrString,
): Cesium.Cartesian3
export declare function toCartesian3(
source: Cesium.Cartesian3 | MaybeCoordinates,
): Cesium.Cartesian3