Creates a new arc.
createArc(position, radiusX, radiusY, startAngle, endAngle, [lineColor], [fillColor], [name]);
Parameter |
Description |
position |
The position of the object, defined by its coordinates in the 3D world Can be one of the following: SGCoord3D, SGCoord2D, SGPosition |
radiusX |
The radius of the arc along its X axis |
radiusY |
The radius of the arc along its Y axis |
startAngle |
The starting angle of the arc. The arc is built going clockwise. |
endAngle |
The angle at which the arc ends. The arc is built going clockwise. |
lineColor |
Optional, default: sgLime The color of the object outline Can be one of the following: SGColor, HTML color string (e.g., “#FF0000”), a number that represents ABGR color (e.g., 0xAA0000FF) or one of the predefined Skyline Globe colors (e.g., sgRed). For a complete list of the predefined colors, see Skyline Globe Colors |
fillColor |
Optional, default: sgDimgray The color of the object filling Can be one of the following: SGColor, HTML color string (e.g., “#FF0000”), a number that represents ABGR color (e.g., 0xAA0000FF) or one of the predefined Skyline Globe colors (e.g., sgRed). For a complete list of the predefined colors, see Skyline Globe Colors |
name |
Optional The node name |
Return Value
An SGNode object. If the method fails, the return value is null. SGWorld.lastError will contain the failure reason.
Remarks
To modify other properties of the arc, access the node innerObj. See SGNode.innerObj property and ITerrainArc5 interface for more details.
The default arc is drawn on the terrain surface. To modify this behavior, change the heightType property of the position parameter (SGCoord3D and SGPosition object only). If SGCoord2D is entered as the first parameter, the arc will be drawn on the terrain surface.
Example
The following example illustrates the use of the createArc method.
function createArc()
{
var arc = globe.creator.createArc(
new SGCoord2D(-114.7378,36.0159),
1000, 300,
-90, 90
);
globe.root.appendChild(arc);
globe.navigate.flyTo(arc);
}