SGCoord3D Constructor

Initializes a new instance of the SGCoord3D class.

SGCoord3D(x, y, [height] ,[heightType]);

SGCoord3D(coord);

SGCoord3D(arr);

SGCoord3D(strStream);

 

Parameter

Description

x

The x coordinate, usually longitude

y

The y coordinate, usually latitude

height

Optional, default: undefined

height of the coordinate

heightType

Optional, default: sgHeightRelative

Can be one of the following:

sgHeightRelative – the height parameter represents the distance of the coordinate to the ground

sgHeightOnTerrain – the height parameter is ignored and the coordinate is on the terrain

sgHeightAbsolute – the height parameter represents the absolute height (relative to sea level)

coord

Constructs an SGCoord3D object from another coordinate

Can be  SGCoord2D, SGCoord3D or SGPosition

arr

An array of coordinates objects or SGNode objects

strStream

Construct SGCoord3D object from a string. The string can have one of the following formats:

  1. “SGCoord3D(x,y,height,heightType)”
    e.g., “SGCoord3D(100.0,30.0,10.0,sgHeightOnTerrain)”

  2. “<SGCoord3D >
        <x>x</x>
        <y>y</y>
        <height>height</height>
        <heightType>heightType</heightType>
     </SGCoord3D>”
    e.g., “<SGCoord3D >
               <x>100.0</x>
               <y>30.0</y>
               <height>10.0</height>
               <heightType>sgHeightOnTerrain<heightType>
            </SGCoord3D>”

Remarks

Unlike SGCoord2D, the SGCoord3D class can represent a three dimensional coordinate that in addition to the regular x and y has also height property. The Skyline Globe Control can interpret the height property in several ways. The height property is interpreted according to the heightType property of the class.