MCPcopy
hub / github.com/CesiumGS/cesium / fromDegrees

Method fromDegrees

packages/engine/Source/Core/Rectangle.js:170–186  ·  view source on GitHub ↗

* Creates a rectangle given the boundary longitude and latitude in degrees. * * @param {number} [west=0.0] The westernmost longitude in degrees in the range [-180.0, 180.0]. * @param {number} [south=0.0] The southernmost latitude in degrees in the range [-90.0, 90.0]. * @param {number} [

(west, south, east, north, result)

Source from the content-addressed store, hash-verified

168 * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
169 */
170 static fromDegrees(west, south, east, north, result) {
171 west = CesiumMath.toRadians(west ?? 0.0);
172 south = CesiumMath.toRadians(south ?? 0.0);
173 east = CesiumMath.toRadians(east ?? 0.0);
174 north = CesiumMath.toRadians(north ?? 0.0);
175
176 if (!defined(result)) {
177 return new Rectangle(west, south, east, north);
178 }
179
180 result.west = west;
181 result.south = south;
182 result.east = east;
183 result.north = north;
184
185 return result;
186 }
187
188 /**
189 * Creates a rectangle given the boundary longitude and latitude in radians.

Callers 15

I3SLayer.jsFile · 0.45
SceneFunction · 0.45
I3SNode.jsFile · 0.45
I3SDecoder.jsFile · 0.45
morphFrom2DTo3DFunction · 0.45
metadataSuccessFunction · 0.45
toCartesianFunction · 0.45
addLayersFunction · 0.45

Calls 1

definedFunction · 0.70

Tested by 3

testFunction · 0.36
testFunction · 0.36
testFunction · 0.36