id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
10,500
NASAWorldWind/WebWorldWind
src/formats/geotiff/GeoTiffUtil.js
function (geoTiffData, byteOffset, numOfBytes, sampleFormat, isLittleEndian) { var res; switch (sampleFormat) { case TiffConstants.SampleFormat.UNSIGNED: res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, false); break; case TiffConstants.SampleFormat.SIGNED: res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, true); break; case TiffConstants.SampleFormat.IEEE_FLOAT: if (numOfBytes == 3) { res = geoTiffData.getFloat32(byteOffset, isLittleEndian) >>> 8; } else if (numOfBytes == 4) { res = geoTiffData.getFloat32(byteOffset, isLittleEndian); } else if (numOfBytes == 8) { res = geoTiffData.getFloat64(byteOffset, isLittleEndian); } else { Logger.log(Logger.LEVEL_WARNING, "Do not attempt to parse the data not handled: " + numOfBytes); } break; case TiffConstants.SampleFormat.UNDEFINED: default: res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, false); break; } return res; }
javascript
function (geoTiffData, byteOffset, numOfBytes, sampleFormat, isLittleEndian) { var res; switch (sampleFormat) { case TiffConstants.SampleFormat.UNSIGNED: res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, false); break; case TiffConstants.SampleFormat.SIGNED: res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, true); break; case TiffConstants.SampleFormat.IEEE_FLOAT: if (numOfBytes == 3) { res = geoTiffData.getFloat32(byteOffset, isLittleEndian) >>> 8; } else if (numOfBytes == 4) { res = geoTiffData.getFloat32(byteOffset, isLittleEndian); } else if (numOfBytes == 8) { res = geoTiffData.getFloat64(byteOffset, isLittleEndian); } else { Logger.log(Logger.LEVEL_WARNING, "Do not attempt to parse the data not handled: " + numOfBytes); } break; case TiffConstants.SampleFormat.UNDEFINED: default: res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, false); break; } return res; }
[ "function", "(", "geoTiffData", ",", "byteOffset", ",", "numOfBytes", ",", "sampleFormat", ",", "isLittleEndian", ")", "{", "var", "res", ";", "switch", "(", "sampleFormat", ")", "{", "case", "TiffConstants", ".", "SampleFormat", ".", "UNSIGNED", ":", "res", "=", "this", ".", "getBytes", "(", "geoTiffData", ",", "byteOffset", ",", "numOfBytes", ",", "isLittleEndian", ",", "false", ")", ";", "break", ";", "case", "TiffConstants", ".", "SampleFormat", ".", "SIGNED", ":", "res", "=", "this", ".", "getBytes", "(", "geoTiffData", ",", "byteOffset", ",", "numOfBytes", ",", "isLittleEndian", ",", "true", ")", ";", "break", ";", "case", "TiffConstants", ".", "SampleFormat", ".", "IEEE_FLOAT", ":", "if", "(", "numOfBytes", "==", "3", ")", "{", "res", "=", "geoTiffData", ".", "getFloat32", "(", "byteOffset", ",", "isLittleEndian", ")", ">>>", "8", ";", "}", "else", "if", "(", "numOfBytes", "==", "4", ")", "{", "res", "=", "geoTiffData", ".", "getFloat32", "(", "byteOffset", ",", "isLittleEndian", ")", ";", "}", "else", "if", "(", "numOfBytes", "==", "8", ")", "{", "res", "=", "geoTiffData", ".", "getFloat64", "(", "byteOffset", ",", "isLittleEndian", ")", ";", "}", "else", "{", "Logger", ".", "log", "(", "Logger", ".", "LEVEL_WARNING", ",", "\"Do not attempt to parse the data not handled: \"", "+", "numOfBytes", ")", ";", "}", "break", ";", "case", "TiffConstants", ".", "SampleFormat", ".", "UNDEFINED", ":", "default", ":", "res", "=", "this", ".", "getBytes", "(", "geoTiffData", ",", "byteOffset", ",", "numOfBytes", ",", "isLittleEndian", ",", "false", ")", ";", "break", ";", "}", "return", "res", ";", "}" ]
Get sample value from an arraybuffer depending on the sample format. Internal use only.
[ "Get", "sample", "value", "from", "an", "arraybuffer", "depending", "on", "the", "sample", "format", ".", "Internal", "use", "only", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/geotiff/GeoTiffUtil.js#L74-L104
10,501
NASAWorldWind/WebWorldWind
src/formats/geotiff/GeoTiffUtil.js
function (colorSample, bitsPerSample) { var multiplier = Math.pow(2, 8 - bitsPerSample); return Math.floor((colorSample * multiplier) + (multiplier - 1)); }
javascript
function (colorSample, bitsPerSample) { var multiplier = Math.pow(2, 8 - bitsPerSample); return Math.floor((colorSample * multiplier) + (multiplier - 1)); }
[ "function", "(", "colorSample", ",", "bitsPerSample", ")", "{", "var", "multiplier", "=", "Math", ".", "pow", "(", "2", ",", "8", "-", "bitsPerSample", ")", ";", "return", "Math", ".", "floor", "(", "(", "colorSample", "*", "multiplier", ")", "+", "(", "multiplier", "-", "1", ")", ")", ";", "}" ]
Clamp color sample from color sample value and number of bits per sample. Internal use only.
[ "Clamp", "color", "sample", "from", "color", "sample", "value", "and", "number", "of", "bits", "per", "sample", ".", "Internal", "use", "only", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/geotiff/GeoTiffUtil.js#L115-L118
10,502
NASAWorldWind/WebWorldWind
src/gesture/PinchRecognizer.js
function (target, callback) { GestureRecognizer.call(this, target, callback); // Intentionally not documented. this._scale = 1; // Intentionally not documented. this._offsetScale = 1; // Intentionally not documented. this.referenceDistance = 0; // Intentionally not documented. this.interpretThreshold = 20; // Intentionally not documented. this.weight = 0.4; // Intentionally not documented. this.pinchTouches = []; }
javascript
function (target, callback) { GestureRecognizer.call(this, target, callback); // Intentionally not documented. this._scale = 1; // Intentionally not documented. this._offsetScale = 1; // Intentionally not documented. this.referenceDistance = 0; // Intentionally not documented. this.interpretThreshold = 20; // Intentionally not documented. this.weight = 0.4; // Intentionally not documented. this.pinchTouches = []; }
[ "function", "(", "target", ",", "callback", ")", "{", "GestureRecognizer", ".", "call", "(", "this", ",", "target", ",", "callback", ")", ";", "// Intentionally not documented.", "this", ".", "_scale", "=", "1", ";", "// Intentionally not documented.", "this", ".", "_offsetScale", "=", "1", ";", "// Intentionally not documented.", "this", ".", "referenceDistance", "=", "0", ";", "// Intentionally not documented.", "this", ".", "interpretThreshold", "=", "20", ";", "// Intentionally not documented.", "this", ".", "weight", "=", "0.4", ";", "// Intentionally not documented.", "this", ".", "pinchTouches", "=", "[", "]", ";", "}" ]
Constructs a pinch gesture recognizer. @alias PinchRecognizer @constructor @augments GestureRecognizer @classdesc A concrete gesture recognizer subclass that looks for two finger pinch gestures. @param {EventTarget} target The document element this gesture recognizer observes for mouse and touch events. @param {Function} callback An optional function to call when this gesture is recognized. If non-null, the function is called when this gesture is recognized, and is passed a single argument: this gesture recognizer, e.g., <code>gestureCallback(recognizer)</code>. @throws {ArgumentError} If the specified target is null or undefined.
[ "Constructs", "a", "pinch", "gesture", "recognizer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/gesture/PinchRecognizer.js#L36-L56
10,503
NASAWorldWind/WebWorldWind
performance/VeryManyPolygons.js
function (o) { // The input argument is either an Event or a TapRecognizer. Both have the same properties for determining // the mouse or tap location. var x = o.clientX, y = o.clientY; var redrawRequired = highlightedItems.length > 0; // must redraw if we de-highlight previously picked items // De-highlight any previously highlighted placemarks. for (var h = 0; h < highlightedItems.length; h++) { highlightedItems[h].highlighted = false; } highlightedItems = []; // Perform the pick. Must first convert from window coordinates to canvas coordinates, which are // relative to the upper left corner of the canvas rather than the upper left corner of the page. var pickList = wwd.pick(wwd.canvasCoordinates(x, y)); //console.log(wwd.frameStatistics.frameTime); if (pickList.objects.length > 0) { redrawRequired = true; } // Highlight the items picked by simply setting their highlight flag to true. if (pickList.objects.length > 0) { for (var p = 0; p < pickList.objects.length; p++) { pickList.objects[p].userObject.highlighted = true; // Keep track of highlighted items in order to de-highlight them later. highlightedItems.push(pickList.objects[p].userObject); } } // Update the window if we changed anything. if (redrawRequired) { wwd.redraw(); // redraw to make the highlighting changes take effect on the screen } }
javascript
function (o) { // The input argument is either an Event or a TapRecognizer. Both have the same properties for determining // the mouse or tap location. var x = o.clientX, y = o.clientY; var redrawRequired = highlightedItems.length > 0; // must redraw if we de-highlight previously picked items // De-highlight any previously highlighted placemarks. for (var h = 0; h < highlightedItems.length; h++) { highlightedItems[h].highlighted = false; } highlightedItems = []; // Perform the pick. Must first convert from window coordinates to canvas coordinates, which are // relative to the upper left corner of the canvas rather than the upper left corner of the page. var pickList = wwd.pick(wwd.canvasCoordinates(x, y)); //console.log(wwd.frameStatistics.frameTime); if (pickList.objects.length > 0) { redrawRequired = true; } // Highlight the items picked by simply setting their highlight flag to true. if (pickList.objects.length > 0) { for (var p = 0; p < pickList.objects.length; p++) { pickList.objects[p].userObject.highlighted = true; // Keep track of highlighted items in order to de-highlight them later. highlightedItems.push(pickList.objects[p].userObject); } } // Update the window if we changed anything. if (redrawRequired) { wwd.redraw(); // redraw to make the highlighting changes take effect on the screen } }
[ "function", "(", "o", ")", "{", "// The input argument is either an Event or a TapRecognizer. Both have the same properties for determining", "// the mouse or tap location.", "var", "x", "=", "o", ".", "clientX", ",", "y", "=", "o", ".", "clientY", ";", "var", "redrawRequired", "=", "highlightedItems", ".", "length", ">", "0", ";", "// must redraw if we de-highlight previously picked items", "// De-highlight any previously highlighted placemarks.", "for", "(", "var", "h", "=", "0", ";", "h", "<", "highlightedItems", ".", "length", ";", "h", "++", ")", "{", "highlightedItems", "[", "h", "]", ".", "highlighted", "=", "false", ";", "}", "highlightedItems", "=", "[", "]", ";", "// Perform the pick. Must first convert from window coordinates to canvas coordinates, which are", "// relative to the upper left corner of the canvas rather than the upper left corner of the page.", "var", "pickList", "=", "wwd", ".", "pick", "(", "wwd", ".", "canvasCoordinates", "(", "x", ",", "y", ")", ")", ";", "//console.log(wwd.frameStatistics.frameTime);", "if", "(", "pickList", ".", "objects", ".", "length", ">", "0", ")", "{", "redrawRequired", "=", "true", ";", "}", "// Highlight the items picked by simply setting their highlight flag to true.", "if", "(", "pickList", ".", "objects", ".", "length", ">", "0", ")", "{", "for", "(", "var", "p", "=", "0", ";", "p", "<", "pickList", ".", "objects", ".", "length", ";", "p", "++", ")", "{", "pickList", ".", "objects", "[", "p", "]", ".", "userObject", ".", "highlighted", "=", "true", ";", "// Keep track of highlighted items in order to de-highlight them later.", "highlightedItems", ".", "push", "(", "pickList", ".", "objects", "[", "p", "]", ".", "userObject", ")", ";", "}", "}", "// Update the window if we changed anything.", "if", "(", "redrawRequired", ")", "{", "wwd", ".", "redraw", "(", ")", ";", "// redraw to make the highlighting changes take effect on the screen", "}", "}" ]
The pick-handling callback function.
[ "The", "pick", "-", "handling", "callback", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/performance/VeryManyPolygons.js#L104-L140
10,504
NASAWorldWind/WebWorldWind
src/geom/Frustum.js
function (left, right, bottom, top, near, far) { if (!left || !right || !bottom || !top || !near || !far) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Frustum", "constructor", "missingPlane")); } // Internal. Intentionally not documented. See property accessors below for public interface. this._left = left; this._right = right; this._bottom = bottom; this._top = top; this._near = near; this._far = far; // Internal. Intentionally not documented. this._planes = [this._left, this._right, this._top, this._bottom, this._near, this._far]; }
javascript
function (left, right, bottom, top, near, far) { if (!left || !right || !bottom || !top || !near || !far) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Frustum", "constructor", "missingPlane")); } // Internal. Intentionally not documented. See property accessors below for public interface. this._left = left; this._right = right; this._bottom = bottom; this._top = top; this._near = near; this._far = far; // Internal. Intentionally not documented. this._planes = [this._left, this._right, this._top, this._bottom, this._near, this._far]; }
[ "function", "(", "left", ",", "right", ",", "bottom", ",", "top", ",", "near", ",", "far", ")", "{", "if", "(", "!", "left", "||", "!", "right", "||", "!", "bottom", "||", "!", "top", "||", "!", "near", "||", "!", "far", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Frustum\"", ",", "\"constructor\"", ",", "\"missingPlane\"", ")", ")", ";", "}", "// Internal. Intentionally not documented. See property accessors below for public interface.", "this", ".", "_left", "=", "left", ";", "this", ".", "_right", "=", "right", ";", "this", ".", "_bottom", "=", "bottom", ";", "this", ".", "_top", "=", "top", ";", "this", ".", "_near", "=", "near", ";", "this", ".", "_far", "=", "far", ";", "// Internal. Intentionally not documented.", "this", ".", "_planes", "=", "[", "this", ".", "_left", ",", "this", ".", "_right", ",", "this", ".", "_top", ",", "this", ".", "_bottom", ",", "this", ".", "_near", ",", "this", ".", "_far", "]", ";", "}" ]
Constructs a frustum. @alias Frustum @constructor @classdesc Represents a six-sided view frustum in Cartesian coordinates. @param {Plane} left The frustum's left plane. @param {Plane} right The frustum's right plane. @param {Plane} bottom The frustum's bottom plane. @param {Plane} top The frustum's top plane. @param {Plane} near The frustum's near plane. @param {Plane} far The frustum's far plane. @throws {ArgumentError} If any specified plane is null or undefined.
[ "Constructs", "a", "frustum", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/geom/Frustum.js#L45-L61
10,505
NASAWorldWind/WebWorldWind
src/gesture/Touch.js
function (identifier, clientX, clientY) { /** * A number uniquely identifying this touch point. * @type {Number} * @readonly */ this.identifier = identifier; // Intentionally not documented. this._clientX = clientX; // Intentionally not documented. this._clientY = clientY; // Intentionally not documented. this._clientStartX = clientX; // Intentionally not documented. this._clientStartY = clientY; }
javascript
function (identifier, clientX, clientY) { /** * A number uniquely identifying this touch point. * @type {Number} * @readonly */ this.identifier = identifier; // Intentionally not documented. this._clientX = clientX; // Intentionally not documented. this._clientY = clientY; // Intentionally not documented. this._clientStartX = clientX; // Intentionally not documented. this._clientStartY = clientY; }
[ "function", "(", "identifier", ",", "clientX", ",", "clientY", ")", "{", "/**\n * A number uniquely identifying this touch point.\n * @type {Number}\n * @readonly\n */", "this", ".", "identifier", "=", "identifier", ";", "// Intentionally not documented.", "this", ".", "_clientX", "=", "clientX", ";", "// Intentionally not documented.", "this", ".", "_clientY", "=", "clientY", ";", "// Intentionally not documented.", "this", ".", "_clientStartX", "=", "clientX", ";", "// Intentionally not documented.", "this", ".", "_clientStartY", "=", "clientY", ";", "}" ]
Constructs a touch point. @alias Touch @constructor @classdesc Represents a touch point. @param {Color} identifier A number uniquely identifying the touch point @param {Number} clientX The X coordinate of the touch point's location. @param {Number} clientY The Y coordinate of the touch point's location.
[ "Constructs", "a", "touch", "point", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/gesture/Touch.js#L33-L53
10,506
NASAWorldWind/WebWorldWind
src/util/Insets.js
function (top, left, bottom, right) { if (arguments.length !== 4) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Insets", "constructor", "invalidArgumentCount")); } // These are all documented with their property accessors below. this._top = top; this._left = left; this._bottom = bottom; this._right = right; }
javascript
function (top, left, bottom, right) { if (arguments.length !== 4) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Insets", "constructor", "invalidArgumentCount")); } // These are all documented with their property accessors below. this._top = top; this._left = left; this._bottom = bottom; this._right = right; }
[ "function", "(", "top", ",", "left", ",", "bottom", ",", "right", ")", "{", "if", "(", "arguments", ".", "length", "!==", "4", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Insets\"", ",", "\"constructor\"", ",", "\"invalidArgumentCount\"", ")", ")", ";", "}", "// These are all documented with their property accessors below.", "this", ".", "_top", "=", "top", ";", "this", ".", "_left", "=", "left", ";", "this", ".", "_bottom", "=", "bottom", ";", "this", ".", "_right", "=", "right", ";", "}" ]
Constructs an Insets object that is a representation of the borders of a container. It specifies the space that a container must leave at each of its edges. @alias Insets @param {Number} top The inset from the top. @param {Number} left The inset from the left. @param {Number} bottom The inset from the bottom. @param {Number} right The inset from the right. @constructor
[ "Constructs", "an", "Insets", "object", "that", "is", "a", "representation", "of", "the", "borders", "of", "a", "container", ".", "It", "specifies", "the", "space", "that", "a", "container", "must", "leave", "at", "each", "of", "its", "edges", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/Insets.js#L34-L46
10,507
NASAWorldWind/WebWorldWind
src/ogc/ows/OwsServiceProvider.js
function (element) { if (!element) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "OwsServiceProvider", "constructor", "missingDomElement")); } var children = element.children || element.childNodes; for (var c = 0; c < children.length; c++) { var child = children[c]; if (child.localName === "ProviderName") { this.providerName = child.textContent; } else if (child.localName === "ProviderSite") { this.providerSiteUrl = child.getAttribute("xlink:href"); } else if (child.localName === "ServiceContact") { this.serviceContact = OwsServiceProvider.assembleServiceContact(child); } } }
javascript
function (element) { if (!element) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "OwsServiceProvider", "constructor", "missingDomElement")); } var children = element.children || element.childNodes; for (var c = 0; c < children.length; c++) { var child = children[c]; if (child.localName === "ProviderName") { this.providerName = child.textContent; } else if (child.localName === "ProviderSite") { this.providerSiteUrl = child.getAttribute("xlink:href"); } else if (child.localName === "ServiceContact") { this.serviceContact = OwsServiceProvider.assembleServiceContact(child); } } }
[ "function", "(", "element", ")", "{", "if", "(", "!", "element", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"OwsServiceProvider\"", ",", "\"constructor\"", ",", "\"missingDomElement\"", ")", ")", ";", "}", "var", "children", "=", "element", ".", "children", "||", "element", ".", "childNodes", ";", "for", "(", "var", "c", "=", "0", ";", "c", "<", "children", ".", "length", ";", "c", "++", ")", "{", "var", "child", "=", "children", "[", "c", "]", ";", "if", "(", "child", ".", "localName", "===", "\"ProviderName\"", ")", "{", "this", ".", "providerName", "=", "child", ".", "textContent", ";", "}", "else", "if", "(", "child", ".", "localName", "===", "\"ProviderSite\"", ")", "{", "this", ".", "providerSiteUrl", "=", "child", ".", "getAttribute", "(", "\"xlink:href\"", ")", ";", "}", "else", "if", "(", "child", ".", "localName", "===", "\"ServiceContact\"", ")", "{", "this", ".", "serviceContact", "=", "OwsServiceProvider", ".", "assembleServiceContact", "(", "child", ")", ";", "}", "}", "}" ]
Constructs an OWS Service Provider instance from an XML DOM. @alias OwsServiceProvider @constructor @classdesc Represents an OWS Service Provider section of an OGC capabilities document. This object holds as properties all the fields specified in the OWS Service Provider section. Fields can be accessed as properties named according to their document names converted to camel case. For example, "providerName". @param {Element} element An XML DOM element representing the OWS Service Provider section. @throws {ArgumentError} If the specified XML DOM element is null or undefined.
[ "Constructs", "an", "OWS", "Service", "Provider", "instance", "from", "an", "XML", "DOM", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/ogc/ows/OwsServiceProvider.js#L39-L57
10,508
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaLoader.js
function (position, config) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ColladaLoader", "constructor", "missingPosition")); } this.position = position; this.dirPath = '/'; this.init(config); }
javascript
function (position, config) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ColladaLoader", "constructor", "missingPosition")); } this.position = position; this.dirPath = '/'; this.init(config); }
[ "function", "(", "position", ",", "config", ")", "{", "if", "(", "!", "position", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"ColladaLoader\"", ",", "\"constructor\"", ",", "\"missingPosition\"", ")", ")", ";", "}", "this", ".", "position", "=", "position", ";", "this", ".", "dirPath", "=", "'/'", ";", "this", ".", "init", "(", "config", ")", ";", "}" ]
Constructs a ColladaLoader @alias ColladaLoader @constructor @classdesc Represents a Collada Loader. Fetches and parses a collada document and returns the necessary information to render the collada model. @param {Position} position The model's geographic position. @param {Object} config Configuration options for the loader. <ul> <li>dirPath - the path to the directory where the collada file is located</li> </ul>
[ "Constructs", "a", "ColladaLoader" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaLoader.js#L55-L67
10,509
NASAWorldWind/WebWorldWind
src/gesture/TapRecognizer.js
function (target, callback) { GestureRecognizer.call(this, target, callback); /** * * @type {Number} */ this.numberOfTaps = 1; /** * * @type {Number} */ this.numberOfTouches = 1; // Intentionally not documented. this.maxTouchMovement = 20; // Intentionally not documented. this.maxTapDuration = 500; // Intentionally not documented. this.maxTapInterval = 400; // Intentionally not documented. this.taps = []; // Intentionally not documented. this.timeout = null; }
javascript
function (target, callback) { GestureRecognizer.call(this, target, callback); /** * * @type {Number} */ this.numberOfTaps = 1; /** * * @type {Number} */ this.numberOfTouches = 1; // Intentionally not documented. this.maxTouchMovement = 20; // Intentionally not documented. this.maxTapDuration = 500; // Intentionally not documented. this.maxTapInterval = 400; // Intentionally not documented. this.taps = []; // Intentionally not documented. this.timeout = null; }
[ "function", "(", "target", ",", "callback", ")", "{", "GestureRecognizer", ".", "call", "(", "this", ",", "target", ",", "callback", ")", ";", "/**\n *\n * @type {Number}\n */", "this", ".", "numberOfTaps", "=", "1", ";", "/**\n *\n * @type {Number}\n */", "this", ".", "numberOfTouches", "=", "1", ";", "// Intentionally not documented.", "this", ".", "maxTouchMovement", "=", "20", ";", "// Intentionally not documented.", "this", ".", "maxTapDuration", "=", "500", ";", "// Intentionally not documented.", "this", ".", "maxTapInterval", "=", "400", ";", "// Intentionally not documented.", "this", ".", "taps", "=", "[", "]", ";", "// Intentionally not documented.", "this", ".", "timeout", "=", "null", ";", "}" ]
Constructs a tap gesture recognizer. @alias TapRecognizer @constructor @augments GestureRecognizer @classdesc A concrete gesture recognizer subclass that looks for single or multiple taps. @param {EventTarget} target The document element this gesture recognizer observes for mouse and touch events. @param {Function} callback An optional function to call when this gesture is recognized. If non-null, the function is called when this gesture is recognized, and is passed a single argument: this gesture recognizer, e.g., <code>gestureCallback(recognizer)</code>. @throws {ArgumentError} If the specified target is null or undefined.
[ "Constructs", "a", "tap", "gesture", "recognizer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/gesture/TapRecognizer.js#L36-L65
10,510
NASAWorldWind/WebWorldWind
src/globe/ElevationCoverage.js
function (resolution) { if (!resolution) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ElevationCoverage", "constructor", "missingResolution")); } /** * Indicates the last time this coverage changed, in milliseconds since midnight Jan 1, 1970. * @type {Number} * @readonly * @default Date.now() at construction */ this.timestamp = Date.now(); /** * Indicates this coverage's display name. * @type {String} * @default "Coverage" */ this.displayName = "Coverage"; /** * Indicates whether or not to use this coverage. * @type {Boolean} * @default true */ this._enabled = true; /** * The resolution of this coverage in degrees. * @type {Number} */ this.resolution = resolution; /** * The sector this coverage spans. * @type {Sector} * @readonly */ this.coverageSector = Sector.FULL_SPHERE; }
javascript
function (resolution) { if (!resolution) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ElevationCoverage", "constructor", "missingResolution")); } /** * Indicates the last time this coverage changed, in milliseconds since midnight Jan 1, 1970. * @type {Number} * @readonly * @default Date.now() at construction */ this.timestamp = Date.now(); /** * Indicates this coverage's display name. * @type {String} * @default "Coverage" */ this.displayName = "Coverage"; /** * Indicates whether or not to use this coverage. * @type {Boolean} * @default true */ this._enabled = true; /** * The resolution of this coverage in degrees. * @type {Number} */ this.resolution = resolution; /** * The sector this coverage spans. * @type {Sector} * @readonly */ this.coverageSector = Sector.FULL_SPHERE; }
[ "function", "(", "resolution", ")", "{", "if", "(", "!", "resolution", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"ElevationCoverage\"", ",", "\"constructor\"", ",", "\"missingResolution\"", ")", ")", ";", "}", "/**\n * Indicates the last time this coverage changed, in milliseconds since midnight Jan 1, 1970.\n * @type {Number}\n * @readonly\n * @default Date.now() at construction\n */", "this", ".", "timestamp", "=", "Date", ".", "now", "(", ")", ";", "/**\n * Indicates this coverage's display name.\n * @type {String}\n * @default \"Coverage\"\n */", "this", ".", "displayName", "=", "\"Coverage\"", ";", "/**\n * Indicates whether or not to use this coverage.\n * @type {Boolean}\n * @default true\n */", "this", ".", "_enabled", "=", "true", ";", "/**\n * The resolution of this coverage in degrees.\n * @type {Number}\n */", "this", ".", "resolution", "=", "resolution", ";", "/**\n * The sector this coverage spans.\n * @type {Sector}\n * @readonly\n */", "this", ".", "coverageSector", "=", "Sector", ".", "FULL_SPHERE", ";", "}" ]
Constructs an ElevationCoverage @alias ElevationCoverage @constructor @classdesc When used directly and not through a subclass, this class represents an elevation coverage whose elevations are zero at all locations. @param {Number} resolution The resolution of the coverage, in degrees. (To compute degrees from meters, divide the number of meters by the globe's radius to obtain radians and convert the result to degrees.) @throws {ArgumentError} If the resolution argument is null, undefined, or zero.
[ "Constructs", "an", "ElevationCoverage" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/globe/ElevationCoverage.js#L38-L79
10,511
NASAWorldWind/WebWorldWind
src/globe/UsgsNedElevationCoverage.js
function () { // CONUS Extent: (-124.848974, 24.396308) - (-66.885444, 49.384358) // TODO: Expand this extent to cover HI when the server NO_DATA value issue is resolved. TiledElevationCoverage.call(this, { coverageSector: new Sector(24.396308, 49.384358, -124.848974, -66.885444), resolution: 0.000092592592593, retrievalImageFormat: "application/bil16", minElevation: -11000, maxElevation: 8850, urlBuilder: new WmsUrlBuilder("https://worldwind26.arc.nasa.gov/elev", "USGS-NED", "", "1.3.0") }); this.displayName = "USGS NED Earth Elevation Coverage"; }
javascript
function () { // CONUS Extent: (-124.848974, 24.396308) - (-66.885444, 49.384358) // TODO: Expand this extent to cover HI when the server NO_DATA value issue is resolved. TiledElevationCoverage.call(this, { coverageSector: new Sector(24.396308, 49.384358, -124.848974, -66.885444), resolution: 0.000092592592593, retrievalImageFormat: "application/bil16", minElevation: -11000, maxElevation: 8850, urlBuilder: new WmsUrlBuilder("https://worldwind26.arc.nasa.gov/elev", "USGS-NED", "", "1.3.0") }); this.displayName = "USGS NED Earth Elevation Coverage"; }
[ "function", "(", ")", "{", "// CONUS Extent: (-124.848974, 24.396308) - (-66.885444, 49.384358)", "// TODO: Expand this extent to cover HI when the server NO_DATA value issue is resolved.", "TiledElevationCoverage", ".", "call", "(", "this", ",", "{", "coverageSector", ":", "new", "Sector", "(", "24.396308", ",", "49.384358", ",", "-", "124.848974", ",", "-", "66.885444", ")", ",", "resolution", ":", "0.000092592592593", ",", "retrievalImageFormat", ":", "\"application/bil16\"", ",", "minElevation", ":", "-", "11000", ",", "maxElevation", ":", "8850", ",", "urlBuilder", ":", "new", "WmsUrlBuilder", "(", "\"https://worldwind26.arc.nasa.gov/elev\"", ",", "\"USGS-NED\"", ",", "\"\"", ",", "\"1.3.0\"", ")", "}", ")", ";", "this", ".", "displayName", "=", "\"USGS NED Earth Elevation Coverage\"", ";", "}" ]
Constructs an Earth elevation coverage using USGS NED data. @alias UsgsNedElevationCoverage @constructor @augments TiledElevationCoverage @classdesc Provides elevations for Earth. Elevations are drawn from the NASA WorldWind elevation service.
[ "Constructs", "an", "Earth", "elevation", "coverage", "using", "USGS", "NED", "data", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/globe/UsgsNedElevationCoverage.js#L39-L52
10,512
NASAWorldWind/WebWorldWind
src/layer/TectonicPlatesLayer.js
function (shapeAttributes) { RenderableLayer.call(this, "Tectonic Plates"); if (shapeAttributes) { this._attributes = shapeAttributes; } else { this._attributes = new ShapeAttributes(null); this._attributes.drawInterior = false; this._attributes.drawOutline = true; this._attributes.outlineColor = Color.RED; } this.loadPlateData(); }
javascript
function (shapeAttributes) { RenderableLayer.call(this, "Tectonic Plates"); if (shapeAttributes) { this._attributes = shapeAttributes; } else { this._attributes = new ShapeAttributes(null); this._attributes.drawInterior = false; this._attributes.drawOutline = true; this._attributes.outlineColor = Color.RED; } this.loadPlateData(); }
[ "function", "(", "shapeAttributes", ")", "{", "RenderableLayer", ".", "call", "(", "this", ",", "\"Tectonic Plates\"", ")", ";", "if", "(", "shapeAttributes", ")", "{", "this", ".", "_attributes", "=", "shapeAttributes", ";", "}", "else", "{", "this", ".", "_attributes", "=", "new", "ShapeAttributes", "(", "null", ")", ";", "this", ".", "_attributes", ".", "drawInterior", "=", "false", ";", "this", ".", "_attributes", ".", "drawOutline", "=", "true", ";", "this", ".", "_attributes", ".", "outlineColor", "=", "Color", ".", "RED", ";", "}", "this", ".", "loadPlateData", "(", ")", ";", "}" ]
Constructs a layer showing the Earth's tectonic plates. @alias TectonicPlatesLayer @constructor @classdesc Provides a layer showing the Earth's tectonic plates. The plates are drawn as [SurfacePolygons]{@link SurfacePolygon}. @param {ShapeAttributes} shapeAttributes The attributes to use when drawing the plates. May be null or undefined, in which case the shapes are drawn using default attributes. The default attributes draw only the outlines of the plates, in a solid color. @augments RenderableLayer
[ "Constructs", "a", "layer", "showing", "the", "Earth", "s", "tectonic", "plates", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/TectonicPlatesLayer.js#L48-L61
10,513
NASAWorldWind/WebWorldWind
src/util/SunPosition.js
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "getAsGeographicLocation", "missingDate")); } var celestialLocation = this.getAsCelestialLocation(date); return this.celestialToGeographic(celestialLocation, date); }
javascript
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "getAsGeographicLocation", "missingDate")); } var celestialLocation = this.getAsCelestialLocation(date); return this.celestialToGeographic(celestialLocation, date); }
[ "function", "(", "date", ")", "{", "if", "(", "date", "instanceof", "Date", "===", "false", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"SunPosition\"", ",", "\"getAsGeographicLocation\"", ",", "\"missingDate\"", ")", ")", ";", "}", "var", "celestialLocation", "=", "this", ".", "getAsCelestialLocation", "(", "date", ")", ";", "return", "this", ".", "celestialToGeographic", "(", "celestialLocation", ",", "date", ")", ";", "}" ]
Computes the geographic location of the sun for a given date @param {Date} date @throws {ArgumentError} if the date is missing @return {{latitude: Number, longitude: Number}} the geographic location
[ "Computes", "the", "geographic", "location", "of", "the", "sun", "for", "a", "given", "date" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/SunPosition.js#L42-L51
10,514
NASAWorldWind/WebWorldWind
src/util/SunPosition.js
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "getAsCelestialLocation", "missingDate")); } var julianDate = this.computeJulianDate(date); //number of days (positive or negative) since Greenwich noon, Terrestrial Time, on 1 January 2000 (J2000.0) var numDays = julianDate - 2451545; var meanLongitude = WWMath.normalizeAngle360(280.460 + 0.9856474 * numDays); var meanAnomaly = WWMath.normalizeAngle360(357.528 + 0.9856003 * numDays) * Angle.DEGREES_TO_RADIANS; var eclipticLongitude = meanLongitude + 1.915 * Math.sin(meanAnomaly) + 0.02 * Math.sin(2 * meanAnomaly); var eclipticLongitudeRad = eclipticLongitude * Angle.DEGREES_TO_RADIANS; var obliquityOfTheEcliptic = (23.439 - 0.0000004 * numDays) * Angle.DEGREES_TO_RADIANS; var declination = Math.asin(Math.sin(obliquityOfTheEcliptic) * Math.sin(eclipticLongitudeRad)) * Angle.RADIANS_TO_DEGREES; var rightAscension = Math.atan(Math.cos(obliquityOfTheEcliptic) * Math.tan(eclipticLongitudeRad)) * Angle.RADIANS_TO_DEGREES; //compensate for atan result if (eclipticLongitude >= 90 && eclipticLongitude < 270) { rightAscension += 180; } rightAscension = WWMath.normalizeAngle360(rightAscension); return { declination: declination, rightAscension: rightAscension }; }
javascript
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "getAsCelestialLocation", "missingDate")); } var julianDate = this.computeJulianDate(date); //number of days (positive or negative) since Greenwich noon, Terrestrial Time, on 1 January 2000 (J2000.0) var numDays = julianDate - 2451545; var meanLongitude = WWMath.normalizeAngle360(280.460 + 0.9856474 * numDays); var meanAnomaly = WWMath.normalizeAngle360(357.528 + 0.9856003 * numDays) * Angle.DEGREES_TO_RADIANS; var eclipticLongitude = meanLongitude + 1.915 * Math.sin(meanAnomaly) + 0.02 * Math.sin(2 * meanAnomaly); var eclipticLongitudeRad = eclipticLongitude * Angle.DEGREES_TO_RADIANS; var obliquityOfTheEcliptic = (23.439 - 0.0000004 * numDays) * Angle.DEGREES_TO_RADIANS; var declination = Math.asin(Math.sin(obliquityOfTheEcliptic) * Math.sin(eclipticLongitudeRad)) * Angle.RADIANS_TO_DEGREES; var rightAscension = Math.atan(Math.cos(obliquityOfTheEcliptic) * Math.tan(eclipticLongitudeRad)) * Angle.RADIANS_TO_DEGREES; //compensate for atan result if (eclipticLongitude >= 90 && eclipticLongitude < 270) { rightAscension += 180; } rightAscension = WWMath.normalizeAngle360(rightAscension); return { declination: declination, rightAscension: rightAscension }; }
[ "function", "(", "date", ")", "{", "if", "(", "date", "instanceof", "Date", "===", "false", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"SunPosition\"", ",", "\"getAsCelestialLocation\"", ",", "\"missingDate\"", ")", ")", ";", "}", "var", "julianDate", "=", "this", ".", "computeJulianDate", "(", "date", ")", ";", "//number of days (positive or negative) since Greenwich noon, Terrestrial Time, on 1 January 2000 (J2000.0)", "var", "numDays", "=", "julianDate", "-", "2451545", ";", "var", "meanLongitude", "=", "WWMath", ".", "normalizeAngle360", "(", "280.460", "+", "0.9856474", "*", "numDays", ")", ";", "var", "meanAnomaly", "=", "WWMath", ".", "normalizeAngle360", "(", "357.528", "+", "0.9856003", "*", "numDays", ")", "*", "Angle", ".", "DEGREES_TO_RADIANS", ";", "var", "eclipticLongitude", "=", "meanLongitude", "+", "1.915", "*", "Math", ".", "sin", "(", "meanAnomaly", ")", "+", "0.02", "*", "Math", ".", "sin", "(", "2", "*", "meanAnomaly", ")", ";", "var", "eclipticLongitudeRad", "=", "eclipticLongitude", "*", "Angle", ".", "DEGREES_TO_RADIANS", ";", "var", "obliquityOfTheEcliptic", "=", "(", "23.439", "-", "0.0000004", "*", "numDays", ")", "*", "Angle", ".", "DEGREES_TO_RADIANS", ";", "var", "declination", "=", "Math", ".", "asin", "(", "Math", ".", "sin", "(", "obliquityOfTheEcliptic", ")", "*", "Math", ".", "sin", "(", "eclipticLongitudeRad", ")", ")", "*", "Angle", ".", "RADIANS_TO_DEGREES", ";", "var", "rightAscension", "=", "Math", ".", "atan", "(", "Math", ".", "cos", "(", "obliquityOfTheEcliptic", ")", "*", "Math", ".", "tan", "(", "eclipticLongitudeRad", ")", ")", "*", "Angle", ".", "RADIANS_TO_DEGREES", ";", "//compensate for atan result", "if", "(", "eclipticLongitude", ">=", "90", "&&", "eclipticLongitude", "<", "270", ")", "{", "rightAscension", "+=", "180", ";", "}", "rightAscension", "=", "WWMath", ".", "normalizeAngle360", "(", "rightAscension", ")", ";", "return", "{", "declination", ":", "declination", ",", "rightAscension", ":", "rightAscension", "}", ";", "}" ]
Computes the celestial location of the sun for a given julianDate @param {Date} date @throws {ArgumentError} if the date is missing @return {{declination: Number, rightAscension: Number}} the celestial location
[ "Computes", "the", "celestial", "location", "of", "the", "sun", "for", "a", "given", "julianDate" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/SunPosition.js#L59-L96
10,515
NASAWorldWind/WebWorldWind
src/util/SunPosition.js
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "computeJulianDate", "missingDate")); } var year = date.getUTCFullYear(); var month = date.getUTCMonth() + 1; var day = date.getUTCDate(); var hour = date.getUTCHours(); var minute = date.getUTCMinutes(); var second = date.getUTCSeconds(); var dayFraction = (hour + minute / 60 + second / 3600) / 24; if (month <= 2) { year -= 1; month += 12; } var A = Math.floor(year / 100); var B = 2 - A + Math.floor(A / 4); var JD0h = Math.floor(365.25 * (year + 4716)) + Math.floor(30.6001 * (month + 1)) + day + B - 1524.5; return JD0h + dayFraction; }
javascript
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "computeJulianDate", "missingDate")); } var year = date.getUTCFullYear(); var month = date.getUTCMonth() + 1; var day = date.getUTCDate(); var hour = date.getUTCHours(); var minute = date.getUTCMinutes(); var second = date.getUTCSeconds(); var dayFraction = (hour + minute / 60 + second / 3600) / 24; if (month <= 2) { year -= 1; month += 12; } var A = Math.floor(year / 100); var B = 2 - A + Math.floor(A / 4); var JD0h = Math.floor(365.25 * (year + 4716)) + Math.floor(30.6001 * (month + 1)) + day + B - 1524.5; return JD0h + dayFraction; }
[ "function", "(", "date", ")", "{", "if", "(", "date", "instanceof", "Date", "===", "false", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"SunPosition\"", ",", "\"computeJulianDate\"", ",", "\"missingDate\"", ")", ")", ";", "}", "var", "year", "=", "date", ".", "getUTCFullYear", "(", ")", ";", "var", "month", "=", "date", ".", "getUTCMonth", "(", ")", "+", "1", ";", "var", "day", "=", "date", ".", "getUTCDate", "(", ")", ";", "var", "hour", "=", "date", ".", "getUTCHours", "(", ")", ";", "var", "minute", "=", "date", ".", "getUTCMinutes", "(", ")", ";", "var", "second", "=", "date", ".", "getUTCSeconds", "(", ")", ";", "var", "dayFraction", "=", "(", "hour", "+", "minute", "/", "60", "+", "second", "/", "3600", ")", "/", "24", ";", "if", "(", "month", "<=", "2", ")", "{", "year", "-=", "1", ";", "month", "+=", "12", ";", "}", "var", "A", "=", "Math", ".", "floor", "(", "year", "/", "100", ")", ";", "var", "B", "=", "2", "-", "A", "+", "Math", ".", "floor", "(", "A", "/", "4", ")", ";", "var", "JD0h", "=", "Math", ".", "floor", "(", "365.25", "*", "(", "year", "+", "4716", ")", ")", "+", "Math", ".", "floor", "(", "30.6001", "*", "(", "month", "+", "1", ")", ")", "+", "day", "+", "B", "-", "1524.5", ";", "return", "JD0h", "+", "dayFraction", ";", "}" ]
Computes the julian date from a javascript date object @param {Date} date @throws {ArgumentError} if the date is missing @return {Number} the julian date
[ "Computes", "the", "julian", "date", "from", "a", "javascript", "date", "object" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/SunPosition.js#L142-L167
10,516
NASAWorldWind/WebWorldWind
apps/util/TimeSeriesPlayer.js
function (worldWindow) { var self = this; this.createPlayer(); // Intentionally not documented. this.slider = $("#timeSeriesSlider"); this.sliderThumb = $(this.slider.children('.ui-slider-handle')); this.timeDisplay = $("#timeSeriesDisplay");// $('<span style="position: absolute; width: 50px">Sat Aug 14, 2015</span>'); /** * The WorldWindow associated with this player, as specified to the constructor. * @type {WorldWindow} * @readonly */ this.wwd = worldWindow; /** * The time in milliseconds to display each frame of the time sequence. * @type {Number} * @default 1000 milliseconds */ this.frameTime = 1000; /** * The time sequence this player controls. * @type {PeriodicTimeSequence} * @default null */ this.timeSequence = null; /** * The layer this player controls. * @type {Layer} * @default null */ this.layer = null; //this.timeSequence = new WorldWind.PeriodicTimeSequence("2000-01-01/2001-12-01/P1M"); $("#timeSeriesBackward").on("click", function (event) { self.onStepBackwardButton(event); }); $("#timeSeriesForward").on("click", function (event) { self.onStepForwardButton(event); }); $("#timeSeriesPlay").on("click", function (event) { self.onPlayButton(event); }); $("#timeSeriesRepeat").on("click", function (event) { self.onRepeatButton(event); }); this.slider.on("slide", function (event, ui) { self.onSlide(event, ui); }); this.slider.on("slidechange", function (event, ui) { self.onSliderChange(event, ui); }); }
javascript
function (worldWindow) { var self = this; this.createPlayer(); // Intentionally not documented. this.slider = $("#timeSeriesSlider"); this.sliderThumb = $(this.slider.children('.ui-slider-handle')); this.timeDisplay = $("#timeSeriesDisplay");// $('<span style="position: absolute; width: 50px">Sat Aug 14, 2015</span>'); /** * The WorldWindow associated with this player, as specified to the constructor. * @type {WorldWindow} * @readonly */ this.wwd = worldWindow; /** * The time in milliseconds to display each frame of the time sequence. * @type {Number} * @default 1000 milliseconds */ this.frameTime = 1000; /** * The time sequence this player controls. * @type {PeriodicTimeSequence} * @default null */ this.timeSequence = null; /** * The layer this player controls. * @type {Layer} * @default null */ this.layer = null; //this.timeSequence = new WorldWind.PeriodicTimeSequence("2000-01-01/2001-12-01/P1M"); $("#timeSeriesBackward").on("click", function (event) { self.onStepBackwardButton(event); }); $("#timeSeriesForward").on("click", function (event) { self.onStepForwardButton(event); }); $("#timeSeriesPlay").on("click", function (event) { self.onPlayButton(event); }); $("#timeSeriesRepeat").on("click", function (event) { self.onRepeatButton(event); }); this.slider.on("slide", function (event, ui) { self.onSlide(event, ui); }); this.slider.on("slidechange", function (event, ui) { self.onSliderChange(event, ui); }); }
[ "function", "(", "worldWindow", ")", "{", "var", "self", "=", "this", ";", "this", ".", "createPlayer", "(", ")", ";", "// Intentionally not documented.", "this", ".", "slider", "=", "$", "(", "\"#timeSeriesSlider\"", ")", ";", "this", ".", "sliderThumb", "=", "$", "(", "this", ".", "slider", ".", "children", "(", "'.ui-slider-handle'", ")", ")", ";", "this", ".", "timeDisplay", "=", "$", "(", "\"#timeSeriesDisplay\"", ")", ";", "// $('<span style=\"position: absolute; width: 50px\">Sat Aug 14, 2015</span>');", "/**\n * The WorldWindow associated with this player, as specified to the constructor.\n * @type {WorldWindow}\n * @readonly\n */", "this", ".", "wwd", "=", "worldWindow", ";", "/**\n * The time in milliseconds to display each frame of the time sequence.\n * @type {Number}\n * @default 1000 milliseconds\n */", "this", ".", "frameTime", "=", "1000", ";", "/**\n * The time sequence this player controls.\n * @type {PeriodicTimeSequence}\n * @default null\n */", "this", ".", "timeSequence", "=", "null", ";", "/**\n * The layer this player controls.\n * @type {Layer}\n * @default null\n */", "this", ".", "layer", "=", "null", ";", "//this.timeSequence = new WorldWind.PeriodicTimeSequence(\"2000-01-01/2001-12-01/P1M\");", "$", "(", "\"#timeSeriesBackward\"", ")", ".", "on", "(", "\"click\"", ",", "function", "(", "event", ")", "{", "self", ".", "onStepBackwardButton", "(", "event", ")", ";", "}", ")", ";", "$", "(", "\"#timeSeriesForward\"", ")", ".", "on", "(", "\"click\"", ",", "function", "(", "event", ")", "{", "self", ".", "onStepForwardButton", "(", "event", ")", ";", "}", ")", ";", "$", "(", "\"#timeSeriesPlay\"", ")", ".", "on", "(", "\"click\"", ",", "function", "(", "event", ")", "{", "self", ".", "onPlayButton", "(", "event", ")", ";", "}", ")", ";", "$", "(", "\"#timeSeriesRepeat\"", ")", ".", "on", "(", "\"click\"", ",", "function", "(", "event", ")", "{", "self", ".", "onRepeatButton", "(", "event", ")", ";", "}", ")", ";", "this", ".", "slider", ".", "on", "(", "\"slide\"", ",", "function", "(", "event", ",", "ui", ")", "{", "self", ".", "onSlide", "(", "event", ",", "ui", ")", ";", "}", ")", ";", "this", ".", "slider", ".", "on", "(", "\"slidechange\"", ",", "function", "(", "event", ",", "ui", ")", "{", "self", ".", "onSliderChange", "(", "event", ",", "ui", ")", ";", "}", ")", ";", "}" ]
Constructs a TimeSeriesPlayer. A time sequence and layer must be specified after construction. @alias TimeSeriesPlayer @constructor @classdesc Provides a control for time-series layers. @param {WorldWindow} worldWindow The WorldWindow to associate this player.
[ "Constructs", "a", "TimeSeriesPlayer", ".", "A", "time", "sequence", "and", "layer", "must", "be", "specified", "after", "construction", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/apps/util/TimeSeriesPlayer.js#L30-L93
10,517
NASAWorldWind/WebWorldWind
src/formats/kml/KmlObject.js
function (options) { Renderable.call(this); options = options || {}; if (!options.objectNode) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "KmlObject", "constructor", "Passed node isn't defined.") ); } this._node = options.objectNode; this._cache = {}; this._controls = options.controls || []; // It should be possible to keep the context here? this._factory = new KmlElementsFactoryCached({controls: this._controls}); this.hook(this._controls, options); }
javascript
function (options) { Renderable.call(this); options = options || {}; if (!options.objectNode) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "KmlObject", "constructor", "Passed node isn't defined.") ); } this._node = options.objectNode; this._cache = {}; this._controls = options.controls || []; // It should be possible to keep the context here? this._factory = new KmlElementsFactoryCached({controls: this._controls}); this.hook(this._controls, options); }
[ "function", "(", "options", ")", "{", "Renderable", ".", "call", "(", "this", ")", ";", "options", "=", "options", "||", "{", "}", ";", "if", "(", "!", "options", ".", "objectNode", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"KmlObject\"", ",", "\"constructor\"", ",", "\"Passed node isn't defined.\"", ")", ")", ";", "}", "this", ".", "_node", "=", "options", ".", "objectNode", ";", "this", ".", "_cache", "=", "{", "}", ";", "this", ".", "_controls", "=", "options", ".", "controls", "||", "[", "]", ";", "// It should be possible to keep the context here?", "this", ".", "_factory", "=", "new", "KmlElementsFactoryCached", "(", "{", "controls", ":", "this", ".", "_controls", "}", ")", ";", "this", ".", "hook", "(", "this", ".", "_controls", ",", "options", ")", ";", "}" ]
Constructs an Kml object. Every node in the Kml document is either basic type or Kml object. Applications usually don't call this constructor. It is usually called only by its descendants. It should be treated as mixin. @alias KmlObject @classdesc Contains the data associated with every Kml object. @param options {Object} @param options.objectNode {Node} Node representing Kml Object @param options.controls {KmlControls[]} Controls associated with current Node @constructor @throws {ArgumentError} If either node is null or id isn't present on the object. @augments Renderable @see https://developers.google.com/kml/documentation/kmlreference#object
[ "Constructs", "an", "Kml", "object", ".", "Every", "node", "in", "the", "Kml", "document", "is", "either", "basic", "type", "or", "Kml", "object", ".", "Applications", "usually", "don", "t", "call", "this", "constructor", ".", "It", "is", "usually", "called", "only", "by", "its", "descendants", ".", "It", "should", "be", "treated", "as", "mixin", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/kml/KmlObject.js#L51-L68
10,518
NASAWorldWind/WebWorldWind
src/layer/StarFieldLayer.js
function (starDataSource) { Layer.call(this, 'StarField'); // The StarField Layer is not pickable. this.pickEnabled = false; /** * The size of the Sun in pixels. * This can not exceed the maximum allowed pointSize of the GPU. * A warning will be given if the size is too big and the allowed max size will be used. * @type {Number} * @default 128 */ this.sunSize = 128; /** * Indicates weather to show or hide the Sun * @type {Boolean} * @default true */ this.showSun = true; //Documented in defineProperties below. this._starDataSource = starDataSource || WorldWind.configuration.baseUrl + 'images/stars.json'; this._sunImageSource = WorldWind.configuration.baseUrl + 'images/sunTexture.png'; //Internal use only. //The MVP matrix of this layer. this._matrix = Matrix.fromIdentity(); //Internal use only. //gpu cache key for the stars vbo. this._starsPositionsVboCacheKey = null; //Internal use only. this._numStars = 0; //Internal use only. this._starData = null; //Internal use only. this._minMagnitude = Number.MAX_VALUE; this._maxMagnitude = Number.MIN_VALUE; //Internal use only. //A flag to indicate the star data is currently being retrieved. this._loadStarted = false; //Internal use only. this._minScale = 10e6; //Internal use only. this._sunPositionsCacheKey = ''; this._sunBufferView = new Float32Array(4); //Internal use only. this._MAX_GL_POINT_SIZE = 0; }
javascript
function (starDataSource) { Layer.call(this, 'StarField'); // The StarField Layer is not pickable. this.pickEnabled = false; /** * The size of the Sun in pixels. * This can not exceed the maximum allowed pointSize of the GPU. * A warning will be given if the size is too big and the allowed max size will be used. * @type {Number} * @default 128 */ this.sunSize = 128; /** * Indicates weather to show or hide the Sun * @type {Boolean} * @default true */ this.showSun = true; //Documented in defineProperties below. this._starDataSource = starDataSource || WorldWind.configuration.baseUrl + 'images/stars.json'; this._sunImageSource = WorldWind.configuration.baseUrl + 'images/sunTexture.png'; //Internal use only. //The MVP matrix of this layer. this._matrix = Matrix.fromIdentity(); //Internal use only. //gpu cache key for the stars vbo. this._starsPositionsVboCacheKey = null; //Internal use only. this._numStars = 0; //Internal use only. this._starData = null; //Internal use only. this._minMagnitude = Number.MAX_VALUE; this._maxMagnitude = Number.MIN_VALUE; //Internal use only. //A flag to indicate the star data is currently being retrieved. this._loadStarted = false; //Internal use only. this._minScale = 10e6; //Internal use only. this._sunPositionsCacheKey = ''; this._sunBufferView = new Float32Array(4); //Internal use only. this._MAX_GL_POINT_SIZE = 0; }
[ "function", "(", "starDataSource", ")", "{", "Layer", ".", "call", "(", "this", ",", "'StarField'", ")", ";", "// The StarField Layer is not pickable.", "this", ".", "pickEnabled", "=", "false", ";", "/**\n * The size of the Sun in pixels.\n * This can not exceed the maximum allowed pointSize of the GPU.\n * A warning will be given if the size is too big and the allowed max size will be used.\n * @type {Number}\n * @default 128\n */", "this", ".", "sunSize", "=", "128", ";", "/**\n * Indicates weather to show or hide the Sun\n * @type {Boolean}\n * @default true\n */", "this", ".", "showSun", "=", "true", ";", "//Documented in defineProperties below.", "this", ".", "_starDataSource", "=", "starDataSource", "||", "WorldWind", ".", "configuration", ".", "baseUrl", "+", "'images/stars.json'", ";", "this", ".", "_sunImageSource", "=", "WorldWind", ".", "configuration", ".", "baseUrl", "+", "'images/sunTexture.png'", ";", "//Internal use only.", "//The MVP matrix of this layer.", "this", ".", "_matrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ";", "//Internal use only.", "//gpu cache key for the stars vbo.", "this", ".", "_starsPositionsVboCacheKey", "=", "null", ";", "//Internal use only.", "this", ".", "_numStars", "=", "0", ";", "//Internal use only.", "this", ".", "_starData", "=", "null", ";", "//Internal use only.", "this", ".", "_minMagnitude", "=", "Number", ".", "MAX_VALUE", ";", "this", ".", "_maxMagnitude", "=", "Number", ".", "MIN_VALUE", ";", "//Internal use only.", "//A flag to indicate the star data is currently being retrieved.", "this", ".", "_loadStarted", "=", "false", ";", "//Internal use only.", "this", ".", "_minScale", "=", "10e6", ";", "//Internal use only.", "this", ".", "_sunPositionsCacheKey", "=", "''", ";", "this", ".", "_sunBufferView", "=", "new", "Float32Array", "(", "4", ")", ";", "//Internal use only.", "this", ".", "_MAX_GL_POINT_SIZE", "=", "0", ";", "}" ]
Constructs a layer showing stars and the Sun around the Earth. If used together with the AtmosphereLayer, the StarFieldLayer must be inserted before the AtmosphereLayer. If you want to use your own star data, the file provided must be .json and the fields 'ra', 'dec' and 'vmag' must be present in the metadata. ra and dec must be expressed in degrees. This layer uses J2000.0 as the ref epoch. If the star data .json file is too big, consider enabling gzip compression on your web server. For more info about enabling gzip compression consult the configuration for your web server. @alias StarFieldLayer @constructor @classdesc Provides a layer showing stars, and the Sun around the Earth @param {URL} starDataSource optional url for the stars data @augments Layer
[ "Constructs", "a", "layer", "showing", "stars", "and", "the", "Sun", "around", "the", "Earth", ".", "If", "used", "together", "with", "the", "AtmosphereLayer", "the", "StarFieldLayer", "must", "be", "inserted", "before", "the", "AtmosphereLayer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/StarFieldLayer.js#L53-L110
10,519
NASAWorldWind/WebWorldWind
examples/WMTS.js
function (xmlDom) { // Create a WmtsCapabilities object from the XML DOM var wmtsCapabilities = new WorldWind.WmtsCapabilities(xmlDom); // Retrieve a WmtsLayerCapabilities object by the desired layer name var wmtsLayerCapabilities = wmtsCapabilities.getLayer(layerIdentifier); // Form a configuration object from the WmtsLayerCapabilities object var wmtsConfig = WorldWind.WmtsLayer.formLayerConfiguration(wmtsLayerCapabilities); // Create the WMTS Layer from the configuration object var wmtsLayer = new WorldWind.WmtsLayer(wmtsConfig); // Add the layers to WorldWind and update the layer manager wwd.addLayer(wmtsLayer); layerManager.synchronizeLayerList(); }
javascript
function (xmlDom) { // Create a WmtsCapabilities object from the XML DOM var wmtsCapabilities = new WorldWind.WmtsCapabilities(xmlDom); // Retrieve a WmtsLayerCapabilities object by the desired layer name var wmtsLayerCapabilities = wmtsCapabilities.getLayer(layerIdentifier); // Form a configuration object from the WmtsLayerCapabilities object var wmtsConfig = WorldWind.WmtsLayer.formLayerConfiguration(wmtsLayerCapabilities); // Create the WMTS Layer from the configuration object var wmtsLayer = new WorldWind.WmtsLayer(wmtsConfig); // Add the layers to WorldWind and update the layer manager wwd.addLayer(wmtsLayer); layerManager.synchronizeLayerList(); }
[ "function", "(", "xmlDom", ")", "{", "// Create a WmtsCapabilities object from the XML DOM", "var", "wmtsCapabilities", "=", "new", "WorldWind", ".", "WmtsCapabilities", "(", "xmlDom", ")", ";", "// Retrieve a WmtsLayerCapabilities object by the desired layer name", "var", "wmtsLayerCapabilities", "=", "wmtsCapabilities", ".", "getLayer", "(", "layerIdentifier", ")", ";", "// Form a configuration object from the WmtsLayerCapabilities object", "var", "wmtsConfig", "=", "WorldWind", ".", "WmtsLayer", ".", "formLayerConfiguration", "(", "wmtsLayerCapabilities", ")", ";", "// Create the WMTS Layer from the configuration object", "var", "wmtsLayer", "=", "new", "WorldWind", ".", "WmtsLayer", "(", "wmtsConfig", ")", ";", "// Add the layers to WorldWind and update the layer manager", "wwd", ".", "addLayer", "(", "wmtsLayer", ")", ";", "layerManager", ".", "synchronizeLayerList", "(", ")", ";", "}" ]
Called asynchronously to parse and create the WMTS layer
[ "Called", "asynchronously", "to", "parse", "and", "create", "the", "WMTS", "layer" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/WMTS.js#L61-L74
10,520
NASAWorldWind/WebWorldWind
src/ogc/wmts/WmtsLayerCapabilities.js
function (layerElement, capabilities) { if (!layerElement) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmtsLayerCapabilities", "constructor", "missingDomElement")); } OwsDescription.call(this, layerElement); /** * This layer's WMTS capabilities document, as specified to the constructor of this object. * @type {{}} * @readonly */ this.capabilities = capabilities; /** * The identifier of this layer description. * @type {String} * @readonly */ this.identifier; /** * The titles of this layer. * @type {String[]} * @readonly */ this.title; /** * The abstracts of this layer. * @type {String[]} * @readonly */ this.abstract; /** * The list of keywords associated with this layer description. * @type {String[]} * @readonly */ this.keywords; /** * The WGS84 bounding box associated with this layer. The returned object has the following properties: * "lowerCorner", "upperCorner". * @type {{}} * @readonly */ this.wgs84BoundingBox; /** * The bounding boxes associated with this layer. The returned array contains objects with the following * properties: TODO * @type {Object[]} * @readonly */ this.boundingBox; /** * The list of styles associated with this layer description, accumulated from this layer and its parent * layers. Each object returned may have the following properties: name {String}, title {String}, * abstract {String}, legendUrls {Object[]}, styleSheetUrl, styleUrl. Legend urls may have the following * properties: width, height, format, url. Style sheet urls and style urls have the following properties: * format, url. * @type {Object[]} * @readonly */ this.styles; /** * The formats supported by this layer. * @type {String[]} * @readonly */ this.formats; /** * The Feature Info formats supported by this layer. * @type {String[]} * @readonly */ this.infoFormat; /** * The dimensions associated with this layer. The returned array contains objects with the following * properties: * @type {Object[]} * @readonly */ this.dimension; /** * The metadata associated with this layer description. Each object in the returned array has the * following properties: type, format, url. * @type {Object[]} * @readonly */ this.metadata; /** * The tile matris sets associated with this layer. * @type {Object[]} * @readonly */ this.tileMatrixSetLink; /** * The resource URLs associated with this layer description. Each object in the returned array has the * following properties: format, url. * @type {Object[]} * @readonly */ this.resourceUrl; this.assembleLayer(layerElement); }
javascript
function (layerElement, capabilities) { if (!layerElement) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmtsLayerCapabilities", "constructor", "missingDomElement")); } OwsDescription.call(this, layerElement); /** * This layer's WMTS capabilities document, as specified to the constructor of this object. * @type {{}} * @readonly */ this.capabilities = capabilities; /** * The identifier of this layer description. * @type {String} * @readonly */ this.identifier; /** * The titles of this layer. * @type {String[]} * @readonly */ this.title; /** * The abstracts of this layer. * @type {String[]} * @readonly */ this.abstract; /** * The list of keywords associated with this layer description. * @type {String[]} * @readonly */ this.keywords; /** * The WGS84 bounding box associated with this layer. The returned object has the following properties: * "lowerCorner", "upperCorner". * @type {{}} * @readonly */ this.wgs84BoundingBox; /** * The bounding boxes associated with this layer. The returned array contains objects with the following * properties: TODO * @type {Object[]} * @readonly */ this.boundingBox; /** * The list of styles associated with this layer description, accumulated from this layer and its parent * layers. Each object returned may have the following properties: name {String}, title {String}, * abstract {String}, legendUrls {Object[]}, styleSheetUrl, styleUrl. Legend urls may have the following * properties: width, height, format, url. Style sheet urls and style urls have the following properties: * format, url. * @type {Object[]} * @readonly */ this.styles; /** * The formats supported by this layer. * @type {String[]} * @readonly */ this.formats; /** * The Feature Info formats supported by this layer. * @type {String[]} * @readonly */ this.infoFormat; /** * The dimensions associated with this layer. The returned array contains objects with the following * properties: * @type {Object[]} * @readonly */ this.dimension; /** * The metadata associated with this layer description. Each object in the returned array has the * following properties: type, format, url. * @type {Object[]} * @readonly */ this.metadata; /** * The tile matris sets associated with this layer. * @type {Object[]} * @readonly */ this.tileMatrixSetLink; /** * The resource URLs associated with this layer description. Each object in the returned array has the * following properties: format, url. * @type {Object[]} * @readonly */ this.resourceUrl; this.assembleLayer(layerElement); }
[ "function", "(", "layerElement", ",", "capabilities", ")", "{", "if", "(", "!", "layerElement", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WmtsLayerCapabilities\"", ",", "\"constructor\"", ",", "\"missingDomElement\"", ")", ")", ";", "}", "OwsDescription", ".", "call", "(", "this", ",", "layerElement", ")", ";", "/**\n * This layer's WMTS capabilities document, as specified to the constructor of this object.\n * @type {{}}\n * @readonly\n */", "this", ".", "capabilities", "=", "capabilities", ";", "/**\n * The identifier of this layer description.\n * @type {String}\n * @readonly\n */", "this", ".", "identifier", ";", "/**\n * The titles of this layer.\n * @type {String[]}\n * @readonly\n */", "this", ".", "title", ";", "/**\n * The abstracts of this layer.\n * @type {String[]}\n * @readonly\n */", "this", ".", "abstract", ";", "/**\n * The list of keywords associated with this layer description.\n * @type {String[]}\n * @readonly\n */", "this", ".", "keywords", ";", "/**\n * The WGS84 bounding box associated with this layer. The returned object has the following properties:\n * \"lowerCorner\", \"upperCorner\".\n * @type {{}}\n * @readonly\n */", "this", ".", "wgs84BoundingBox", ";", "/**\n * The bounding boxes associated with this layer. The returned array contains objects with the following\n * properties: TODO\n * @type {Object[]}\n * @readonly\n */", "this", ".", "boundingBox", ";", "/**\n * The list of styles associated with this layer description, accumulated from this layer and its parent\n * layers. Each object returned may have the following properties: name {String}, title {String},\n * abstract {String}, legendUrls {Object[]}, styleSheetUrl, styleUrl. Legend urls may have the following\n * properties: width, height, format, url. Style sheet urls and style urls have the following properties:\n * format, url.\n * @type {Object[]}\n * @readonly\n */", "this", ".", "styles", ";", "/**\n * The formats supported by this layer.\n * @type {String[]}\n * @readonly\n */", "this", ".", "formats", ";", "/**\n * The Feature Info formats supported by this layer.\n * @type {String[]}\n * @readonly\n */", "this", ".", "infoFormat", ";", "/**\n * The dimensions associated with this layer. The returned array contains objects with the following\n * properties:\n * @type {Object[]}\n * @readonly\n */", "this", ".", "dimension", ";", "/**\n * The metadata associated with this layer description. Each object in the returned array has the\n * following properties: type, format, url.\n * @type {Object[]}\n * @readonly\n */", "this", ".", "metadata", ";", "/**\n * The tile matris sets associated with this layer.\n * @type {Object[]}\n * @readonly\n */", "this", ".", "tileMatrixSetLink", ";", "/**\n * The resource URLs associated with this layer description. Each object in the returned array has the\n * following properties: format, url.\n * @type {Object[]}\n * @readonly\n */", "this", ".", "resourceUrl", ";", "this", ".", "assembleLayer", "(", "layerElement", ")", ";", "}" ]
Constructs an WMTS Layer instance from an XML DOM. @alias WmtsLayerCapabilities @constructor @classdesc Represents a WMTS layer description from a WMTS Capabilities document. This object holds all the fields specified in the associated WMTS Capabilities document. @param {{}} layerElement A WMTS Layer element describing the layer. @param {{}} capabilities The WMTS capabilities documented containing this layer. @throws {ArgumentError} If the specified layer element is null or undefined.
[ "Constructs", "an", "WMTS", "Layer", "instance", "from", "an", "XML", "DOM", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/ogc/wmts/WmtsLayerCapabilities.js#L42-L158
10,521
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (value, minimum, maximum) { return value < minimum ? minimum : value > maximum ? maximum : value; }
javascript
function (value, minimum, maximum) { return value < minimum ? minimum : value > maximum ? maximum : value; }
[ "function", "(", "value", ",", "minimum", ",", "maximum", ")", "{", "return", "value", "<", "minimum", "?", "minimum", ":", "value", ">", "maximum", "?", "maximum", ":", "value", ";", "}" ]
Returns a number within the range of a specified minimum and maximum. @param {Number} value The value to clamp. @param {Number} minimum The minimum value to return. @param {Number} maximum The maximum value to return. @returns {Number} The minimum value if the specified value is less than the minimum, the maximum value if the specified value is greater than the maximum, otherwise the value specified is returned.
[ "Returns", "a", "number", "within", "the", "range", "of", "a", "specified", "minimum", "and", "maximum", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L46-L48
10,522
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (line, equatorialRadius, polarRadius, result) { if (!line) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "computeEllipsoidalGlobeIntersection", "missingLine")); } if (!result) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "computeEllipsoidalGlobeIntersection", "missingResult")); } // Taken from "Mathematics for 3D Game Programming and Computer Graphics, Second Edition", Section 5.2.3. // // Note that the parameter n from in equations 5.70 and 5.71 is omitted here. For an ellipsoidal globe this // parameter is always 1, so its square and its product with any other value simplifies to the identity. var vx = line.direction[0], vy = line.direction[1], vz = line.direction[2], sx = line.origin[0], sy = line.origin[1], sz = line.origin[2], m = equatorialRadius / polarRadius, // ratio of the x semi-axis length to the y semi-axis length m2 = m * m, r2 = equatorialRadius * equatorialRadius, // nominal radius squared a = vx * vx + m2 * vy * vy + vz * vz, b = 2 * (sx * vx + m2 * sy * vy + sz * vz), c = sx * sx + m2 * sy * sy + sz * sz - r2, d = b * b - 4 * a * c, // discriminant t; if (d < 0) { return false; } else { t = (-b - Math.sqrt(d)) / (2 * a); result[0] = sx + vx * t; result[1] = sy + vy * t; result[2] = sz + vz * t; return true; } }
javascript
function (line, equatorialRadius, polarRadius, result) { if (!line) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "computeEllipsoidalGlobeIntersection", "missingLine")); } if (!result) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "computeEllipsoidalGlobeIntersection", "missingResult")); } // Taken from "Mathematics for 3D Game Programming and Computer Graphics, Second Edition", Section 5.2.3. // // Note that the parameter n from in equations 5.70 and 5.71 is omitted here. For an ellipsoidal globe this // parameter is always 1, so its square and its product with any other value simplifies to the identity. var vx = line.direction[0], vy = line.direction[1], vz = line.direction[2], sx = line.origin[0], sy = line.origin[1], sz = line.origin[2], m = equatorialRadius / polarRadius, // ratio of the x semi-axis length to the y semi-axis length m2 = m * m, r2 = equatorialRadius * equatorialRadius, // nominal radius squared a = vx * vx + m2 * vy * vy + vz * vz, b = 2 * (sx * vx + m2 * sy * vy + sz * vz), c = sx * sx + m2 * sy * sy + sz * sz - r2, d = b * b - 4 * a * c, // discriminant t; if (d < 0) { return false; } else { t = (-b - Math.sqrt(d)) / (2 * a); result[0] = sx + vx * t; result[1] = sy + vy * t; result[2] = sz + vz * t; return true; } }
[ "function", "(", "line", ",", "equatorialRadius", ",", "polarRadius", ",", "result", ")", "{", "if", "(", "!", "line", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"computeEllipsoidalGlobeIntersection\"", ",", "\"missingLine\"", ")", ")", ";", "}", "if", "(", "!", "result", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"computeEllipsoidalGlobeIntersection\"", ",", "\"missingResult\"", ")", ")", ";", "}", "// Taken from \"Mathematics for 3D Game Programming and Computer Graphics, Second Edition\", Section 5.2.3.", "//", "// Note that the parameter n from in equations 5.70 and 5.71 is omitted here. For an ellipsoidal globe this", "// parameter is always 1, so its square and its product with any other value simplifies to the identity.", "var", "vx", "=", "line", ".", "direction", "[", "0", "]", ",", "vy", "=", "line", ".", "direction", "[", "1", "]", ",", "vz", "=", "line", ".", "direction", "[", "2", "]", ",", "sx", "=", "line", ".", "origin", "[", "0", "]", ",", "sy", "=", "line", ".", "origin", "[", "1", "]", ",", "sz", "=", "line", ".", "origin", "[", "2", "]", ",", "m", "=", "equatorialRadius", "/", "polarRadius", ",", "// ratio of the x semi-axis length to the y semi-axis length", "m2", "=", "m", "*", "m", ",", "r2", "=", "equatorialRadius", "*", "equatorialRadius", ",", "// nominal radius squared", "a", "=", "vx", "*", "vx", "+", "m2", "*", "vy", "*", "vy", "+", "vz", "*", "vz", ",", "b", "=", "2", "*", "(", "sx", "*", "vx", "+", "m2", "*", "sy", "*", "vy", "+", "sz", "*", "vz", ")", ",", "c", "=", "sx", "*", "sx", "+", "m2", "*", "sy", "*", "sy", "+", "sz", "*", "sz", "-", "r2", ",", "d", "=", "b", "*", "b", "-", "4", "*", "a", "*", "c", ",", "// discriminant", "t", ";", "if", "(", "d", "<", "0", ")", "{", "return", "false", ";", "}", "else", "{", "t", "=", "(", "-", "b", "-", "Math", ".", "sqrt", "(", "d", ")", ")", "/", "(", "2", "*", "a", ")", ";", "result", "[", "0", "]", "=", "sx", "+", "vx", "*", "t", ";", "result", "[", "1", "]", "=", "sy", "+", "vy", "*", "t", ";", "result", "[", "2", "]", "=", "sz", "+", "vz", "*", "t", ";", "return", "true", ";", "}", "}" ]
Computes the Cartesian intersection point of a specified line with an ellipsoid. @param {Line} line The line for which to compute the intersection. @param {Number} equatorialRadius The ellipsoid's major radius. @param {Number} polarRadius The ellipsoid's minor radius. @param {Vec3} result A pre-allocated Vec3 instance in which to return the computed point. @returns {boolean} true if the line intersects the ellipsoid, otherwise false @throws {ArgumentError} If the specified line or result is null or undefined. @deprecated utilize the Globe.intersectsLine method attached implementation
[ "Computes", "the", "Cartesian", "intersection", "point", "of", "a", "specified", "line", "with", "an", "ellipsoid", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L86-L127
10,523
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (origin, globe, xAxisResult, yAxisResult, zAxisResult) { if (!origin) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "localCoordinateAxesAtPoint", "missingVector")); } if (!globe) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "localCoordinateAxesAtPoint", "missingGlobe")); } if (!xAxisResult || !yAxisResult || !zAxisResult) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "localCoordinateAxesAtPoint", "missingResult")); } var x = origin[0], y = origin[1], z = origin[2]; // Compute the z axis from the surface normal in model coordinates. This axis is used to determine the other two // axes, and is the only constant in the computations below. globe.surfaceNormalAtPoint(x, y, z, zAxisResult); // Compute the y axis from the north pointing tangent in model coordinates. This axis is known to be orthogonal to // the z axis, and is therefore used to compute the x axis. globe.northTangentAtPoint(x, y, z, yAxisResult); // Compute the x axis as the cross product of the y and z axes. This ensures that the x and z axes are orthogonal. xAxisResult.set(yAxisResult[0], yAxisResult[1], yAxisResult[2]); xAxisResult.cross(zAxisResult); xAxisResult.normalize(); // Re-compute the y axis as the cross product of the z and x axes. This ensures that all three axes are orthogonal. // Though the initial y axis computed above is likely to be very nearly orthogonal, we re-compute it using cross // products to reduce the effect of floating point rounding errors caused by working with Earth sized coordinates. yAxisResult.set(zAxisResult[0], zAxisResult[1], zAxisResult[2]); yAxisResult.cross(xAxisResult); yAxisResult.normalize(); }
javascript
function (origin, globe, xAxisResult, yAxisResult, zAxisResult) { if (!origin) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "localCoordinateAxesAtPoint", "missingVector")); } if (!globe) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "localCoordinateAxesAtPoint", "missingGlobe")); } if (!xAxisResult || !yAxisResult || !zAxisResult) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "localCoordinateAxesAtPoint", "missingResult")); } var x = origin[0], y = origin[1], z = origin[2]; // Compute the z axis from the surface normal in model coordinates. This axis is used to determine the other two // axes, and is the only constant in the computations below. globe.surfaceNormalAtPoint(x, y, z, zAxisResult); // Compute the y axis from the north pointing tangent in model coordinates. This axis is known to be orthogonal to // the z axis, and is therefore used to compute the x axis. globe.northTangentAtPoint(x, y, z, yAxisResult); // Compute the x axis as the cross product of the y and z axes. This ensures that the x and z axes are orthogonal. xAxisResult.set(yAxisResult[0], yAxisResult[1], yAxisResult[2]); xAxisResult.cross(zAxisResult); xAxisResult.normalize(); // Re-compute the y axis as the cross product of the z and x axes. This ensures that all three axes are orthogonal. // Though the initial y axis computed above is likely to be very nearly orthogonal, we re-compute it using cross // products to reduce the effect of floating point rounding errors caused by working with Earth sized coordinates. yAxisResult.set(zAxisResult[0], zAxisResult[1], zAxisResult[2]); yAxisResult.cross(xAxisResult); yAxisResult.normalize(); }
[ "function", "(", "origin", ",", "globe", ",", "xAxisResult", ",", "yAxisResult", ",", "zAxisResult", ")", "{", "if", "(", "!", "origin", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"localCoordinateAxesAtPoint\"", ",", "\"missingVector\"", ")", ")", ";", "}", "if", "(", "!", "globe", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"localCoordinateAxesAtPoint\"", ",", "\"missingGlobe\"", ")", ")", ";", "}", "if", "(", "!", "xAxisResult", "||", "!", "yAxisResult", "||", "!", "zAxisResult", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"localCoordinateAxesAtPoint\"", ",", "\"missingResult\"", ")", ")", ";", "}", "var", "x", "=", "origin", "[", "0", "]", ",", "y", "=", "origin", "[", "1", "]", ",", "z", "=", "origin", "[", "2", "]", ";", "// Compute the z axis from the surface normal in model coordinates. This axis is used to determine the other two", "// axes, and is the only constant in the computations below.", "globe", ".", "surfaceNormalAtPoint", "(", "x", ",", "y", ",", "z", ",", "zAxisResult", ")", ";", "// Compute the y axis from the north pointing tangent in model coordinates. This axis is known to be orthogonal to", "// the z axis, and is therefore used to compute the x axis.", "globe", ".", "northTangentAtPoint", "(", "x", ",", "y", ",", "z", ",", "yAxisResult", ")", ";", "// Compute the x axis as the cross product of the y and z axes. This ensures that the x and z axes are orthogonal.", "xAxisResult", ".", "set", "(", "yAxisResult", "[", "0", "]", ",", "yAxisResult", "[", "1", "]", ",", "yAxisResult", "[", "2", "]", ")", ";", "xAxisResult", ".", "cross", "(", "zAxisResult", ")", ";", "xAxisResult", ".", "normalize", "(", ")", ";", "// Re-compute the y axis as the cross product of the z and x axes. This ensures that all three axes are orthogonal.", "// Though the initial y axis computed above is likely to be very nearly orthogonal, we re-compute it using cross", "// products to reduce the effect of floating point rounding errors caused by working with Earth sized coordinates.", "yAxisResult", ".", "set", "(", "zAxisResult", "[", "0", "]", ",", "zAxisResult", "[", "1", "]", ",", "zAxisResult", "[", "2", "]", ")", ";", "yAxisResult", ".", "cross", "(", "xAxisResult", ")", ";", "yAxisResult", ".", "normalize", "(", ")", ";", "}" ]
Computes the axes of a local coordinate system on the specified globe, placing the resultant axes in the specified axis arguments. Upon return the specified axis arguments contain three orthogonal axes identifying the X, Y, and Z axes. Each axis has unit length. The local coordinate system is defined such that the Z axis maps to the globe's surface normal at the point, the Y axis maps to the north pointing tangent, and the X axis maps to the east pointing tangent. @param {Vec3} origin The local coordinate system origin, in model coordinates. @param {Globe} globe The globe the coordinate system is relative to. @param {Vec3} xAxisResult A pre-allocated Vec3 in which to return the computed X axis. @param {Vec3} yAxisResult A pre-allocated Vec3 in which to return the computed Y axis. @param {Vec3} zAxisResult A pre-allocated Vec3 in which to return the computed Z axis. @throws {ArgumentError} If any argument is null or undefined.
[ "Computes", "the", "axes", "of", "a", "local", "coordinate", "system", "on", "the", "specified", "globe", "placing", "the", "resultant", "axes", "in", "the", "specified", "axis", "arguments", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L486-L525
10,524
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (radius, altitude) { if (radius < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "horizontalDistanceForGlobeRadius", "The specified globe radius is negative.")); } return (radius > 0 && altitude > 0) ? Math.sqrt(altitude * (2 * radius + altitude)) : 0; }
javascript
function (radius, altitude) { if (radius < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "horizontalDistanceForGlobeRadius", "The specified globe radius is negative.")); } return (radius > 0 && altitude > 0) ? Math.sqrt(altitude * (2 * radius + altitude)) : 0; }
[ "function", "(", "radius", ",", "altitude", ")", "{", "if", "(", "radius", "<", "0", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"horizontalDistanceForGlobeRadius\"", ",", "\"The specified globe radius is negative.\"", ")", ")", ";", "}", "return", "(", "radius", ">", "0", "&&", "altitude", ">", "0", ")", "?", "Math", ".", "sqrt", "(", "altitude", "*", "(", "2", "*", "radius", "+", "altitude", ")", ")", ":", "0", ";", "}" ]
Computes the distance to a globe's horizon from a viewer at a given altitude. Only the globe's ellipsoid is considered; terrain height is not incorporated. This returns zero if the radius is zero or if the altitude is less than or equal to zero. @param {Number} radius The globe's radius, in meters. @param {Number} altitude The viewer's altitude above the globe, in meters. @returns {Number} The distance to the horizon, in model coordinates. @throws {ArgumentError} If the specified globe radius is negative.
[ "Computes", "the", "distance", "to", "a", "globe", "s", "horizon", "from", "a", "viewer", "at", "a", "given", "altitude", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L538-L545
10,525
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (farDistance, farResolution, depthBits) { if (farDistance < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveNearDistanceForFarDistance", "The specified distance is negative.")); } if (farResolution < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveNearDistanceForFarDistance", "The specified resolution is negative.")); } if (depthBits < 1) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveNearDistanceForFarDistance", "The specified depth bits is negative.")); } var maxDepthValue = (1 << depthBits) - 1; return farDistance / (maxDepthValue / (1 - farResolution / farDistance) - maxDepthValue + 1); }
javascript
function (farDistance, farResolution, depthBits) { if (farDistance < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveNearDistanceForFarDistance", "The specified distance is negative.")); } if (farResolution < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveNearDistanceForFarDistance", "The specified resolution is negative.")); } if (depthBits < 1) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveNearDistanceForFarDistance", "The specified depth bits is negative.")); } var maxDepthValue = (1 << depthBits) - 1; return farDistance / (maxDepthValue / (1 - farResolution / farDistance) - maxDepthValue + 1); }
[ "function", "(", "farDistance", ",", "farResolution", ",", "depthBits", ")", "{", "if", "(", "farDistance", "<", "0", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"perspectiveNearDistanceForFarDistance\"", ",", "\"The specified distance is negative.\"", ")", ")", ";", "}", "if", "(", "farResolution", "<", "0", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"perspectiveNearDistanceForFarDistance\"", ",", "\"The specified resolution is negative.\"", ")", ")", ";", "}", "if", "(", "depthBits", "<", "1", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"perspectiveNearDistanceForFarDistance\"", ",", "\"The specified depth bits is negative.\"", ")", ")", ";", "}", "var", "maxDepthValue", "=", "(", "1", "<<", "depthBits", ")", "-", "1", ";", "return", "farDistance", "/", "(", "maxDepthValue", "/", "(", "1", "-", "farResolution", "/", "farDistance", ")", "-", "maxDepthValue", "+", "1", ")", ";", "}" ]
Computes the near clip distance that corresponds to a specified far clip distance and resolution at the far clip plane. This computes a near clip distance appropriate for use in [perspectiveFrustumRect]{@link WWMath#perspectiveFrustumRectangle} and [setToPerspectiveProjection]{@link Matrix#setToPerspectiveProjection}. This returns zero if either the distance or the resolution are zero. @param {Number} farDistance The far clip distance, in meters. @param {Number} farResolution The depth resolution at the far clip plane, in meters. @param {Number} depthBits The number of bit-planes in the depth buffer. @returns {Number} The near clip distance, in meters. @throws {ArgumentError} If either the distance or resolution is negative, or if the depth bits is less than one.
[ "Computes", "the", "near", "clip", "distance", "that", "corresponds", "to", "a", "specified", "far", "clip", "distance", "and", "resolution", "at", "the", "far", "clip", "plane", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L562-L581
10,526
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (viewportWidth, viewportHeight, distance) { if (viewportWidth <= 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveFrustumRectangle", "invalidWidth")); } if (viewportHeight <= 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveFrustumRectangle", "invalidHeight")); } if (distance < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveFrustumRectangle", "The specified distance is negative.")); } // Assumes a 45 degree horizontal field of view. var width = distance, height = distance * viewportHeight / viewportWidth; return new Rectangle(-width / 2, -height / 2, width, height); }
javascript
function (viewportWidth, viewportHeight, distance) { if (viewportWidth <= 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveFrustumRectangle", "invalidWidth")); } if (viewportHeight <= 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveFrustumRectangle", "invalidHeight")); } if (distance < 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "perspectiveFrustumRectangle", "The specified distance is negative.")); } // Assumes a 45 degree horizontal field of view. var width = distance, height = distance * viewportHeight / viewportWidth; return new Rectangle(-width / 2, -height / 2, width, height); }
[ "function", "(", "viewportWidth", ",", "viewportHeight", ",", "distance", ")", "{", "if", "(", "viewportWidth", "<=", "0", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"perspectiveFrustumRectangle\"", ",", "\"invalidWidth\"", ")", ")", ";", "}", "if", "(", "viewportHeight", "<=", "0", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"perspectiveFrustumRectangle\"", ",", "\"invalidHeight\"", ")", ")", ";", "}", "if", "(", "distance", "<", "0", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"perspectiveFrustumRectangle\"", ",", "\"The specified distance is negative.\"", ")", ")", ";", "}", "// Assumes a 45 degree horizontal field of view.", "var", "width", "=", "distance", ",", "height", "=", "distance", "*", "viewportHeight", "/", "viewportWidth", ";", "return", "new", "Rectangle", "(", "-", "width", "/", "2", ",", "-", "height", "/", "2", ",", "width", ",", "height", ")", ";", "}" ]
Computes the coordinates of a rectangle carved out of a perspective projection's frustum at a given distance in model coordinates. This returns an empty rectangle if the specified distance is zero. @param {Number} viewportWidth The viewport width, in screen coordinates. @param {Number} viewportHeight The viewport height, in screen coordinates. @param {Number} distance The distance along the negative Z axis, in model coordinates. @returns {Rectangle} The frustum rectangle, in model coordinates. @throws {ArgumentError} If the specified width or height is less than or equal to zero, or if the specified distance is negative.
[ "Computes", "the", "coordinates", "of", "a", "rectangle", "carved", "out", "of", "a", "perspective", "projection", "s", "frustum", "at", "a", "given", "distance", "in", "model", "coordinates", ".", "This", "returns", "an", "empty", "rectangle", "if", "the", "specified", "distance", "is", "zero", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L651-L672
10,527
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (transformMatrix) { if (!transformMatrix) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "boundingRectForUnitQuad", "missingMatrix")); } var m = transformMatrix, // transform of (0, 0) x1 = m[3], y1 = m[7], // transform of (1, 0) x2 = m[0] + m[3], y2 = m[4] + m[7], // transform of (0, 1) x3 = m[1] + m[3], y3 = m[5] + m[7], // transform of (1, 1) x4 = m[0] + m[1] + m[3], y4 = m[4] + m[5] + m[7], minX = Math.min(Math.min(x1, x2), Math.min(x3, x4)), maxX = Math.max(Math.max(x1, x2), Math.max(x3, x4)), minY = Math.min(Math.min(y1, y2), Math.min(y3, y4)), maxY = Math.max(Math.max(y1, y2), Math.max(y3, y4)); return new Rectangle(minX, minY, maxX - minX, maxY - minY); }
javascript
function (transformMatrix) { if (!transformMatrix) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "WWMath", "boundingRectForUnitQuad", "missingMatrix")); } var m = transformMatrix, // transform of (0, 0) x1 = m[3], y1 = m[7], // transform of (1, 0) x2 = m[0] + m[3], y2 = m[4] + m[7], // transform of (0, 1) x3 = m[1] + m[3], y3 = m[5] + m[7], // transform of (1, 1) x4 = m[0] + m[1] + m[3], y4 = m[4] + m[5] + m[7], minX = Math.min(Math.min(x1, x2), Math.min(x3, x4)), maxX = Math.max(Math.max(x1, x2), Math.max(x3, x4)), minY = Math.min(Math.min(y1, y2), Math.min(y3, y4)), maxY = Math.max(Math.max(y1, y2), Math.max(y3, y4)); return new Rectangle(minX, minY, maxX - minX, maxY - minY); }
[ "function", "(", "transformMatrix", ")", "{", "if", "(", "!", "transformMatrix", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WWMath\"", ",", "\"boundingRectForUnitQuad\"", ",", "\"missingMatrix\"", ")", ")", ";", "}", "var", "m", "=", "transformMatrix", ",", "// transform of (0, 0)", "x1", "=", "m", "[", "3", "]", ",", "y1", "=", "m", "[", "7", "]", ",", "// transform of (1, 0)", "x2", "=", "m", "[", "0", "]", "+", "m", "[", "3", "]", ",", "y2", "=", "m", "[", "4", "]", "+", "m", "[", "7", "]", ",", "// transform of (0, 1)", "x3", "=", "m", "[", "1", "]", "+", "m", "[", "3", "]", ",", "y3", "=", "m", "[", "5", "]", "+", "m", "[", "7", "]", ",", "// transform of (1, 1)", "x4", "=", "m", "[", "0", "]", "+", "m", "[", "1", "]", "+", "m", "[", "3", "]", ",", "y4", "=", "m", "[", "4", "]", "+", "m", "[", "5", "]", "+", "m", "[", "7", "]", ",", "minX", "=", "Math", ".", "min", "(", "Math", ".", "min", "(", "x1", ",", "x2", ")", ",", "Math", ".", "min", "(", "x3", ",", "x4", ")", ")", ",", "maxX", "=", "Math", ".", "max", "(", "Math", ".", "max", "(", "x1", ",", "x2", ")", ",", "Math", ".", "max", "(", "x3", ",", "x4", ")", ")", ",", "minY", "=", "Math", ".", "min", "(", "Math", ".", "min", "(", "y1", ",", "y2", ")", ",", "Math", ".", "min", "(", "y3", ",", "y4", ")", ")", ",", "maxY", "=", "Math", ".", "max", "(", "Math", ".", "max", "(", "y1", ",", "y2", ")", ",", "Math", ".", "max", "(", "y3", ",", "y4", ")", ")", ";", "return", "new", "Rectangle", "(", "minX", ",", "minY", ",", "maxX", "-", "minX", ",", "maxY", "-", "minY", ")", ";", "}" ]
Computes the bounding rectangle for a unit quadrilateral after applying a transformation matrix to that quadrilateral. @param {Matrix} transformMatrix The matrix to apply to the unit quadrilateral. @returns {Rectangle} The computed bounding rectangle.
[ "Computes", "the", "bounding", "rectangle", "for", "a", "unit", "quadrilateral", "after", "applying", "a", "transformation", "matrix", "to", "that", "quadrilateral", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L718-L743
10,528
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (latitude) { return Math.log(Math.tan(Math.PI / 4 + (latitude * Angle.DEGREES_TO_RADIANS) / 2)) / Math.PI; }
javascript
function (latitude) { return Math.log(Math.tan(Math.PI / 4 + (latitude * Angle.DEGREES_TO_RADIANS) / 2)) / Math.PI; }
[ "function", "(", "latitude", ")", "{", "return", "Math", ".", "log", "(", "Math", ".", "tan", "(", "Math", ".", "PI", "/", "4", "+", "(", "latitude", "*", "Angle", ".", "DEGREES_TO_RADIANS", ")", "/", "2", ")", ")", "/", "Math", ".", "PI", ";", "}" ]
Calculates the Gudermannian inverse used to unproject Mercator projections. @param {Number} latitude The latitude in degrees. @returns {Number} The Gudermannian inverse for the specified latitude.
[ "Calculates", "the", "Gudermannian", "inverse", "used", "to", "unproject", "Mercator", "projections", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L769-L771
10,529
NASAWorldWind/WebWorldWind
src/util/WWMath.js
function (value) { var power = Math.floor(Math.log(value) / Math.log(2)); return Math.pow(2, power); }
javascript
function (value) { var power = Math.floor(Math.log(value) / Math.log(2)); return Math.pow(2, power); }
[ "function", "(", "value", ")", "{", "var", "power", "=", "Math", ".", "floor", "(", "Math", ".", "log", "(", "value", ")", "/", "Math", ".", "log", "(", "2", ")", ")", ";", "return", "Math", ".", "pow", "(", "2", ",", "power", ")", ";", "}" ]
Returns the value that is the nearest power of 2 less than or equal to the given value. @param {Number} value the reference value. The power of 2 returned is less than or equal to this value. @returns {Number} the value that is the nearest power of 2 less than or equal to the reference value
[ "Returns", "the", "value", "that", "is", "the", "nearest", "power", "of", "2", "less", "than", "or", "equal", "to", "the", "given", "value", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWMath.js#L789-L792
10,530
NASAWorldWind/WebWorldWind
src/layer/FrameStatisticsLayer.js
function (worldWindow) { if (!worldWindow) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "FrameStatisticsLayer", "constructor", "missingWorldWindow")); } Layer.call(this, "Frame Statistics"); // No picking of this layer's screen elements. this.pickEnabled = false; var textAttributes = new TextAttributes(null); textAttributes.color = Color.GREEN; textAttributes.font = new Font(12); textAttributes.offset = new Offset(WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1); // Intentionally not documented. this.frameTime = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 5), " "); this.frameTime.attributes = textAttributes; // Intentionally not documented. this.frameRate = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 25), " "); this.frameRate.attributes = textAttributes; // Register a redraw callback on the WorldWindow. var thisLayer = this; function redrawCallback(worldWindow, stage) { thisLayer.handleRedraw(worldWindow, stage); } worldWindow.redrawCallbacks.push(redrawCallback); }
javascript
function (worldWindow) { if (!worldWindow) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "FrameStatisticsLayer", "constructor", "missingWorldWindow")); } Layer.call(this, "Frame Statistics"); // No picking of this layer's screen elements. this.pickEnabled = false; var textAttributes = new TextAttributes(null); textAttributes.color = Color.GREEN; textAttributes.font = new Font(12); textAttributes.offset = new Offset(WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1); // Intentionally not documented. this.frameTime = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 5), " "); this.frameTime.attributes = textAttributes; // Intentionally not documented. this.frameRate = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 25), " "); this.frameRate.attributes = textAttributes; // Register a redraw callback on the WorldWindow. var thisLayer = this; function redrawCallback(worldWindow, stage) { thisLayer.handleRedraw(worldWindow, stage); } worldWindow.redrawCallbacks.push(redrawCallback); }
[ "function", "(", "worldWindow", ")", "{", "if", "(", "!", "worldWindow", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"FrameStatisticsLayer\"", ",", "\"constructor\"", ",", "\"missingWorldWindow\"", ")", ")", ";", "}", "Layer", ".", "call", "(", "this", ",", "\"Frame Statistics\"", ")", ";", "// No picking of this layer's screen elements.", "this", ".", "pickEnabled", "=", "false", ";", "var", "textAttributes", "=", "new", "TextAttributes", "(", "null", ")", ";", "textAttributes", ".", "color", "=", "Color", ".", "GREEN", ";", "textAttributes", ".", "font", "=", "new", "Font", "(", "12", ")", ";", "textAttributes", ".", "offset", "=", "new", "Offset", "(", "WorldWind", ".", "OFFSET_FRACTION", ",", "0", ",", "WorldWind", ".", "OFFSET_FRACTION", ",", "1", ")", ";", "// Intentionally not documented.", "this", ".", "frameTime", "=", "new", "ScreenText", "(", "new", "Offset", "(", "WorldWind", ".", "OFFSET_PIXELS", ",", "5", ",", "WorldWind", ".", "OFFSET_INSET_PIXELS", ",", "5", ")", ",", "\" \"", ")", ";", "this", ".", "frameTime", ".", "attributes", "=", "textAttributes", ";", "// Intentionally not documented.", "this", ".", "frameRate", "=", "new", "ScreenText", "(", "new", "Offset", "(", "WorldWind", ".", "OFFSET_PIXELS", ",", "5", ",", "WorldWind", ".", "OFFSET_INSET_PIXELS", ",", "25", ")", ",", "\" \"", ")", ";", "this", ".", "frameRate", ".", "attributes", "=", "textAttributes", ";", "// Register a redraw callback on the WorldWindow.", "var", "thisLayer", "=", "this", ";", "function", "redrawCallback", "(", "worldWindow", ",", "stage", ")", "{", "thisLayer", ".", "handleRedraw", "(", "worldWindow", ",", "stage", ")", ";", "}", "worldWindow", ".", "redrawCallbacks", ".", "push", "(", "redrawCallback", ")", ";", "}" ]
Constructs a layer that displays the current performance statistics. @alias FrameStatisticsLayer @constructor @augments Layer @classDesc Displays the current performance statistics, which are collected each frame in the WorldWindow's {@link FrameStatistics}. A frame statics layer cannot be shared among WorldWindows. Each WorldWindow if it is to have a frame statistics layer must have its own. @param {WorldWindow} worldWindow The WorldWindow associated with this layer. This layer may not be associated with more than one WorldWindow. Each WorldWindow must have it's own instance of this layer if each window is to have a frame statistics display. @throws {ArgumentError} If the specified WorldWindow is null or undefined.
[ "Constructs", "a", "layer", "that", "displays", "the", "current", "performance", "statistics", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/FrameStatisticsLayer.js#L53-L85
10,531
NASAWorldWind/WebWorldWind
src/shapes/Compass.js
function (screenOffset, imagePath) { var sOffset = screenOffset ? screenOffset : new Offset(WorldWind.OFFSET_FRACTION, 1, WorldWind.OFFSET_FRACTION, 1), // upper-right placement iPath = imagePath ? imagePath : WorldWind.configuration.baseUrl + "images/notched-compass.png"; ScreenImage.call(this, sOffset, iPath); // Must set the default image offset after calling the constructor above. if (!screenOffset) { // Align the upper right corner of the image with the screen point, and give the image some padding. this.imageOffset = new Offset(WorldWind.OFFSET_FRACTION, 1.1, WorldWind.OFFSET_FRACTION, 1.1); } /** * Specifies the size of the compass as a fraction of the WorldWindow width. * @type {number} * @default 0.15 */ this.size = 0.15; }
javascript
function (screenOffset, imagePath) { var sOffset = screenOffset ? screenOffset : new Offset(WorldWind.OFFSET_FRACTION, 1, WorldWind.OFFSET_FRACTION, 1), // upper-right placement iPath = imagePath ? imagePath : WorldWind.configuration.baseUrl + "images/notched-compass.png"; ScreenImage.call(this, sOffset, iPath); // Must set the default image offset after calling the constructor above. if (!screenOffset) { // Align the upper right corner of the image with the screen point, and give the image some padding. this.imageOffset = new Offset(WorldWind.OFFSET_FRACTION, 1.1, WorldWind.OFFSET_FRACTION, 1.1); } /** * Specifies the size of the compass as a fraction of the WorldWindow width. * @type {number} * @default 0.15 */ this.size = 0.15; }
[ "function", "(", "screenOffset", ",", "imagePath", ")", "{", "var", "sOffset", "=", "screenOffset", "?", "screenOffset", ":", "new", "Offset", "(", "WorldWind", ".", "OFFSET_FRACTION", ",", "1", ",", "WorldWind", ".", "OFFSET_FRACTION", ",", "1", ")", ",", "// upper-right placement", "iPath", "=", "imagePath", "?", "imagePath", ":", "WorldWind", ".", "configuration", ".", "baseUrl", "+", "\"images/notched-compass.png\"", ";", "ScreenImage", ".", "call", "(", "this", ",", "sOffset", ",", "iPath", ")", ";", "// Must set the default image offset after calling the constructor above.", "if", "(", "!", "screenOffset", ")", "{", "// Align the upper right corner of the image with the screen point, and give the image some padding.", "this", ".", "imageOffset", "=", "new", "Offset", "(", "WorldWind", ".", "OFFSET_FRACTION", ",", "1.1", ",", "WorldWind", ".", "OFFSET_FRACTION", ",", "1.1", ")", ";", "}", "/**\n * Specifies the size of the compass as a fraction of the WorldWindow width.\n * @type {number}\n * @default 0.15\n */", "this", ".", "size", "=", "0.15", ";", "}" ]
Constructs a compass. @alias Compass @constructor @augments ScreenImage @classdesc Displays a compass image at a specified location in the WorldWindow. The compass image rotates and tilts to reflect the current navigator's heading and tilt. @param {Offset} screenOffset The offset indicating the image's placement on the screen. If null or undefined the compass is placed at the upper-right corner of the WorldWindow. Use [the image offset property]{@link ScreenImage#imageOffset} to position the image relative to the screen point. @param {String} imagePath The URL of the image to display. If null or undefined, a default compass image is used.
[ "Constructs", "a", "compass", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/shapes/Compass.js#L45-L66
10,532
NASAWorldWind/WebWorldWind
src/layer/heatmap/HeatMapLayer.js
function (displayName, measuredLocations, numLevels) { this.tileWidth = 256; this.tileHeight = 256; TiledImageLayer.call(this, new Sector(-90, 90, -180, 180), new Location(45, 45), numLevels || 18, 'image/png', 'HeatMap' + WWUtil.guid(), this.tileWidth, this.tileHeight); this.displayName = displayName; var data = {}; for (var lat = -90; lat <= 90; lat++) { data[lat] = {}; for (var lon = -180; lon <= 180; lon++) { data[lat][lon] = []; } } var latitude, longitude; var max = Number.MIN_VALUE; measuredLocations.forEach(function (measured) { latitude = Math.floor(measured.latitude); longitude = Math.floor(measured.longitude); data[latitude][longitude].push(measured); if(measured.measure > max) { max = measured.measure; } }); this._data = data; this._measuredLocations = measuredLocations; this._intervalType = HeatMapIntervalType.CONTINUOUS; this._scale = ['blue', 'cyan', 'lime', 'yellow', 'red']; this._radius = 12.5; this._incrementPerIntensity = 1 / max; this.setGradient(measuredLocations); }
javascript
function (displayName, measuredLocations, numLevels) { this.tileWidth = 256; this.tileHeight = 256; TiledImageLayer.call(this, new Sector(-90, 90, -180, 180), new Location(45, 45), numLevels || 18, 'image/png', 'HeatMap' + WWUtil.guid(), this.tileWidth, this.tileHeight); this.displayName = displayName; var data = {}; for (var lat = -90; lat <= 90; lat++) { data[lat] = {}; for (var lon = -180; lon <= 180; lon++) { data[lat][lon] = []; } } var latitude, longitude; var max = Number.MIN_VALUE; measuredLocations.forEach(function (measured) { latitude = Math.floor(measured.latitude); longitude = Math.floor(measured.longitude); data[latitude][longitude].push(measured); if(measured.measure > max) { max = measured.measure; } }); this._data = data; this._measuredLocations = measuredLocations; this._intervalType = HeatMapIntervalType.CONTINUOUS; this._scale = ['blue', 'cyan', 'lime', 'yellow', 'red']; this._radius = 12.5; this._incrementPerIntensity = 1 / max; this.setGradient(measuredLocations); }
[ "function", "(", "displayName", ",", "measuredLocations", ",", "numLevels", ")", "{", "this", ".", "tileWidth", "=", "256", ";", "this", ".", "tileHeight", "=", "256", ";", "TiledImageLayer", ".", "call", "(", "this", ",", "new", "Sector", "(", "-", "90", ",", "90", ",", "-", "180", ",", "180", ")", ",", "new", "Location", "(", "45", ",", "45", ")", ",", "numLevels", "||", "18", ",", "'image/png'", ",", "'HeatMap'", "+", "WWUtil", ".", "guid", "(", ")", ",", "this", ".", "tileWidth", ",", "this", ".", "tileHeight", ")", ";", "this", ".", "displayName", "=", "displayName", ";", "var", "data", "=", "{", "}", ";", "for", "(", "var", "lat", "=", "-", "90", ";", "lat", "<=", "90", ";", "lat", "++", ")", "{", "data", "[", "lat", "]", "=", "{", "}", ";", "for", "(", "var", "lon", "=", "-", "180", ";", "lon", "<=", "180", ";", "lon", "++", ")", "{", "data", "[", "lat", "]", "[", "lon", "]", "=", "[", "]", ";", "}", "}", "var", "latitude", ",", "longitude", ";", "var", "max", "=", "Number", ".", "MIN_VALUE", ";", "measuredLocations", ".", "forEach", "(", "function", "(", "measured", ")", "{", "latitude", "=", "Math", ".", "floor", "(", "measured", ".", "latitude", ")", ";", "longitude", "=", "Math", ".", "floor", "(", "measured", ".", "longitude", ")", ";", "data", "[", "latitude", "]", "[", "longitude", "]", ".", "push", "(", "measured", ")", ";", "if", "(", "measured", ".", "measure", ">", "max", ")", "{", "max", "=", "measured", ".", "measure", ";", "}", "}", ")", ";", "this", ".", "_data", "=", "data", ";", "this", ".", "_measuredLocations", "=", "measuredLocations", ";", "this", ".", "_intervalType", "=", "HeatMapIntervalType", ".", "CONTINUOUS", ";", "this", ".", "_scale", "=", "[", "'blue'", ",", "'cyan'", ",", "'lime'", ",", "'yellow'", ",", "'red'", "]", ";", "this", ".", "_radius", "=", "12.5", ";", "this", ".", "_incrementPerIntensity", "=", "1", "/", "max", ";", "this", ".", "setGradient", "(", "measuredLocations", ")", ";", "}" ]
Constructs a HeatMap Layer. The default implementation uses gradient circles to display measured locations. The measure of the locations define the colors of the gradient. @alias HeatMapLayer @constructor @augments TiledImageLayer @classdesc A HeatMap layer for visualising an array of measured locations. @param {String} displayName This layer's display name. @param {MeasuredLocation[]} measuredLocations An array of locations with measures to visualise. @param {Number} numLevels Optional. If provided it specifies the amount of levels that will be generated for this layer.
[ "Constructs", "a", "HeatMap", "Layer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/heatmap/HeatMapLayer.js#L57-L93
10,533
NASAWorldWind/WebWorldWind
src/gesture/PanRecognizer.js
function (target, callback) { GestureRecognizer.call(this, target, callback); /** * * @type {Number} */ this.minNumberOfTouches = 1; /** * * @type {Number} */ this.maxNumberOfTouches = Number.MAX_VALUE; // Intentionally not documented. this.interpretDistance = 20; }
javascript
function (target, callback) { GestureRecognizer.call(this, target, callback); /** * * @type {Number} */ this.minNumberOfTouches = 1; /** * * @type {Number} */ this.maxNumberOfTouches = Number.MAX_VALUE; // Intentionally not documented. this.interpretDistance = 20; }
[ "function", "(", "target", ",", "callback", ")", "{", "GestureRecognizer", ".", "call", "(", "this", ",", "target", ",", "callback", ")", ";", "/**\n *\n * @type {Number}\n */", "this", ".", "minNumberOfTouches", "=", "1", ";", "/**\n *\n * @type {Number}\n */", "this", ".", "maxNumberOfTouches", "=", "Number", ".", "MAX_VALUE", ";", "// Intentionally not documented.", "this", ".", "interpretDistance", "=", "20", ";", "}" ]
Constructs a pan gesture recognizer. @alias PanRecognizer @constructor @augments GestureRecognizer @classdesc A concrete gesture recognizer subclass that looks for touch panning gestures. @param {EventTarget} target The document element this gesture recognizer observes for mouse and touch events. @param {Function} callback An optional function to call when this gesture is recognized. If non-null, the function is called when this gesture is recognized, and is passed a single argument: this gesture recognizer, e.g., <code>gestureCallback(recognizer)</code>. @throws {ArgumentError} If the specified target is null or undefined.
[ "Constructs", "a", "pan", "gesture", "recognizer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/gesture/PanRecognizer.js#L36-L53
10,534
NASAWorldWind/WebWorldWind
examples/MultiWindow.js
function () { var pathAttributes = new WorldWind.ShapeAttributes(null); pathAttributes.interiorColor = WorldWind.Color.CYAN; pathAttributes.outlineColor= WorldWind.Color.BLUE; var pathPositions = [ new WorldWind.Position(40, -100, 1e4), new WorldWind.Position(45, -110, 1e4), new WorldWind.Position(46, -122, 1e4) ]; var path = new WorldWind.Path(pathPositions); path.attributes = pathAttributes; path.altitudeMode = WorldWind.RELATIVE_TO_GROUND; path.followTerrain = true; var pathLayer = new WorldWind.RenderableLayer("Path Layer"); pathLayer.addRenderable(path); return pathLayer; }
javascript
function () { var pathAttributes = new WorldWind.ShapeAttributes(null); pathAttributes.interiorColor = WorldWind.Color.CYAN; pathAttributes.outlineColor= WorldWind.Color.BLUE; var pathPositions = [ new WorldWind.Position(40, -100, 1e4), new WorldWind.Position(45, -110, 1e4), new WorldWind.Position(46, -122, 1e4) ]; var path = new WorldWind.Path(pathPositions); path.attributes = pathAttributes; path.altitudeMode = WorldWind.RELATIVE_TO_GROUND; path.followTerrain = true; var pathLayer = new WorldWind.RenderableLayer("Path Layer"); pathLayer.addRenderable(path); return pathLayer; }
[ "function", "(", ")", "{", "var", "pathAttributes", "=", "new", "WorldWind", ".", "ShapeAttributes", "(", "null", ")", ";", "pathAttributes", ".", "interiorColor", "=", "WorldWind", ".", "Color", ".", "CYAN", ";", "pathAttributes", ".", "outlineColor", "=", "WorldWind", ".", "Color", ".", "BLUE", ";", "var", "pathPositions", "=", "[", "new", "WorldWind", ".", "Position", "(", "40", ",", "-", "100", ",", "1e4", ")", ",", "new", "WorldWind", ".", "Position", "(", "45", ",", "-", "110", ",", "1e4", ")", ",", "new", "WorldWind", ".", "Position", "(", "46", ",", "-", "122", ",", "1e4", ")", "]", ";", "var", "path", "=", "new", "WorldWind", ".", "Path", "(", "pathPositions", ")", ";", "path", ".", "attributes", "=", "pathAttributes", ";", "path", ".", "altitudeMode", "=", "WorldWind", ".", "RELATIVE_TO_GROUND", ";", "path", ".", "followTerrain", "=", "true", ";", "var", "pathLayer", "=", "new", "WorldWind", ".", "RenderableLayer", "(", "\"Path Layer\"", ")", ";", "pathLayer", ".", "addRenderable", "(", "path", ")", ";", "return", "pathLayer", ";", "}" ]
Make a layer that shows a Path and is shared among the WorldWindows.
[ "Make", "a", "layer", "that", "shows", "a", "Path", "and", "is", "shared", "among", "the", "WorldWindows", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/MultiWindow.js#L27-L46
10,535
NASAWorldWind/WebWorldWind
examples/ScreenImage.js
function (o) { // The input argument is either an Event or a TapRecognizer. Both have the same properties for determining // the mouse or tap location. var x = o.clientX, y = o.clientY; // Perform the pick. Must first convert from window coordinates to canvas coordinates, which are // relative to the upper left corner of the canvas rather than the upper left corner of the page. var pickList = wwd.pick(wwd.canvasCoordinates(x, y)); if (pickList.objects.length > 0) { for (var p = 0; p < pickList.objects.length; p++) { // If the compass is picked, reset the navigator heading to 0 to re-orient the globe. if (pickList.objects[p].userObject instanceof WorldWind.Compass) { wwd.navigator.heading = 0; wwd.redraw(); } else if (pickList.objects[p].userObject instanceof WorldWind.ScreenImage) { console.log("Screen image picked"); } } } }
javascript
function (o) { // The input argument is either an Event or a TapRecognizer. Both have the same properties for determining // the mouse or tap location. var x = o.clientX, y = o.clientY; // Perform the pick. Must first convert from window coordinates to canvas coordinates, which are // relative to the upper left corner of the canvas rather than the upper left corner of the page. var pickList = wwd.pick(wwd.canvasCoordinates(x, y)); if (pickList.objects.length > 0) { for (var p = 0; p < pickList.objects.length; p++) { // If the compass is picked, reset the navigator heading to 0 to re-orient the globe. if (pickList.objects[p].userObject instanceof WorldWind.Compass) { wwd.navigator.heading = 0; wwd.redraw(); } else if (pickList.objects[p].userObject instanceof WorldWind.ScreenImage) { console.log("Screen image picked"); } } } }
[ "function", "(", "o", ")", "{", "// The input argument is either an Event or a TapRecognizer. Both have the same properties for determining", "// the mouse or tap location.", "var", "x", "=", "o", ".", "clientX", ",", "y", "=", "o", ".", "clientY", ";", "// Perform the pick. Must first convert from window coordinates to canvas coordinates, which are", "// relative to the upper left corner of the canvas rather than the upper left corner of the page.", "var", "pickList", "=", "wwd", ".", "pick", "(", "wwd", ".", "canvasCoordinates", "(", "x", ",", "y", ")", ")", ";", "if", "(", "pickList", ".", "objects", ".", "length", ">", "0", ")", "{", "for", "(", "var", "p", "=", "0", ";", "p", "<", "pickList", ".", "objects", ".", "length", ";", "p", "++", ")", "{", "// If the compass is picked, reset the navigator heading to 0 to re-orient the globe.", "if", "(", "pickList", ".", "objects", "[", "p", "]", ".", "userObject", "instanceof", "WorldWind", ".", "Compass", ")", "{", "wwd", ".", "navigator", ".", "heading", "=", "0", ";", "wwd", ".", "redraw", "(", ")", ";", "}", "else", "if", "(", "pickList", ".", "objects", "[", "p", "]", ".", "userObject", "instanceof", "WorldWind", ".", "ScreenImage", ")", "{", "console", ".", "log", "(", "\"Screen image picked\"", ")", ";", "}", "}", "}", "}" ]
Now set up to handle picking. The common pick-handling function.
[ "Now", "set", "up", "to", "handle", "picking", ".", "The", "common", "pick", "-", "handling", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/ScreenImage.js#L90-L112
10,536
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaScene.js
function (position, sceneData) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ColladaScene", "constructor", "missingPosition")); } Renderable.call(this); // Documented in defineProperties below. this._position = position; // Documented in defineProperties below. this._nodes = []; this._meshes = {}; this._materials = {}; this._images = {}; this._upAxis = ''; this._dirPath = ''; // Documented in defineProperties below. this._xRotation = 0; this._yRotation = 0; this._zRotation = 0; // Documented in defineProperties below. this._xTranslation = 0; this._yTranslation = 0; this._zTranslation = 0; // Documented in defineProperties below. this._scale = 1; // Documented in defineProperties below. this._altitudeMode = WorldWind.ABSOLUTE; // Documented in defineProperties below. this._localTransforms = true; // Documented in defineProperties below. this._useTexturePaths = true; // Documented in defineProperties below. this._nodesToHide = []; this._hideNodes = false; // Documented in defineProperties below. this._placePoint = new Vec3(0, 0, 0); // Documented in defineProperties below. this._transformationMatrix = Matrix.fromIdentity(); this._mvpMatrix = Matrix.fromIdentity(); // Documented in defineProperties below. this._normalTransformMatrix = Matrix.fromIdentity(); this._normalMatrix = Matrix.fromIdentity(); this._texCoordMatrix = Matrix.fromIdentity().setToUnitYFlip(); //Internal. Intentionally not documented. this._entities = []; //Internal. Intentionally not documented. this._activeTexture = null; //Internal. Intentionally not documented. this._tmpVector = new Vec3(0, 0, 0); this._tmpColor = new Color(1, 1, 1, 1); //Internal. Intentionally not documented. this._vboCacheKey = ''; this._iboCacheKey = ''; this.setSceneData(sceneData); }
javascript
function (position, sceneData) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ColladaScene", "constructor", "missingPosition")); } Renderable.call(this); // Documented in defineProperties below. this._position = position; // Documented in defineProperties below. this._nodes = []; this._meshes = {}; this._materials = {}; this._images = {}; this._upAxis = ''; this._dirPath = ''; // Documented in defineProperties below. this._xRotation = 0; this._yRotation = 0; this._zRotation = 0; // Documented in defineProperties below. this._xTranslation = 0; this._yTranslation = 0; this._zTranslation = 0; // Documented in defineProperties below. this._scale = 1; // Documented in defineProperties below. this._altitudeMode = WorldWind.ABSOLUTE; // Documented in defineProperties below. this._localTransforms = true; // Documented in defineProperties below. this._useTexturePaths = true; // Documented in defineProperties below. this._nodesToHide = []; this._hideNodes = false; // Documented in defineProperties below. this._placePoint = new Vec3(0, 0, 0); // Documented in defineProperties below. this._transformationMatrix = Matrix.fromIdentity(); this._mvpMatrix = Matrix.fromIdentity(); // Documented in defineProperties below. this._normalTransformMatrix = Matrix.fromIdentity(); this._normalMatrix = Matrix.fromIdentity(); this._texCoordMatrix = Matrix.fromIdentity().setToUnitYFlip(); //Internal. Intentionally not documented. this._entities = []; //Internal. Intentionally not documented. this._activeTexture = null; //Internal. Intentionally not documented. this._tmpVector = new Vec3(0, 0, 0); this._tmpColor = new Color(1, 1, 1, 1); //Internal. Intentionally not documented. this._vboCacheKey = ''; this._iboCacheKey = ''; this.setSceneData(sceneData); }
[ "function", "(", "position", ",", "sceneData", ")", "{", "if", "(", "!", "position", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"ColladaScene\"", ",", "\"constructor\"", ",", "\"missingPosition\"", ")", ")", ";", "}", "Renderable", ".", "call", "(", "this", ")", ";", "// Documented in defineProperties below.", "this", ".", "_position", "=", "position", ";", "// Documented in defineProperties below.", "this", ".", "_nodes", "=", "[", "]", ";", "this", ".", "_meshes", "=", "{", "}", ";", "this", ".", "_materials", "=", "{", "}", ";", "this", ".", "_images", "=", "{", "}", ";", "this", ".", "_upAxis", "=", "''", ";", "this", ".", "_dirPath", "=", "''", ";", "// Documented in defineProperties below.", "this", ".", "_xRotation", "=", "0", ";", "this", ".", "_yRotation", "=", "0", ";", "this", ".", "_zRotation", "=", "0", ";", "// Documented in defineProperties below.", "this", ".", "_xTranslation", "=", "0", ";", "this", ".", "_yTranslation", "=", "0", ";", "this", ".", "_zTranslation", "=", "0", ";", "// Documented in defineProperties below.", "this", ".", "_scale", "=", "1", ";", "// Documented in defineProperties below.", "this", ".", "_altitudeMode", "=", "WorldWind", ".", "ABSOLUTE", ";", "// Documented in defineProperties below.", "this", ".", "_localTransforms", "=", "true", ";", "// Documented in defineProperties below.", "this", ".", "_useTexturePaths", "=", "true", ";", "// Documented in defineProperties below.", "this", ".", "_nodesToHide", "=", "[", "]", ";", "this", ".", "_hideNodes", "=", "false", ";", "// Documented in defineProperties below.", "this", ".", "_placePoint", "=", "new", "Vec3", "(", "0", ",", "0", ",", "0", ")", ";", "// Documented in defineProperties below.", "this", ".", "_transformationMatrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ";", "this", ".", "_mvpMatrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ";", "// Documented in defineProperties below.", "this", ".", "_normalTransformMatrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ";", "this", ".", "_normalMatrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ";", "this", ".", "_texCoordMatrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ".", "setToUnitYFlip", "(", ")", ";", "//Internal. Intentionally not documented.", "this", ".", "_entities", "=", "[", "]", ";", "//Internal. Intentionally not documented.", "this", ".", "_activeTexture", "=", "null", ";", "//Internal. Intentionally not documented.", "this", ".", "_tmpVector", "=", "new", "Vec3", "(", "0", ",", "0", ",", "0", ")", ";", "this", ".", "_tmpColor", "=", "new", "Color", "(", "1", ",", "1", ",", "1", ",", "1", ")", ";", "//Internal. Intentionally not documented.", "this", ".", "_vboCacheKey", "=", "''", ";", "this", ".", "_iboCacheKey", "=", "''", ";", "this", ".", "setSceneData", "(", "sceneData", ")", ";", "}" ]
Constructs a collada scene @alias ColladaScene @constructor @augments Renderable @classdesc Represents a scene. A scene is a collection of nodes with meshes, materials and textures. @param {Position} position The scene's geographic position. @param {Object} sceneData The scene's data containing the nodes, meshes, materials, textures and other info needed to render the scene.
[ "Constructs", "a", "collada", "scene" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaScene.js#L53-L125
10,537
NASAWorldWind/WebWorldWind
src/layer/LandsatRestLayer.js
function (serverAddress, pathToData, displayName) { var cachePath = WWUtil.urlPath(serverAddress + "/" + pathToData); TiledImageLayer.call(this, Sector.FULL_SPHERE, new Location(36, 36), 10, "image/png", cachePath, 512, 512); this.displayName = displayName; this.pickEnabled = false; this.urlBuilder = new LevelRowColumnUrlBuilder(serverAddress, pathToData); }
javascript
function (serverAddress, pathToData, displayName) { var cachePath = WWUtil.urlPath(serverAddress + "/" + pathToData); TiledImageLayer.call(this, Sector.FULL_SPHERE, new Location(36, 36), 10, "image/png", cachePath, 512, 512); this.displayName = displayName; this.pickEnabled = false; this.urlBuilder = new LevelRowColumnUrlBuilder(serverAddress, pathToData); }
[ "function", "(", "serverAddress", ",", "pathToData", ",", "displayName", ")", "{", "var", "cachePath", "=", "WWUtil", ".", "urlPath", "(", "serverAddress", "+", "\"/\"", "+", "pathToData", ")", ";", "TiledImageLayer", ".", "call", "(", "this", ",", "Sector", ".", "FULL_SPHERE", ",", "new", "Location", "(", "36", ",", "36", ")", ",", "10", ",", "\"image/png\"", ",", "cachePath", ",", "512", ",", "512", ")", ";", "this", ".", "displayName", "=", "displayName", ";", "this", ".", "pickEnabled", "=", "false", ";", "this", ".", "urlBuilder", "=", "new", "LevelRowColumnUrlBuilder", "(", "serverAddress", ",", "pathToData", ")", ";", "}" ]
Constructs a LandSat image layer that uses a REST interface to retrieve its imagery. @alias LandsatRestLayer @constructor @augments TiledImageLayer @classdesc Displays a LandSat image layer that spans the entire globe. The imagery is obtained from a specified REST tile service. See [LevelRowColumnUrlBuilder]{@link LevelRowColumnUrlBuilder} for a description of the REST interface. @param {String} serverAddress The server address of the tile service. May be null, in which case the current origin is used (see window.location). @param {String} pathToData The path to the data directory relative to the specified server address. May be null, in which case the server address is assumed to be the full path to the data directory. @param {String} displayName The display name to associate with this layer.
[ "Constructs", "a", "LandSat", "image", "layer", "that", "uses", "a", "REST", "interface", "to", "retrieve", "its", "imagery", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/LandsatRestLayer.js#L52-L60
10,538
NASAWorldWind/WebWorldWind
src/globe/Terrain.js
function (globe, tessellator, terrainTiles, verticalExaggeration) { /** * The globe associated with this terrain. * @type {Globe} */ this.globe = globe; /** * The vertical exaggeration of this terrain. * @type {Number} */ this.verticalExaggeration = verticalExaggeration; /** * The sector spanned by this terrain. * @type {Sector} */ this.sector = terrainTiles.sector; /** * The tessellator used to generate this terrain. * @type {Tessellator} */ this.tessellator = tessellator; /** * The surface geometry for this terrain * @type {TerrainTile[]} */ this.surfaceGeometry = terrainTiles.tileArray; /** * A string identifying this terrain's current state. Used to compare states during rendering to * determine whether state dependent cached values must be updated. Applications typically do not * interact with this property. * @readonly * @type {String} */ this.stateKey = globe.stateKey + " ve " + verticalExaggeration.toString(); }
javascript
function (globe, tessellator, terrainTiles, verticalExaggeration) { /** * The globe associated with this terrain. * @type {Globe} */ this.globe = globe; /** * The vertical exaggeration of this terrain. * @type {Number} */ this.verticalExaggeration = verticalExaggeration; /** * The sector spanned by this terrain. * @type {Sector} */ this.sector = terrainTiles.sector; /** * The tessellator used to generate this terrain. * @type {Tessellator} */ this.tessellator = tessellator; /** * The surface geometry for this terrain * @type {TerrainTile[]} */ this.surfaceGeometry = terrainTiles.tileArray; /** * A string identifying this terrain's current state. Used to compare states during rendering to * determine whether state dependent cached values must be updated. Applications typically do not * interact with this property. * @readonly * @type {String} */ this.stateKey = globe.stateKey + " ve " + verticalExaggeration.toString(); }
[ "function", "(", "globe", ",", "tessellator", ",", "terrainTiles", ",", "verticalExaggeration", ")", "{", "/**\n * The globe associated with this terrain.\n * @type {Globe}\n */", "this", ".", "globe", "=", "globe", ";", "/**\n * The vertical exaggeration of this terrain.\n * @type {Number}\n */", "this", ".", "verticalExaggeration", "=", "verticalExaggeration", ";", "/**\n * The sector spanned by this terrain.\n * @type {Sector}\n */", "this", ".", "sector", "=", "terrainTiles", ".", "sector", ";", "/**\n * The tessellator used to generate this terrain.\n * @type {Tessellator}\n */", "this", ".", "tessellator", "=", "tessellator", ";", "/**\n * The surface geometry for this terrain\n * @type {TerrainTile[]}\n */", "this", ".", "surfaceGeometry", "=", "terrainTiles", ".", "tileArray", ";", "/**\n * A string identifying this terrain's current state. Used to compare states during rendering to\n * determine whether state dependent cached values must be updated. Applications typically do not\n * interact with this property.\n * @readonly\n * @type {String}\n */", "this", ".", "stateKey", "=", "globe", ".", "stateKey", "+", "\" ve \"", "+", "verticalExaggeration", ".", "toString", "(", ")", ";", "}" ]
Constructs a Terrain object. @alias Terrain @constructor @classdesc Represents terrain and provides functions for computing points on or relative to the terrain. Applications do not typically interact directly with this class.
[ "Constructs", "a", "Terrain", "object", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/globe/Terrain.js#L37-L77
10,539
NASAWorldWind/WebWorldWind
src/layer/AtmosphereLayer.js
function (nightImageSource) { Layer.call(this, "Atmosphere"); // The atmosphere layer is not pickable. this.pickEnabled = false; //Documented in defineProperties below. this._nightImageSource = nightImageSource || WorldWind.configuration.baseUrl + 'images/dnb_land_ocean_ice_2012.png'; //Internal use only. //The light direction in cartesian space, computed from the layer time or defaults to the eyePoint. this._activeLightDirection = new Vec3(0, 0, 0); this._fullSphereSector = Sector.FULL_SPHERE; //Internal use only. Intentionally not documented. this._skyData = {}; //Internal use only. The number of longitudinal points in the grid for the sky geometry. this._skyWidth = 128; //Internal use only. The number of latitudinal points in the grid for the sky geometry. this._skyHeight = 128; //Internal use only. Number of indices for the sky geometry. this._numIndices = 0; //Internal use only. Texture coordinate matrix used for the night texture. this._texMatrix = Matrix3.fromIdentity(); //Internal use only. The night texture. this._activeTexture = null; }
javascript
function (nightImageSource) { Layer.call(this, "Atmosphere"); // The atmosphere layer is not pickable. this.pickEnabled = false; //Documented in defineProperties below. this._nightImageSource = nightImageSource || WorldWind.configuration.baseUrl + 'images/dnb_land_ocean_ice_2012.png'; //Internal use only. //The light direction in cartesian space, computed from the layer time or defaults to the eyePoint. this._activeLightDirection = new Vec3(0, 0, 0); this._fullSphereSector = Sector.FULL_SPHERE; //Internal use only. Intentionally not documented. this._skyData = {}; //Internal use only. The number of longitudinal points in the grid for the sky geometry. this._skyWidth = 128; //Internal use only. The number of latitudinal points in the grid for the sky geometry. this._skyHeight = 128; //Internal use only. Number of indices for the sky geometry. this._numIndices = 0; //Internal use only. Texture coordinate matrix used for the night texture. this._texMatrix = Matrix3.fromIdentity(); //Internal use only. The night texture. this._activeTexture = null; }
[ "function", "(", "nightImageSource", ")", "{", "Layer", ".", "call", "(", "this", ",", "\"Atmosphere\"", ")", ";", "// The atmosphere layer is not pickable.", "this", ".", "pickEnabled", "=", "false", ";", "//Documented in defineProperties below.", "this", ".", "_nightImageSource", "=", "nightImageSource", "||", "WorldWind", ".", "configuration", ".", "baseUrl", "+", "'images/dnb_land_ocean_ice_2012.png'", ";", "//Internal use only.", "//The light direction in cartesian space, computed from the layer time or defaults to the eyePoint.", "this", ".", "_activeLightDirection", "=", "new", "Vec3", "(", "0", ",", "0", ",", "0", ")", ";", "this", ".", "_fullSphereSector", "=", "Sector", ".", "FULL_SPHERE", ";", "//Internal use only. Intentionally not documented.", "this", ".", "_skyData", "=", "{", "}", ";", "//Internal use only. The number of longitudinal points in the grid for the sky geometry.", "this", ".", "_skyWidth", "=", "128", ";", "//Internal use only. The number of latitudinal points in the grid for the sky geometry.", "this", ".", "_skyHeight", "=", "128", ";", "//Internal use only. Number of indices for the sky geometry.", "this", ".", "_numIndices", "=", "0", ";", "//Internal use only. Texture coordinate matrix used for the night texture.", "this", ".", "_texMatrix", "=", "Matrix3", ".", "fromIdentity", "(", ")", ";", "//Internal use only. The night texture.", "this", ".", "_activeTexture", "=", "null", ";", "}" ]
Constructs a layer showing the Earth's atmosphere. @alias AtmosphereLayer @constructor @classdesc Provides a layer showing the Earth's atmosphere. @param {URL} nightImageSource optional url for the night texture. @augments Layer
[ "Constructs", "a", "layer", "showing", "the", "Earth", "s", "atmosphere", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/AtmosphereLayer.js#L54-L87
10,540
NASAWorldWind/WebWorldWind
src/gesture/GestureRecognizer.js
function (target, callback) { if (!target) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "GestureRecognizer", "constructor", "missingTarget")); } /** * Indicates the document element this gesture recognizer observes for UI events. * @type {EventTarget} * @readonly */ this.target = target; /** * Indicates whether or not this gesture recognizer is enabled. When false, this gesture recognizer will * ignore any events dispatched by its target. * @type {Boolean} * @default true */ this.enabled = true; // Documented with its property accessor below. this._state = WorldWind.POSSIBLE; // Intentionally not documented. this._nextState = null; // Documented with its property accessor below. this._clientX = 0; // Documented with its property accessor below. this._clientY = 0; // Intentionally not documented. this._clientStartX = 0; // Intentionally not documented. this._clientStartY = 0; // Documented with its property accessor below. this._translationX = 0; // Documented with its property accessor below. this._translationY = 0; // Intentionally not documented. this._translationWeight = 0.4; // Documented with its property accessor below. this._mouseButtonMask = 0; // Intentionally not documented. this._touches = []; // Intentionally not documented. this._touchCentroidShiftX = 0; // Intentionally not documented. this._touchCentroidShiftY = 0; // Documented with its property accessor below. this._gestureCallbacks = []; // Intentionally not documented. this._canRecognizeWith = []; // Intentionally not documented. this._requiresFailureOf = []; // Intentionally not documented. this._requiredToFailBy = []; // Add the optional gesture callback. if (callback) { this._gestureCallbacks.push(callback); } // Intentionally not documented. this.listenerList = []; // Add this recognizer to the list of all recognizers. GestureRecognizer.allRecognizers.push(this); }
javascript
function (target, callback) { if (!target) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "GestureRecognizer", "constructor", "missingTarget")); } /** * Indicates the document element this gesture recognizer observes for UI events. * @type {EventTarget} * @readonly */ this.target = target; /** * Indicates whether or not this gesture recognizer is enabled. When false, this gesture recognizer will * ignore any events dispatched by its target. * @type {Boolean} * @default true */ this.enabled = true; // Documented with its property accessor below. this._state = WorldWind.POSSIBLE; // Intentionally not documented. this._nextState = null; // Documented with its property accessor below. this._clientX = 0; // Documented with its property accessor below. this._clientY = 0; // Intentionally not documented. this._clientStartX = 0; // Intentionally not documented. this._clientStartY = 0; // Documented with its property accessor below. this._translationX = 0; // Documented with its property accessor below. this._translationY = 0; // Intentionally not documented. this._translationWeight = 0.4; // Documented with its property accessor below. this._mouseButtonMask = 0; // Intentionally not documented. this._touches = []; // Intentionally not documented. this._touchCentroidShiftX = 0; // Intentionally not documented. this._touchCentroidShiftY = 0; // Documented with its property accessor below. this._gestureCallbacks = []; // Intentionally not documented. this._canRecognizeWith = []; // Intentionally not documented. this._requiresFailureOf = []; // Intentionally not documented. this._requiredToFailBy = []; // Add the optional gesture callback. if (callback) { this._gestureCallbacks.push(callback); } // Intentionally not documented. this.listenerList = []; // Add this recognizer to the list of all recognizers. GestureRecognizer.allRecognizers.push(this); }
[ "function", "(", "target", ",", "callback", ")", "{", "if", "(", "!", "target", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"GestureRecognizer\"", ",", "\"constructor\"", ",", "\"missingTarget\"", ")", ")", ";", "}", "/**\n * Indicates the document element this gesture recognizer observes for UI events.\n * @type {EventTarget}\n * @readonly\n */", "this", ".", "target", "=", "target", ";", "/**\n * Indicates whether or not this gesture recognizer is enabled. When false, this gesture recognizer will\n * ignore any events dispatched by its target.\n * @type {Boolean}\n * @default true\n */", "this", ".", "enabled", "=", "true", ";", "// Documented with its property accessor below.", "this", ".", "_state", "=", "WorldWind", ".", "POSSIBLE", ";", "// Intentionally not documented.", "this", ".", "_nextState", "=", "null", ";", "// Documented with its property accessor below.", "this", ".", "_clientX", "=", "0", ";", "// Documented with its property accessor below.", "this", ".", "_clientY", "=", "0", ";", "// Intentionally not documented.", "this", ".", "_clientStartX", "=", "0", ";", "// Intentionally not documented.", "this", ".", "_clientStartY", "=", "0", ";", "// Documented with its property accessor below.", "this", ".", "_translationX", "=", "0", ";", "// Documented with its property accessor below.", "this", ".", "_translationY", "=", "0", ";", "// Intentionally not documented.", "this", ".", "_translationWeight", "=", "0.4", ";", "// Documented with its property accessor below.", "this", ".", "_mouseButtonMask", "=", "0", ";", "// Intentionally not documented.", "this", ".", "_touches", "=", "[", "]", ";", "// Intentionally not documented.", "this", ".", "_touchCentroidShiftX", "=", "0", ";", "// Intentionally not documented.", "this", ".", "_touchCentroidShiftY", "=", "0", ";", "// Documented with its property accessor below.", "this", ".", "_gestureCallbacks", "=", "[", "]", ";", "// Intentionally not documented.", "this", ".", "_canRecognizeWith", "=", "[", "]", ";", "// Intentionally not documented.", "this", ".", "_requiresFailureOf", "=", "[", "]", ";", "// Intentionally not documented.", "this", ".", "_requiredToFailBy", "=", "[", "]", ";", "// Add the optional gesture callback.", "if", "(", "callback", ")", "{", "this", ".", "_gestureCallbacks", ".", "push", "(", "callback", ")", ";", "}", "// Intentionally not documented.", "this", ".", "listenerList", "=", "[", "]", ";", "// Add this recognizer to the list of all recognizers.", "GestureRecognizer", ".", "allRecognizers", ".", "push", "(", "this", ")", ";", "}" ]
Constructs a base gesture recognizer. This is an abstract base class and not intended to be instantiated directly. @alias GestureRecognizer @constructor @classdesc Gesture recognizers translate user input event streams into higher level actions. A gesture recognizer is associated with an event target, which dispatches mouse and keyboard events to the gesture recognizer. When a gesture recognizer has received enough information from the event stream to interpret the action, it calls its callback functions. Callback functions may be specified at construction or added to the [gestureCallbacks]{@link GestureRecognizer#gestureCallbacks} list after construction. @param {EventTarget} target The document element this gesture recognizer observes for mouse and touch events. @param {Function} callback An optional function to call when this gesture is recognized. If non-null, the function is called when this gesture is recognized, and is passed a single argument: this gesture recognizer, e.g., <code>gestureCallback(recognizer)</code>. @throws {ArgumentError} If the specified target is null or undefined. TODO: evaluate target usage
[ "Constructs", "a", "base", "gesture", "recognizer", ".", "This", "is", "an", "abstract", "base", "class", "and", "not", "intended", "to", "be", "instantiated", "directly", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/gesture/GestureRecognizer.js#L47-L129
10,541
NASAWorldWind/WebWorldWind
src/geom/Sector.js
function (minLatitude, maxLatitude, minLongitude, maxLongitude) { /** * This sector's minimum latitude in degrees. * @type {Number} */ this.minLatitude = minLatitude; /** * This sector's maximum latitude in degrees. * @type {Number} */ this.maxLatitude = maxLatitude; /** * This sector's minimum longitude in degrees. * @type {Number} */ this.minLongitude = minLongitude; /** * This sector's maximum longitude in degrees. * @type {Number} */ this.maxLongitude = maxLongitude; }
javascript
function (minLatitude, maxLatitude, minLongitude, maxLongitude) { /** * This sector's minimum latitude in degrees. * @type {Number} */ this.minLatitude = minLatitude; /** * This sector's maximum latitude in degrees. * @type {Number} */ this.maxLatitude = maxLatitude; /** * This sector's minimum longitude in degrees. * @type {Number} */ this.minLongitude = minLongitude; /** * This sector's maximum longitude in degrees. * @type {Number} */ this.maxLongitude = maxLongitude; }
[ "function", "(", "minLatitude", ",", "maxLatitude", ",", "minLongitude", ",", "maxLongitude", ")", "{", "/**\n * This sector's minimum latitude in degrees.\n * @type {Number}\n */", "this", ".", "minLatitude", "=", "minLatitude", ";", "/**\n * This sector's maximum latitude in degrees.\n * @type {Number}\n */", "this", ".", "maxLatitude", "=", "maxLatitude", ";", "/**\n * This sector's minimum longitude in degrees.\n * @type {Number}\n */", "this", ".", "minLongitude", "=", "minLongitude", ";", "/**\n * This sector's maximum longitude in degrees.\n * @type {Number}\n */", "this", ".", "maxLongitude", "=", "maxLongitude", ";", "}" ]
Constructs a Sector from specified minimum and maximum latitudes and longitudes in degrees. @alias Sector @constructor @classdesc Represents a rectangular region in geographic coordinates in degrees. @param {Number} minLatitude The sector's minimum latitude in degrees. @param {Number} maxLatitude The sector's maximum latitude in degrees. @param {Number} minLongitude The sector's minimum longitude in degrees. @param {Number} maxLongitude The sector's maximum longitude in degrees.
[ "Constructs", "a", "Sector", "from", "specified", "minimum", "and", "maximum", "latitudes", "and", "longitudes", "in", "degrees", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/geom/Sector.js#L46-L67
10,542
NASAWorldWind/WebWorldWind
src/layer/heatmap/HeatMapColoredTile.js
function(data, options) { HeatMapTile.call(this, data, options); this._extendedWidth = options.extendedWidth; this._extendedHeight = options.extendedHeight; this._gradient = this.gradient(options.intensityGradient); }
javascript
function(data, options) { HeatMapTile.call(this, data, options); this._extendedWidth = options.extendedWidth; this._extendedHeight = options.extendedHeight; this._gradient = this.gradient(options.intensityGradient); }
[ "function", "(", "data", ",", "options", ")", "{", "HeatMapTile", ".", "call", "(", "this", ",", "data", ",", "options", ")", ";", "this", ".", "_extendedWidth", "=", "options", ".", "extendedWidth", ";", "this", ".", "_extendedHeight", "=", "options", ".", "extendedHeight", ";", "this", ".", "_gradient", "=", "this", ".", "gradient", "(", "options", ".", "intensityGradient", ")", ";", "}" ]
Constructs a HeatMapColoredTile. The default implementation using the shades of gray to draw the information produced by the HeatMapTile is a source for coloring. This class colours the provided canvas based on the information contained in the intensityGradient. @inheritDoc @alias HeatMapColoredTile @constructor @augments HeatMapTile @classdesc Tile for the HeatMap layer visualising data on a canvas using colour scale. @param options.intensityGradient {Object} Keys represent the opacity between 0 and 1 and the values represent color strings. @param options.extendedWidth {Number} Optional. Minimal width that needs to be retrieved for colorization. @param options.extendedHeight {Number} Optional. Minimal height that needs to be retrieved for colorization.
[ "Constructs", "a", "HeatMapColoredTile", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/heatmap/HeatMapColoredTile.js#L37-L43
10,543
NASAWorldWind/WebWorldWind
src/shapes/SurfaceImage.js
function (sector, imageSource) { if (!sector) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceImage", "constructor", "missingSector")); } if (!imageSource) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceImage", "constructor", "missingImage")); } SurfaceTile.call(this, sector); /** * Indicates whether this surface image is drawn. * @type {boolean} * @default true */ this.enabled = true; /** * The path to the image. * @type {String} */ this._imageSource = imageSource; /** * This surface image's resampling mode. Indicates the sampling algorithm used to display this image when it * is larger on screen than its native resolution. May be one of: * <ul> * <li>WorldWind.FILTER_LINEAR</li> * <li>WorldWind.FILTER_NEAREST</li> * </ul> * @default WorldWind.FILTER_LINEAR */ this.resamplingMode = WorldWind.FILTER_LINEAR; /** * This surface image's opacity. When this surface image is drawn, the actual opacity is the product of * this opacity and the opacity of the layer containing this surface image. * @type {number} */ this.opacity = 1; /** * This surface image's display name; * @type {string} */ this.displayName = "Surface Image"; // Internal. Indicates whether the image needs to be updated in the GPU resource cache. this.imageSourceWasUpdated = true; }
javascript
function (sector, imageSource) { if (!sector) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceImage", "constructor", "missingSector")); } if (!imageSource) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceImage", "constructor", "missingImage")); } SurfaceTile.call(this, sector); /** * Indicates whether this surface image is drawn. * @type {boolean} * @default true */ this.enabled = true; /** * The path to the image. * @type {String} */ this._imageSource = imageSource; /** * This surface image's resampling mode. Indicates the sampling algorithm used to display this image when it * is larger on screen than its native resolution. May be one of: * <ul> * <li>WorldWind.FILTER_LINEAR</li> * <li>WorldWind.FILTER_NEAREST</li> * </ul> * @default WorldWind.FILTER_LINEAR */ this.resamplingMode = WorldWind.FILTER_LINEAR; /** * This surface image's opacity. When this surface image is drawn, the actual opacity is the product of * this opacity and the opacity of the layer containing this surface image. * @type {number} */ this.opacity = 1; /** * This surface image's display name; * @type {string} */ this.displayName = "Surface Image"; // Internal. Indicates whether the image needs to be updated in the GPU resource cache. this.imageSourceWasUpdated = true; }
[ "function", "(", "sector", ",", "imageSource", ")", "{", "if", "(", "!", "sector", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"SurfaceImage\"", ",", "\"constructor\"", ",", "\"missingSector\"", ")", ")", ";", "}", "if", "(", "!", "imageSource", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"SurfaceImage\"", ",", "\"constructor\"", ",", "\"missingImage\"", ")", ")", ";", "}", "SurfaceTile", ".", "call", "(", "this", ",", "sector", ")", ";", "/**\n * Indicates whether this surface image is drawn.\n * @type {boolean}\n * @default true\n */", "this", ".", "enabled", "=", "true", ";", "/**\n * The path to the image.\n * @type {String}\n */", "this", ".", "_imageSource", "=", "imageSource", ";", "/**\n * This surface image's resampling mode. Indicates the sampling algorithm used to display this image when it\n * is larger on screen than its native resolution. May be one of:\n * <ul>\n * <li>WorldWind.FILTER_LINEAR</li>\n * <li>WorldWind.FILTER_NEAREST</li>\n * </ul>\n * @default WorldWind.FILTER_LINEAR\n */", "this", ".", "resamplingMode", "=", "WorldWind", ".", "FILTER_LINEAR", ";", "/**\n * This surface image's opacity. When this surface image is drawn, the actual opacity is the product of\n * this opacity and the opacity of the layer containing this surface image.\n * @type {number}\n */", "this", ".", "opacity", "=", "1", ";", "/**\n * This surface image's display name;\n * @type {string}\n */", "this", ".", "displayName", "=", "\"Surface Image\"", ";", "// Internal. Indicates whether the image needs to be updated in the GPU resource cache.", "this", ".", "imageSourceWasUpdated", "=", "true", ";", "}" ]
Constructs a surface image shape for a specified sector and image path. @alias SurfaceImage @constructor @augments SurfaceTile @classdesc Represents an image drawn on the terrain. @param {Sector} sector The sector spanned by this surface image. @param {String|ImageSource} imageSource The image source of the image to draw on the terrain. May be either a string identifying the URL of the image, or an {@link ImageSource} object identifying a dynamically created image. @throws {ArgumentError} If either the specified sector or image source is null or undefined.
[ "Constructs", "a", "surface", "image", "shape", "for", "a", "specified", "sector", "and", "image", "path", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/shapes/SurfaceImage.js#L44-L96
10,544
NASAWorldWind/WebWorldWind
src/formats/aaigrid/AAIGridMetadata.js
function () { // Documented in defineProperties below. this._ncols = null; // Documented in defineProperties below. this._nrows = null; // Documented in defineProperties below. this._xllcorner = null; // Documented in defineProperties below. this._yllcorner = null; // Documented in defineProperties below. this._cellsize = null; // Documented in defineProperties below. this._NODATA_value = undefined; }
javascript
function () { // Documented in defineProperties below. this._ncols = null; // Documented in defineProperties below. this._nrows = null; // Documented in defineProperties below. this._xllcorner = null; // Documented in defineProperties below. this._yllcorner = null; // Documented in defineProperties below. this._cellsize = null; // Documented in defineProperties below. this._NODATA_value = undefined; }
[ "function", "(", ")", "{", "// Documented in defineProperties below.", "this", ".", "_ncols", "=", "null", ";", "// Documented in defineProperties below.", "this", ".", "_nrows", "=", "null", ";", "// Documented in defineProperties below.", "this", ".", "_xllcorner", "=", "null", ";", "// Documented in defineProperties below.", "this", ".", "_yllcorner", "=", "null", ";", "// Documented in defineProperties below.", "this", ".", "_cellsize", "=", "null", ";", "// Documented in defineProperties below.", "this", ".", "_NODATA_value", "=", "undefined", ";", "}" ]
Constructs a new container for AAIGrid metadata. @alias AAIGridMetadata @constructor @classdesc Contains the metadata for an AAIGrid file.
[ "Constructs", "a", "new", "container", "for", "AAIGrid", "metadata", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/aaigrid/AAIGridMetadata.js#L30-L48
10,545
NASAWorldWind/WebWorldWind
src/render/FramebufferTileController.js
function () { /** * The width in pixels of framebuffers associated with this controller's tiles. * @type {Number} * @readonly */ this.tileWidth = 256; /** * The height in pixels of framebuffers associated with this controller's tiles. * @type {Number} * @readonly */ this.tileHeight = 256; /** * Controls the level of detail switching for this controller. The next highest resolution level is * used when an image's texel size is greater than this number of pixels. * @type {Number} * @default 1.75 */ this.detailControl = 1.75; // Internal. Intentionally not documented. this.levels = new LevelSet(Sector.FULL_SPHERE, new Location(45, 45), 16, this.tileWidth, this.tileHeight); // Internal. Intentionally not documented. this.topLevelTiles = []; // Internal. Intentionally not documented. this.currentTiles = []; // Internal. Intentionally not documented. this.currentTimestamp = null; // Internal. Intentionally not documented. this.currentGlobeStateKey = null; // Internal. Intentionally not documented. this.tileCache = new MemoryCache(500000, 400000); // Internal. Intentionally not documented. this.key = "FramebufferTileController " + ++FramebufferTileController.keyPool; }
javascript
function () { /** * The width in pixels of framebuffers associated with this controller's tiles. * @type {Number} * @readonly */ this.tileWidth = 256; /** * The height in pixels of framebuffers associated with this controller's tiles. * @type {Number} * @readonly */ this.tileHeight = 256; /** * Controls the level of detail switching for this controller. The next highest resolution level is * used when an image's texel size is greater than this number of pixels. * @type {Number} * @default 1.75 */ this.detailControl = 1.75; // Internal. Intentionally not documented. this.levels = new LevelSet(Sector.FULL_SPHERE, new Location(45, 45), 16, this.tileWidth, this.tileHeight); // Internal. Intentionally not documented. this.topLevelTiles = []; // Internal. Intentionally not documented. this.currentTiles = []; // Internal. Intentionally not documented. this.currentTimestamp = null; // Internal. Intentionally not documented. this.currentGlobeStateKey = null; // Internal. Intentionally not documented. this.tileCache = new MemoryCache(500000, 400000); // Internal. Intentionally not documented. this.key = "FramebufferTileController " + ++FramebufferTileController.keyPool; }
[ "function", "(", ")", "{", "/**\n * The width in pixels of framebuffers associated with this controller's tiles.\n * @type {Number}\n * @readonly\n */", "this", ".", "tileWidth", "=", "256", ";", "/**\n * The height in pixels of framebuffers associated with this controller's tiles.\n * @type {Number}\n * @readonly\n */", "this", ".", "tileHeight", "=", "256", ";", "/**\n * Controls the level of detail switching for this controller. The next highest resolution level is\n * used when an image's texel size is greater than this number of pixels.\n * @type {Number}\n * @default 1.75\n */", "this", ".", "detailControl", "=", "1.75", ";", "// Internal. Intentionally not documented.", "this", ".", "levels", "=", "new", "LevelSet", "(", "Sector", ".", "FULL_SPHERE", ",", "new", "Location", "(", "45", ",", "45", ")", ",", "16", ",", "this", ".", "tileWidth", ",", "this", ".", "tileHeight", ")", ";", "// Internal. Intentionally not documented.", "this", ".", "topLevelTiles", "=", "[", "]", ";", "// Internal. Intentionally not documented.", "this", ".", "currentTiles", "=", "[", "]", ";", "// Internal. Intentionally not documented.", "this", ".", "currentTimestamp", "=", "null", ";", "// Internal. Intentionally not documented.", "this", ".", "currentGlobeStateKey", "=", "null", ";", "// Internal. Intentionally not documented.", "this", ".", "tileCache", "=", "new", "MemoryCache", "(", "500000", ",", "400000", ")", ";", "// Internal. Intentionally not documented.", "this", ".", "key", "=", "\"FramebufferTileController \"", "+", "++", "FramebufferTileController", ".", "keyPool", ";", "}" ]
Constructs a framebuffer tile controller. @alias FramebufferTileController @constructor @classdesc Provides access to a multi-resolution WebGL framebuffer arranged as adjacent tiles in a pyramid. WorldWind shapes use this class internally to draw on the terrain surface. Applications typically do not interact with this class.
[ "Constructs", "a", "framebuffer", "tile", "controller", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/render/FramebufferTileController.js#L48-L92
10,546
NASAWorldWind/WebWorldWind
src/formats/kml/util/KmlNodeTransformers.js
getTextOfNode
function getTextOfNode(node) { var result; if (node != null && node.childNodes[0]) { result = node.childNodes[0].nodeValue; } else if (node != null) { result = ""; } return result; }
javascript
function getTextOfNode(node) { var result; if (node != null && node.childNodes[0]) { result = node.childNodes[0].nodeValue; } else if (node != null) { result = ""; } return result; }
[ "function", "getTextOfNode", "(", "node", ")", "{", "var", "result", ";", "if", "(", "node", "!=", "null", "&&", "node", ".", "childNodes", "[", "0", "]", ")", "{", "result", "=", "node", ".", "childNodes", "[", "0", "]", ".", "nodeValue", ";", "}", "else", "if", "(", "node", "!=", "null", ")", "{", "result", "=", "\"\"", ";", "}", "return", "result", ";", "}" ]
This function retrieves the current value for node. @param node {Node} Node for which we want to retrieve the value. @returns {String} Text value of the node.
[ "This", "function", "retrieves", "the", "current", "value", "for", "node", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/kml/util/KmlNodeTransformers.js#L74-L82
10,547
NASAWorldWind/WebWorldWind
src/gesture/ClickRecognizer.js
function (target, callback) { GestureRecognizer.call(this, target, callback); /** * * @type {Number} */ this.numberOfClicks = 1; /** * * @type {Number} */ this.button = 0; // Intentionally not documented. this.maxMouseMovement = 5; // Intentionally not documented. this.maxClickDuration = 500; // Intentionally not documented. this.maxClickInterval = 400; // Intentionally not documented. this.clicks = []; // Intentionally not documented. this.timeout = null; }
javascript
function (target, callback) { GestureRecognizer.call(this, target, callback); /** * * @type {Number} */ this.numberOfClicks = 1; /** * * @type {Number} */ this.button = 0; // Intentionally not documented. this.maxMouseMovement = 5; // Intentionally not documented. this.maxClickDuration = 500; // Intentionally not documented. this.maxClickInterval = 400; // Intentionally not documented. this.clicks = []; // Intentionally not documented. this.timeout = null; }
[ "function", "(", "target", ",", "callback", ")", "{", "GestureRecognizer", ".", "call", "(", "this", ",", "target", ",", "callback", ")", ";", "/**\n *\n * @type {Number}\n */", "this", ".", "numberOfClicks", "=", "1", ";", "/**\n *\n * @type {Number}\n */", "this", ".", "button", "=", "0", ";", "// Intentionally not documented.", "this", ".", "maxMouseMovement", "=", "5", ";", "// Intentionally not documented.", "this", ".", "maxClickDuration", "=", "500", ";", "// Intentionally not documented.", "this", ".", "maxClickInterval", "=", "400", ";", "// Intentionally not documented.", "this", ".", "clicks", "=", "[", "]", ";", "// Intentionally not documented.", "this", ".", "timeout", "=", "null", ";", "}" ]
Constructs a mouse click gesture recognizer. @alias ClickRecognizer @constructor @augments GestureRecognizer @classdesc A concrete gesture recognizer subclass that looks for single or multiple mouse clicks. @param {EventTarget} target The document element this gesture recognizer observes for mouse and touch events. @param {Function} callback An optional function to call when this gesture is recognized. If non-null, the function is called when this gesture is recognized, and is passed a single argument: this gesture recognizer, e.g., <code>gestureCallback(recognizer)</code>. @throws {ArgumentError} If the specified target is null or undefined.
[ "Constructs", "a", "mouse", "click", "gesture", "recognizer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/gesture/ClickRecognizer.js#L36-L65
10,548
NASAWorldWind/WebWorldWind
src/util/PeriodicTimeSequence.js
function (sequenceString) { if (!sequenceString) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "PeriodicTimeSequence", "constructor", "missingString")); } var intervalParts = sequenceString.split("/"); if (intervalParts.length !== 3) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "PeriodicTimeSequence", "constructor", "The interval string " + sequenceString + " does not contain 3 elements.")); } /** * This sequence's sequence string, as specified to the constructor. * @type {String} * @readonly */ this.sequenceString = sequenceString; /** * This sequence's start time. * @type {Date} * @readonly */ this.startTime = new Date(intervalParts[0]); /** * This sequence's end time. * @type {Date} * @readonly */ this.endTime = new Date(intervalParts[1]); // Intentionally not documented. this.intervalMilliseconds = this.endTime.getTime() - this.startTime.getTime(); // Documented with property accessor below. this._currentTime = this.startTime; /** * Indicates whether this sequence is an infinite sequence -- the start and end dates are the same. * @type {Boolean} * @readonly */ this.infiniteInterval = this.startTime.getTime() == this.endTime.getTime(); // Intentionally not documented. The array of sequence increments: // year, month, week, day, hours, minutes, seconds this.period = PeriodicTimeSequence.parsePeriodString(intervalParts[2], false); }
javascript
function (sequenceString) { if (!sequenceString) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "PeriodicTimeSequence", "constructor", "missingString")); } var intervalParts = sequenceString.split("/"); if (intervalParts.length !== 3) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "PeriodicTimeSequence", "constructor", "The interval string " + sequenceString + " does not contain 3 elements.")); } /** * This sequence's sequence string, as specified to the constructor. * @type {String} * @readonly */ this.sequenceString = sequenceString; /** * This sequence's start time. * @type {Date} * @readonly */ this.startTime = new Date(intervalParts[0]); /** * This sequence's end time. * @type {Date} * @readonly */ this.endTime = new Date(intervalParts[1]); // Intentionally not documented. this.intervalMilliseconds = this.endTime.getTime() - this.startTime.getTime(); // Documented with property accessor below. this._currentTime = this.startTime; /** * Indicates whether this sequence is an infinite sequence -- the start and end dates are the same. * @type {Boolean} * @readonly */ this.infiniteInterval = this.startTime.getTime() == this.endTime.getTime(); // Intentionally not documented. The array of sequence increments: // year, month, week, day, hours, minutes, seconds this.period = PeriodicTimeSequence.parsePeriodString(intervalParts[2], false); }
[ "function", "(", "sequenceString", ")", "{", "if", "(", "!", "sequenceString", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"PeriodicTimeSequence\"", ",", "\"constructor\"", ",", "\"missingString\"", ")", ")", ";", "}", "var", "intervalParts", "=", "sequenceString", ".", "split", "(", "\"/\"", ")", ";", "if", "(", "intervalParts", ".", "length", "!==", "3", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"PeriodicTimeSequence\"", ",", "\"constructor\"", ",", "\"The interval string \"", "+", "sequenceString", "+", "\" does not contain 3 elements.\"", ")", ")", ";", "}", "/**\n * This sequence's sequence string, as specified to the constructor.\n * @type {String}\n * @readonly\n */", "this", ".", "sequenceString", "=", "sequenceString", ";", "/**\n * This sequence's start time.\n * @type {Date}\n * @readonly\n */", "this", ".", "startTime", "=", "new", "Date", "(", "intervalParts", "[", "0", "]", ")", ";", "/**\n * This sequence's end time.\n * @type {Date}\n * @readonly\n */", "this", ".", "endTime", "=", "new", "Date", "(", "intervalParts", "[", "1", "]", ")", ";", "// Intentionally not documented.", "this", ".", "intervalMilliseconds", "=", "this", ".", "endTime", ".", "getTime", "(", ")", "-", "this", ".", "startTime", ".", "getTime", "(", ")", ";", "// Documented with property accessor below.", "this", ".", "_currentTime", "=", "this", ".", "startTime", ";", "/**\n * Indicates whether this sequence is an infinite sequence -- the start and end dates are the same.\n * @type {Boolean}\n * @readonly\n */", "this", ".", "infiniteInterval", "=", "this", ".", "startTime", ".", "getTime", "(", ")", "==", "this", ".", "endTime", ".", "getTime", "(", ")", ";", "// Intentionally not documented. The array of sequence increments:", "// year, month, week, day, hours, minutes, seconds", "this", ".", "period", "=", "PeriodicTimeSequence", ".", "parsePeriodString", "(", "intervalParts", "[", "2", "]", ",", "false", ")", ";", "}" ]
Constructs a time sequence from an ISO 8601 string. @alias PeriodicTimeSequence @constructor @classdesc Represents a time sequence described as an ISO 8601 time-format string as required by WMS. The string must be in the form start/end/period, where start and end are ISO 8601 time values and period is an ISO 8601 period specification. This class provides iteration over the sequence in steps specified by the period. If the start and end dates are different, iteration will start at the start date and end at the end date. If the start and end dates are the same, iteration will start at the specified date and will never end. @param {String} sequenceString The string describing the time sequence. @throws {ArgumentError} If the specified intervalString is null, undefined or not a valid time interval string.
[ "Constructs", "a", "time", "sequence", "from", "an", "ISO", "8601", "string", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PeriodicTimeSequence.js#L42-L92
10,549
NASAWorldWind/WebWorldWind
src/util/Offset.js
function (xUnits, x, yUnits, y) { /** * The offset in the X dimension, interpreted according to this instance's xUnits argument. * @type {Number} */ this.x = x; /** * The offset in the Y dimension, interpreted according to this instance's yUnits argument. * @type {Number} */ this.y = y; /** * The units of this instance's X offset. See this class' constructor description for a list of the * possible values. * @type {String} */ this.xUnits = xUnits; /** * The units of this instance's Y offset. See this class' constructor description for a list of the * possible values. * @type {String} */ this.yUnits = yUnits; }
javascript
function (xUnits, x, yUnits, y) { /** * The offset in the X dimension, interpreted according to this instance's xUnits argument. * @type {Number} */ this.x = x; /** * The offset in the Y dimension, interpreted according to this instance's yUnits argument. * @type {Number} */ this.y = y; /** * The units of this instance's X offset. See this class' constructor description for a list of the * possible values. * @type {String} */ this.xUnits = xUnits; /** * The units of this instance's Y offset. See this class' constructor description for a list of the * possible values. * @type {String} */ this.yUnits = yUnits; }
[ "function", "(", "xUnits", ",", "x", ",", "yUnits", ",", "y", ")", "{", "/**\n * The offset in the X dimension, interpreted according to this instance's xUnits argument.\n * @type {Number}\n */", "this", ".", "x", "=", "x", ";", "/**\n * The offset in the Y dimension, interpreted according to this instance's yUnits argument.\n * @type {Number}\n */", "this", ".", "y", "=", "y", ";", "/**\n * The units of this instance's X offset. See this class' constructor description for a list of the\n * possible values.\n * @type {String}\n */", "this", ".", "xUnits", "=", "xUnits", ";", "/**\n * The units of this instance's Y offset. See this class' constructor description for a list of the\n * possible values.\n * @type {String}\n */", "this", ".", "yUnits", "=", "yUnits", ";", "}" ]
Constructs an offset instance given specified units and offsets. @alias Offset @constructor @classdesc Specifies an offset relative to a rectangle. Used by [Placemark]{@link Placemark} and other shapes. @param {String} xUnits The type of units specified for the X dimension. May be one of the following: <ul> <li>[WorldWind.OFFSET_FRACTION]{@link WorldWind#OFFSET_FRACTION}</li> <li>[WorldWind.OFFSET_INSET_PIXELS]{@link WorldWind#OFFSET_INSET_PIXELS}</li> <li>[WorldWind.OFFSET_PIXELS]{@link WorldWind#OFFSET_PIXELS}</li> </ul> @param {Number} x The offset in the X dimension. @param {String} yUnits The type of units specified for the Y dimension, assuming a lower-left Y origin. May be one of the following: <ul> <li>[WorldWind.OFFSET_FRACTION]{@link WorldWind#OFFSET_FRACTION}</li> <li>[WorldWind.OFFSET_INSET_PIXELS]{@link WorldWind#OFFSET_INSET_PIXELS}</li> <li>[WorldWind.OFFSET_PIXELS]{@link WorldWind#OFFSET_PIXELS}</li> </ul> @param {Number} y The offset in the Y dimension.
[ "Constructs", "an", "offset", "instance", "given", "specified", "units", "and", "offsets", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/Offset.js#L47-L74
10,550
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (xmlNode) { if (!xmlNode) { return null; } var text = xmlNode.textContent; text = text.replace(/\n/gi, " "); text = text.replace(/\s+/gi, " "); text = text.trim(); if (text.length === 0) { return null; } return text.split(" "); }
javascript
function (xmlNode) { if (!xmlNode) { return null; } var text = xmlNode.textContent; text = text.replace(/\n/gi, " "); text = text.replace(/\s+/gi, " "); text = text.trim(); if (text.length === 0) { return null; } return text.split(" "); }
[ "function", "(", "xmlNode", ")", "{", "if", "(", "!", "xmlNode", ")", "{", "return", "null", ";", "}", "var", "text", "=", "xmlNode", ".", "textContent", ";", "text", "=", "text", ".", "replace", "(", "/", "\\n", "/", "gi", ",", "\" \"", ")", ";", "text", "=", "text", ".", "replace", "(", "/", "\\s+", "/", "gi", ",", "\" \"", ")", ";", "text", "=", "text", ".", "trim", "(", ")", ";", "if", "(", "text", ".", "length", "===", "0", ")", "{", "return", "null", ";", "}", "return", "text", ".", "split", "(", "\" \"", ")", ";", "}" ]
Packs data from a node in an array. Internal. Applications should not call this function. @param {Node} xmlNode A node from which to extract values.
[ "Packs", "data", "from", "a", "node", "in", "an", "array", ".", "Internal", ".", "Applications", "should", "not", "call", "this", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L32-L47
10,551
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (xmlNode) { var rawValues = this.getRawValues(xmlNode); if (!rawValues) { return null; } var len = rawValues.length; var bufferData = new Float32Array(len); for (var i = 0; i < len; i++) { bufferData[i] = parseFloat(rawValues[i]); } return bufferData; }
javascript
function (xmlNode) { var rawValues = this.getRawValues(xmlNode); if (!rawValues) { return null; } var len = rawValues.length; var bufferData = new Float32Array(len); for (var i = 0; i < len; i++) { bufferData[i] = parseFloat(rawValues[i]); } return bufferData; }
[ "function", "(", "xmlNode", ")", "{", "var", "rawValues", "=", "this", ".", "getRawValues", "(", "xmlNode", ")", ";", "if", "(", "!", "rawValues", ")", "{", "return", "null", ";", "}", "var", "len", "=", "rawValues", ".", "length", ";", "var", "bufferData", "=", "new", "Float32Array", "(", "len", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "bufferData", "[", "i", "]", "=", "parseFloat", "(", "rawValues", "[", "i", "]", ")", ";", "}", "return", "bufferData", ";", "}" ]
Packs data from a node as a Float32Array. Internal. Applications should not call this function. @param {Node} xmlNode A node from which to extract values.
[ "Packs", "data", "from", "a", "node", "as", "a", "Float32Array", ".", "Internal", ".", "Applications", "should", "not", "call", "this", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L54-L69
10,552
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (xmlNode) { var rawValues = this.getRawValues(xmlNode); if (!rawValues) { return null; } var len = rawValues.length; var bufferData = new Uint32Array(len); for (var i = 0; i < len; i++) { bufferData[i] = parseInt(rawValues[i]); } return bufferData; }
javascript
function (xmlNode) { var rawValues = this.getRawValues(xmlNode); if (!rawValues) { return null; } var len = rawValues.length; var bufferData = new Uint32Array(len); for (var i = 0; i < len; i++) { bufferData[i] = parseInt(rawValues[i]); } return bufferData; }
[ "function", "(", "xmlNode", ")", "{", "var", "rawValues", "=", "this", ".", "getRawValues", "(", "xmlNode", ")", ";", "if", "(", "!", "rawValues", ")", "{", "return", "null", ";", "}", "var", "len", "=", "rawValues", ".", "length", ";", "var", "bufferData", "=", "new", "Uint32Array", "(", "len", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "bufferData", "[", "i", "]", "=", "parseInt", "(", "rawValues", "[", "i", "]", ")", ";", "}", "return", "bufferData", ";", "}" ]
Packs data from a node as a UInt32Array. Internal. Applications should not call this function. @param {Node} xmlNode A node from which to extract values.
[ "Packs", "data", "from", "a", "node", "as", "a", "UInt32Array", ".", "Internal", ".", "Applications", "should", "not", "call", "this", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L76-L91
10,553
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (xmlNode, nodeName) { var childs = xmlNode.childNodes; for (var i = 0; i < childs.length; ++i) { var item = childs.item(i); if (item.nodeType !== 1) { continue; } if ((item.nodeName && !nodeName) || (nodeName && nodeName === item.nodeName)) { return item; } } return null; }
javascript
function (xmlNode, nodeName) { var childs = xmlNode.childNodes; for (var i = 0; i < childs.length; ++i) { var item = childs.item(i); if (item.nodeType !== 1) { continue; } if ((item.nodeName && !nodeName) || (nodeName && nodeName === item.nodeName)) { return item; } } return null; }
[ "function", "(", "xmlNode", ",", "nodeName", ")", "{", "var", "childs", "=", "xmlNode", ".", "childNodes", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "childs", ".", "length", ";", "++", "i", ")", "{", "var", "item", "=", "childs", ".", "item", "(", "i", ")", ";", "if", "(", "item", ".", "nodeType", "!==", "1", ")", "{", "continue", ";", "}", "if", "(", "(", "item", ".", "nodeName", "&&", "!", "nodeName", ")", "||", "(", "nodeName", "&&", "nodeName", "===", "item", ".", "nodeName", ")", ")", "{", "return", "item", ";", "}", "}", "return", "null", ";", "}" ]
Returns the first child of a node. Internal. Applications should not call this function. @param {Node} xmlNode The tag to look in. @param {String} nodeName Optional parameter, the name of the child.
[ "Returns", "the", "first", "child", "of", "a", "node", ".", "Internal", ".", "Applications", "should", "not", "call", "this", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L99-L117
10,554
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (filePath) { var pos = filePath.lastIndexOf("\\"); if (pos !== -1) { filePath = filePath.substr(pos + 1); } pos = filePath.lastIndexOf("/"); if (pos !== -1) { filePath = filePath.substr(pos + 1); } return filePath; }
javascript
function (filePath) { var pos = filePath.lastIndexOf("\\"); if (pos !== -1) { filePath = filePath.substr(pos + 1); } pos = filePath.lastIndexOf("/"); if (pos !== -1) { filePath = filePath.substr(pos + 1); } return filePath; }
[ "function", "(", "filePath", ")", "{", "var", "pos", "=", "filePath", ".", "lastIndexOf", "(", "\"\\\\\"", ")", ";", "if", "(", "pos", "!==", "-", "1", ")", "{", "filePath", "=", "filePath", ".", "substr", "(", "pos", "+", "1", ")", ";", "}", "pos", "=", "filePath", ".", "lastIndexOf", "(", "\"/\"", ")", ";", "if", "(", "pos", "!==", "-", "1", ")", "{", "filePath", "=", "filePath", ".", "substr", "(", "pos", "+", "1", ")", ";", "}", "return", "filePath", ";", "}" ]
Returns the filename without slashes. Internal. Applications should not call this function. @param {String} filePath
[ "Returns", "the", "filename", "without", "slashes", ".", "Internal", ".", "Applications", "should", "not", "call", "this", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L124-L137
10,555
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (nodes, id) { for (var i = 0; i < nodes.length; i++) { var attrId = nodes.item(i).getAttribute("id"); if (!attrId) { continue; } if (attrId.toString() === id) { return nodes.item(i); } } return null; }
javascript
function (nodes, id) { for (var i = 0; i < nodes.length; i++) { var attrId = nodes.item(i).getAttribute("id"); if (!attrId) { continue; } if (attrId.toString() === id) { return nodes.item(i); } } return null; }
[ "function", "(", "nodes", ",", "id", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "nodes", ".", "length", ";", "i", "++", ")", "{", "var", "attrId", "=", "nodes", ".", "item", "(", "i", ")", ".", "getAttribute", "(", "\"id\"", ")", ";", "if", "(", "!", "attrId", ")", "{", "continue", ";", "}", "if", "(", "attrId", ".", "toString", "(", ")", "===", "id", ")", "{", "return", "nodes", ".", "item", "(", "i", ")", ";", "}", "}", "return", "null", ";", "}" ]
Finds a node by id. Internal. Applications should not call this function. @param {NodeList} nodes A list of nodes to look in. @param {String} id The id of the node to search for.
[ "Finds", "a", "node", "by", "id", ".", "Internal", ".", "Applications", "should", "not", "call", "this", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L157-L168
10,556
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (uvs) { var clamp = true; for (var i = 0, len = uvs.length; i < len; i++) { if (uvs[i] < 0 || uvs[i] > 1) { clamp = false; break; } } return clamp; }
javascript
function (uvs) { var clamp = true; for (var i = 0, len = uvs.length; i < len; i++) { if (uvs[i] < 0 || uvs[i] > 1) { clamp = false; break; } } return clamp; }
[ "function", "(", "uvs", ")", "{", "var", "clamp", "=", "true", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "uvs", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "uvs", "[", "i", "]", "<", "0", "||", "uvs", "[", "i", "]", ">", "1", ")", "{", "clamp", "=", "false", ";", "break", ";", "}", "}", "return", "clamp", ";", "}" ]
Determines the rendering method for a texture. The method can be CLAMP or REPEAT. Internal. Applications should not call this function. @param {Number[]} uvs The uvs array.
[ "Determines", "the", "rendering", "method", "for", "a", "texture", ".", "The", "method", "can", "be", "CLAMP", "or", "REPEAT", ".", "Internal", ".", "Applications", "should", "not", "call", "this", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L176-L187
10,557
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaUtils.js
function (url, cb) { var request = new XMLHttpRequest(); request.onload = function () { if (this.status >= 200 && this.status < 400) { cb(this.response); } else { Logger.log(Logger.LEVEL_SEVERE, "sever error: " + this.status); cb(null); } }; request.onerror = function (e) { Logger.log(Logger.LEVEL_SEVERE, "connection error: " + e); cb(null); }; request.open("get", url, true); request.send(); }
javascript
function (url, cb) { var request = new XMLHttpRequest(); request.onload = function () { if (this.status >= 200 && this.status < 400) { cb(this.response); } else { Logger.log(Logger.LEVEL_SEVERE, "sever error: " + this.status); cb(null); } }; request.onerror = function (e) { Logger.log(Logger.LEVEL_SEVERE, "connection error: " + e); cb(null); }; request.open("get", url, true); request.send(); }
[ "function", "(", "url", ",", "cb", ")", "{", "var", "request", "=", "new", "XMLHttpRequest", "(", ")", ";", "request", ".", "onload", "=", "function", "(", ")", "{", "if", "(", "this", ".", "status", ">=", "200", "&&", "this", ".", "status", "<", "400", ")", "{", "cb", "(", "this", ".", "response", ")", ";", "}", "else", "{", "Logger", ".", "log", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"sever error: \"", "+", "this", ".", "status", ")", ";", "cb", "(", "null", ")", ";", "}", "}", ";", "request", ".", "onerror", "=", "function", "(", "e", ")", "{", "Logger", ".", "log", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"connection error: \"", "+", "e", ")", ";", "cb", "(", "null", ")", ";", "}", ";", "request", ".", "open", "(", "\"get\"", ",", "url", ",", "true", ")", ";", "request", ".", "send", "(", ")", ";", "}" ]
Fetches a file. @param {String} url The path to the collada file. @param {Function} cb A callback function to call when the collada file loaded.
[ "Fetches", "a", "file", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaUtils.js#L194-L216
10,558
NASAWorldWind/WebWorldWind
src/layer/BMNGOneImageLayer.js
function () { RenderableLayer.call(this, "Blue Marble Image"); var surfaceImage = new SurfaceImage(Sector.FULL_SPHERE, WorldWind.configuration.baseUrl + "images/BMNG_world.topo.bathy.200405.3.2048x1024.jpg"); this.addRenderable(surfaceImage); this.pickEnabled = false; this.minActiveAltitude = 3e6; }
javascript
function () { RenderableLayer.call(this, "Blue Marble Image"); var surfaceImage = new SurfaceImage(Sector.FULL_SPHERE, WorldWind.configuration.baseUrl + "images/BMNG_world.topo.bathy.200405.3.2048x1024.jpg"); this.addRenderable(surfaceImage); this.pickEnabled = false; this.minActiveAltitude = 3e6; }
[ "function", "(", ")", "{", "RenderableLayer", ".", "call", "(", "this", ",", "\"Blue Marble Image\"", ")", ";", "var", "surfaceImage", "=", "new", "SurfaceImage", "(", "Sector", ".", "FULL_SPHERE", ",", "WorldWind", ".", "configuration", ".", "baseUrl", "+", "\"images/BMNG_world.topo.bathy.200405.3.2048x1024.jpg\"", ")", ";", "this", ".", "addRenderable", "(", "surfaceImage", ")", ";", "this", ".", "pickEnabled", "=", "false", ";", "this", ".", "minActiveAltitude", "=", "3e6", ";", "}" ]
Constructs a Blue Marble image layer that spans the entire globe. @alias BMNGOneImageLayer @constructor @augments RenderableLayer @classdesc Displays a Blue Marble image layer that spans the entire globe with a single image.
[ "Constructs", "a", "Blue", "Marble", "image", "layer", "that", "spans", "the", "entire", "globe", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/BMNGOneImageLayer.js#L39-L49
10,559
NASAWorldWind/WebWorldWind
examples/Shapefiles.js
function (attributes, record) { var configuration = {}; configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME; if (record.isPointType()) { // Configure point-based features (cities, in this example) configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME; configuration.attributes = new WorldWind.PlacemarkAttributes(placemarkAttributes); if (attributes.values.pop_max) { var population = attributes.values.pop_max; configuration.attributes.imageScale = 0.01 * Math.log(population); } } else if (record.isPolygonType()) { // Configure polygon-based features (countries, in this example). configuration.attributes = new WorldWind.ShapeAttributes(null); // Fill the polygon with a random pastel color. configuration.attributes.interiorColor = new WorldWind.Color( 0.375 + 0.5 * Math.random(), 0.375 + 0.5 * Math.random(), 0.375 + 0.5 * Math.random(), 1.0); // Paint the outline in a darker variant of the interior color. configuration.attributes.outlineColor = new WorldWind.Color( 0.5 * configuration.attributes.interiorColor.red, 0.5 * configuration.attributes.interiorColor.green, 0.5 * configuration.attributes.interiorColor.blue, 1.0); } return configuration; }
javascript
function (attributes, record) { var configuration = {}; configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME; if (record.isPointType()) { // Configure point-based features (cities, in this example) configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME; configuration.attributes = new WorldWind.PlacemarkAttributes(placemarkAttributes); if (attributes.values.pop_max) { var population = attributes.values.pop_max; configuration.attributes.imageScale = 0.01 * Math.log(population); } } else if (record.isPolygonType()) { // Configure polygon-based features (countries, in this example). configuration.attributes = new WorldWind.ShapeAttributes(null); // Fill the polygon with a random pastel color. configuration.attributes.interiorColor = new WorldWind.Color( 0.375 + 0.5 * Math.random(), 0.375 + 0.5 * Math.random(), 0.375 + 0.5 * Math.random(), 1.0); // Paint the outline in a darker variant of the interior color. configuration.attributes.outlineColor = new WorldWind.Color( 0.5 * configuration.attributes.interiorColor.red, 0.5 * configuration.attributes.interiorColor.green, 0.5 * configuration.attributes.interiorColor.blue, 1.0); } return configuration; }
[ "function", "(", "attributes", ",", "record", ")", "{", "var", "configuration", "=", "{", "}", ";", "configuration", ".", "name", "=", "attributes", ".", "values", ".", "name", "||", "attributes", ".", "values", ".", "Name", "||", "attributes", ".", "values", ".", "NAME", ";", "if", "(", "record", ".", "isPointType", "(", ")", ")", "{", "// Configure point-based features (cities, in this example)", "configuration", ".", "name", "=", "attributes", ".", "values", ".", "name", "||", "attributes", ".", "values", ".", "Name", "||", "attributes", ".", "values", ".", "NAME", ";", "configuration", ".", "attributes", "=", "new", "WorldWind", ".", "PlacemarkAttributes", "(", "placemarkAttributes", ")", ";", "if", "(", "attributes", ".", "values", ".", "pop_max", ")", "{", "var", "population", "=", "attributes", ".", "values", ".", "pop_max", ";", "configuration", ".", "attributes", ".", "imageScale", "=", "0.01", "*", "Math", ".", "log", "(", "population", ")", ";", "}", "}", "else", "if", "(", "record", ".", "isPolygonType", "(", ")", ")", "{", "// Configure polygon-based features (countries, in this example).", "configuration", ".", "attributes", "=", "new", "WorldWind", ".", "ShapeAttributes", "(", "null", ")", ";", "// Fill the polygon with a random pastel color.", "configuration", ".", "attributes", ".", "interiorColor", "=", "new", "WorldWind", ".", "Color", "(", "0.375", "+", "0.5", "*", "Math", ".", "random", "(", ")", ",", "0.375", "+", "0.5", "*", "Math", ".", "random", "(", ")", ",", "0.375", "+", "0.5", "*", "Math", ".", "random", "(", ")", ",", "1.0", ")", ";", "// Paint the outline in a darker variant of the interior color.", "configuration", ".", "attributes", ".", "outlineColor", "=", "new", "WorldWind", ".", "Color", "(", "0.5", "*", "configuration", ".", "attributes", ".", "interiorColor", ".", "red", ",", "0.5", "*", "configuration", ".", "attributes", ".", "interiorColor", ".", "green", ",", "0.5", "*", "configuration", ".", "attributes", ".", "interiorColor", ".", "blue", ",", "1.0", ")", ";", "}", "return", "configuration", ";", "}" ]
Callback function for configuring shapefile visualization.
[ "Callback", "function", "for", "configuring", "shapefile", "visualization", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/Shapefiles.js#L60-L92
10,560
NASAWorldWind/WebWorldWind
src/cache/GpuResourceCache.js
function (capacity, lowWater) { if (!capacity || capacity < 1) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "GpuResourceCache", "constructor", "Specified cache capacity is undefined, 0 or negative.")); } if (!lowWater || lowWater < 0 || lowWater >= capacity) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "GpuResourceCache", "constructor", "Specified cache low-water value is undefined, negative or not less than the capacity.")); } // Private. Holds the actual cache entries. this.entries = new MemoryCache(capacity, lowWater); // Private. Counter for generating cache keys. this.cacheKeyPool = 0; // Private. List of retrievals currently in progress. this.currentRetrievals = {}; // Private. Identifies requested resources that whose retrieval failed. this.absentResourceList = new AbsentResourceList(3, 60e3); }
javascript
function (capacity, lowWater) { if (!capacity || capacity < 1) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "GpuResourceCache", "constructor", "Specified cache capacity is undefined, 0 or negative.")); } if (!lowWater || lowWater < 0 || lowWater >= capacity) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "GpuResourceCache", "constructor", "Specified cache low-water value is undefined, negative or not less than the capacity.")); } // Private. Holds the actual cache entries. this.entries = new MemoryCache(capacity, lowWater); // Private. Counter for generating cache keys. this.cacheKeyPool = 0; // Private. List of retrievals currently in progress. this.currentRetrievals = {}; // Private. Identifies requested resources that whose retrieval failed. this.absentResourceList = new AbsentResourceList(3, 60e3); }
[ "function", "(", "capacity", ",", "lowWater", ")", "{", "if", "(", "!", "capacity", "||", "capacity", "<", "1", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"GpuResourceCache\"", ",", "\"constructor\"", ",", "\"Specified cache capacity is undefined, 0 or negative.\"", ")", ")", ";", "}", "if", "(", "!", "lowWater", "||", "lowWater", "<", "0", "||", "lowWater", ">=", "capacity", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"GpuResourceCache\"", ",", "\"constructor\"", ",", "\"Specified cache low-water value is undefined, negative or not less than the capacity.\"", ")", ")", ";", "}", "// Private. Holds the actual cache entries.", "this", ".", "entries", "=", "new", "MemoryCache", "(", "capacity", ",", "lowWater", ")", ";", "// Private. Counter for generating cache keys.", "this", ".", "cacheKeyPool", "=", "0", ";", "// Private. List of retrievals currently in progress.", "this", ".", "currentRetrievals", "=", "{", "}", ";", "// Private. Identifies requested resources that whose retrieval failed.", "this", ".", "absentResourceList", "=", "new", "AbsentResourceList", "(", "3", ",", "60e3", ")", ";", "}" ]
Constructs a GPU resource cache for a specified size and low-water value. @alias GpuResourceCache @constructor @classdesc Maintains a cache of GPU resources such as textures and GLSL programs. Applications typically do not interact with this class unless they create their own shapes. @param {Number} capacity The cache capacity, in bytes. @param {Number} lowWater The number of bytes to clear the cache to when it exceeds its capacity. @throws {ArgumentError} If the specified capacity is undefined, 0 or negative or the low-water value is undefined, negative or not less than the capacity.
[ "Constructs", "a", "GPU", "resource", "cache", "for", "a", "specified", "size", "and", "low", "-", "water", "value", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/cache/GpuResourceCache.js#L47-L71
10,561
NASAWorldWind/WebWorldWind
src/render/OrderedRenderable.js
function () { /** * This ordered renderable's display name. * @type {String} * @default Renderable */ this.displayName = "Renderable"; /** * Indicates whether this ordered renderable is enabled. * @type {Boolean} * @default true */ this.enabled = true; /** * This ordered renderable's distance from the eye point in meters. * @type {Number} * @default Number.MAX_VALUE */ this.eyeDistance = Number.MAX_VALUE; /** * The time at which this ordered renderable was inserted into the ordered rendering list. * @type {Number} * @default 0 */ this.insertionTime = 0; throw new UnsupportedOperationError( Logger.logMessage(Logger.LEVEL_SEVERE, "OrderedRenderable", "constructor", "abstractInvocation")); }
javascript
function () { /** * This ordered renderable's display name. * @type {String} * @default Renderable */ this.displayName = "Renderable"; /** * Indicates whether this ordered renderable is enabled. * @type {Boolean} * @default true */ this.enabled = true; /** * This ordered renderable's distance from the eye point in meters. * @type {Number} * @default Number.MAX_VALUE */ this.eyeDistance = Number.MAX_VALUE; /** * The time at which this ordered renderable was inserted into the ordered rendering list. * @type {Number} * @default 0 */ this.insertionTime = 0; throw new UnsupportedOperationError( Logger.logMessage(Logger.LEVEL_SEVERE, "OrderedRenderable", "constructor", "abstractInvocation")); }
[ "function", "(", ")", "{", "/**\n * This ordered renderable's display name.\n * @type {String}\n * @default Renderable\n */", "this", ".", "displayName", "=", "\"Renderable\"", ";", "/**\n * Indicates whether this ordered renderable is enabled.\n * @type {Boolean}\n * @default true\n */", "this", ".", "enabled", "=", "true", ";", "/**\n * This ordered renderable's distance from the eye point in meters.\n * @type {Number}\n * @default Number.MAX_VALUE\n */", "this", ".", "eyeDistance", "=", "Number", ".", "MAX_VALUE", ";", "/**\n * The time at which this ordered renderable was inserted into the ordered rendering list.\n * @type {Number}\n * @default 0\n */", "this", ".", "insertionTime", "=", "0", ";", "throw", "new", "UnsupportedOperationError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"OrderedRenderable\"", ",", "\"constructor\"", ",", "\"abstractInvocation\"", ")", ")", ";", "}" ]
Applications must not call this constructor. It is an interface class and is not meant to be instantiated directly. @alias OrderedRenderable @constructor @classdesc Represents an ordered renderable. This is an interface class and is not meant to be instantiated directly.
[ "Applications", "must", "not", "call", "this", "constructor", ".", "It", "is", "an", "interface", "class", "and", "is", "not", "meant", "to", "be", "instantiated", "directly", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/render/OrderedRenderable.js#L35-L67
10,562
NASAWorldWind/WebWorldWind
src/util/Font.js
function (size, style, variant, weight, family, horizontalAlignment) { /* * All properties of Font are intended to be private and must be accessed via public getters and setters. */ if (!size) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Font", "constructor", "missingSize")); } else if (size <= 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Font", "constructor", "invalidSize")); } else { this._size = size; } this.style = style || "normal"; this.variant = variant || "normal"; this.weight = weight || "normal"; this.family = family || "sans-serif"; this.horizontalAlignment = horizontalAlignment || "center"; }
javascript
function (size, style, variant, weight, family, horizontalAlignment) { /* * All properties of Font are intended to be private and must be accessed via public getters and setters. */ if (!size) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Font", "constructor", "missingSize")); } else if (size <= 0) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Font", "constructor", "invalidSize")); } else { this._size = size; } this.style = style || "normal"; this.variant = variant || "normal"; this.weight = weight || "normal"; this.family = family || "sans-serif"; this.horizontalAlignment = horizontalAlignment || "center"; }
[ "function", "(", "size", ",", "style", ",", "variant", ",", "weight", ",", "family", ",", "horizontalAlignment", ")", "{", "/*\n * All properties of Font are intended to be private and must be accessed via public getters and setters.\n */", "if", "(", "!", "size", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Font\"", ",", "\"constructor\"", ",", "\"missingSize\"", ")", ")", ";", "}", "else", "if", "(", "size", "<=", "0", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Font\"", ",", "\"constructor\"", ",", "\"invalidSize\"", ")", ")", ";", "}", "else", "{", "this", ".", "_size", "=", "size", ";", "}", "this", ".", "style", "=", "style", "||", "\"normal\"", ";", "this", ".", "variant", "=", "variant", "||", "\"normal\"", ";", "this", ".", "weight", "=", "weight", "||", "\"normal\"", ";", "this", ".", "family", "=", "family", "||", "\"sans-serif\"", ";", "this", ".", "horizontalAlignment", "=", "horizontalAlignment", "||", "\"center\"", ";", "}" ]
Construct a font descriptor. See the individual attribute descriptions below for possible parameter values. @param {Number} size The size of font. @param {String} style The style of the font. @param {String} variant The variant of the font. @param {String} weight The weight of the font. @param {String} family The family of the font. @param {String} horizontalAlignment The vertical alignment of the font. @alias Font @constructor @classdesc Holds attributes controlling the style, size and other attributes of {@link Text} shapes and the textual features of {@link Placemark} and other shapes. The values used for these attributes are those defined by the [CSS Font property]{@link http://www.w3schools.com/cssref/pr_font_font.asp}.
[ "Construct", "a", "font", "descriptor", ".", "See", "the", "individual", "attribute", "descriptions", "below", "for", "possible", "parameter", "values", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/Font.js#L44-L66
10,563
NASAWorldWind/WebWorldWind
src/globe/ElevationImage.js
function (sector, imageWidth, imageHeight) { if (!sector) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ElevationImage", "constructor", "missingSector")); } /** * The sector spanned by this elevation image. * @type {Sector} * @readonly */ this.sector = sector; /** * The number of longitudinal sample points in this elevation image. * @type {Number} * @readonly */ this.imageWidth = imageWidth; /** * The number of latitudinal sample points in this elevation image. * @type {Number} * @readonly */ this.imageHeight = imageHeight; /** * The size in bytes of this elevation image. * @type {number} * @readonly */ this.size = this.imageWidth * this.imageHeight; /** * Internal use only * false if the entire image consists of NO_DATA values, true otherwise. * @ignore */ this.hasData = true; /** * Internal use only * true if any pixel in the image has a NO_DATA value, false otherwise. * @ignore */ this.hasMissingData = false; }
javascript
function (sector, imageWidth, imageHeight) { if (!sector) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ElevationImage", "constructor", "missingSector")); } /** * The sector spanned by this elevation image. * @type {Sector} * @readonly */ this.sector = sector; /** * The number of longitudinal sample points in this elevation image. * @type {Number} * @readonly */ this.imageWidth = imageWidth; /** * The number of latitudinal sample points in this elevation image. * @type {Number} * @readonly */ this.imageHeight = imageHeight; /** * The size in bytes of this elevation image. * @type {number} * @readonly */ this.size = this.imageWidth * this.imageHeight; /** * Internal use only * false if the entire image consists of NO_DATA values, true otherwise. * @ignore */ this.hasData = true; /** * Internal use only * true if any pixel in the image has a NO_DATA value, false otherwise. * @ignore */ this.hasMissingData = false; }
[ "function", "(", "sector", ",", "imageWidth", ",", "imageHeight", ")", "{", "if", "(", "!", "sector", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"ElevationImage\"", ",", "\"constructor\"", ",", "\"missingSector\"", ")", ")", ";", "}", "/**\n * The sector spanned by this elevation image.\n * @type {Sector}\n * @readonly\n */", "this", ".", "sector", "=", "sector", ";", "/**\n * The number of longitudinal sample points in this elevation image.\n * @type {Number}\n * @readonly\n */", "this", ".", "imageWidth", "=", "imageWidth", ";", "/**\n * The number of latitudinal sample points in this elevation image.\n * @type {Number}\n * @readonly\n */", "this", ".", "imageHeight", "=", "imageHeight", ";", "/**\n * The size in bytes of this elevation image.\n * @type {number}\n * @readonly\n */", "this", ".", "size", "=", "this", ".", "imageWidth", "*", "this", ".", "imageHeight", ";", "/**\n * Internal use only\n * false if the entire image consists of NO_DATA values, true otherwise.\n * @ignore\n */", "this", ".", "hasData", "=", "true", ";", "/**\n * Internal use only\n * true if any pixel in the image has a NO_DATA value, false otherwise.\n * @ignore\n */", "this", ".", "hasMissingData", "=", "false", ";", "}" ]
Constructs an elevation image. @alias ElevationImage @constructor @classdesc Holds elevation values for an elevation tile. This class is typically not used directly by applications. @param {Sector} sector The sector spanned by this elevation image. @param {Number} imageWidth The number of longitudinal sample points in this elevation image. @param {Number} imageHeight The number of latitudinal sample points in this elevation image. @throws {ArgumentError} If the sector is null or undefined
[ "Constructs", "an", "elevation", "image", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/globe/ElevationImage.js#L41-L88
10,564
NASAWorldWind/WebWorldWind
src/util/proj4-src.js
getLetter100kID
function getLetter100kID(column, row, parm) { // colOrigin and rowOrigin are the letters at the origin of the set var index = parm - 1; var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index); var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index); // colInt and rowInt are the letters to build to return var colInt = colOrigin + column - 1; var rowInt = rowOrigin + row; var rollover = false; if (colInt > Z) { colInt = colInt - Z + A - 1; rollover = true; } if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) { colInt++; } if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) { colInt++; if (colInt === I) { colInt++; } } if (colInt > Z) { colInt = colInt - Z + A - 1; } if (rowInt > V) { rowInt = rowInt - V + A - 1; rollover = true; } else { rollover = false; } if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) { rowInt++; } if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) { rowInt++; if (rowInt === I) { rowInt++; } } if (rowInt > V) { rowInt = rowInt - V + A - 1; } var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt); return twoLetter; }
javascript
function getLetter100kID(column, row, parm) { // colOrigin and rowOrigin are the letters at the origin of the set var index = parm - 1; var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index); var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index); // colInt and rowInt are the letters to build to return var colInt = colOrigin + column - 1; var rowInt = rowOrigin + row; var rollover = false; if (colInt > Z) { colInt = colInt - Z + A - 1; rollover = true; } if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) { colInt++; } if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) { colInt++; if (colInt === I) { colInt++; } } if (colInt > Z) { colInt = colInt - Z + A - 1; } if (rowInt > V) { rowInt = rowInt - V + A - 1; rollover = true; } else { rollover = false; } if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) { rowInt++; } if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) { rowInt++; if (rowInt === I) { rowInt++; } } if (rowInt > V) { rowInt = rowInt - V + A - 1; } var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt); return twoLetter; }
[ "function", "getLetter100kID", "(", "column", ",", "row", ",", "parm", ")", "{", "// colOrigin and rowOrigin are the letters at the origin of the set", "var", "index", "=", "parm", "-", "1", ";", "var", "colOrigin", "=", "SET_ORIGIN_COLUMN_LETTERS", ".", "charCodeAt", "(", "index", ")", ";", "var", "rowOrigin", "=", "SET_ORIGIN_ROW_LETTERS", ".", "charCodeAt", "(", "index", ")", ";", "// colInt and rowInt are the letters to build to return", "var", "colInt", "=", "colOrigin", "+", "column", "-", "1", ";", "var", "rowInt", "=", "rowOrigin", "+", "row", ";", "var", "rollover", "=", "false", ";", "if", "(", "colInt", ">", "Z", ")", "{", "colInt", "=", "colInt", "-", "Z", "+", "A", "-", "1", ";", "rollover", "=", "true", ";", "}", "if", "(", "colInt", "===", "I", "||", "(", "colOrigin", "<", "I", "&&", "colInt", ">", "I", ")", "||", "(", "(", "colInt", ">", "I", "||", "colOrigin", "<", "I", ")", "&&", "rollover", ")", ")", "{", "colInt", "++", ";", "}", "if", "(", "colInt", "===", "O", "||", "(", "colOrigin", "<", "O", "&&", "colInt", ">", "O", ")", "||", "(", "(", "colInt", ">", "O", "||", "colOrigin", "<", "O", ")", "&&", "rollover", ")", ")", "{", "colInt", "++", ";", "if", "(", "colInt", "===", "I", ")", "{", "colInt", "++", ";", "}", "}", "if", "(", "colInt", ">", "Z", ")", "{", "colInt", "=", "colInt", "-", "Z", "+", "A", "-", "1", ";", "}", "if", "(", "rowInt", ">", "V", ")", "{", "rowInt", "=", "rowInt", "-", "V", "+", "A", "-", "1", ";", "rollover", "=", "true", ";", "}", "else", "{", "rollover", "=", "false", ";", "}", "if", "(", "(", "(", "rowInt", "===", "I", ")", "||", "(", "(", "rowOrigin", "<", "I", ")", "&&", "(", "rowInt", ">", "I", ")", ")", ")", "||", "(", "(", "(", "rowInt", ">", "I", ")", "||", "(", "rowOrigin", "<", "I", ")", ")", "&&", "rollover", ")", ")", "{", "rowInt", "++", ";", "}", "if", "(", "(", "(", "rowInt", "===", "O", ")", "||", "(", "(", "rowOrigin", "<", "O", ")", "&&", "(", "rowInt", ">", "O", ")", ")", ")", "||", "(", "(", "(", "rowInt", ">", "O", ")", "||", "(", "rowOrigin", "<", "O", ")", ")", "&&", "rollover", ")", ")", "{", "rowInt", "++", ";", "if", "(", "rowInt", "===", "I", ")", "{", "rowInt", "++", ";", "}", "}", "if", "(", "rowInt", ">", "V", ")", "{", "rowInt", "=", "rowInt", "-", "V", "+", "A", "-", "1", ";", "}", "var", "twoLetter", "=", "String", ".", "fromCharCode", "(", "colInt", ")", "+", "String", ".", "fromCharCode", "(", "rowInt", ")", ";", "return", "twoLetter", ";", "}" ]
Get the two-letter MGRS 100k designator given information translated from the UTM northing, easting and zone number. @private @param {number} column the column index as it relates to the MGRS 100k set spreadsheet, created from the UTM easting. Values are 1-8. @param {number} row the row index as it relates to the MGRS 100k set spreadsheet, created from the UTM northing value. Values are from 0-19. @param {number} parm the set block, as it relates to the MGRS 100k set spreadsheet, created from the UTM zone. Values are from 1-60. @return two letter MGRS 100k code.
[ "Get", "the", "two", "-", "letter", "MGRS", "100k", "designator", "given", "information", "translated", "from", "the", "UTM", "northing", "easting", "and", "zone", "number", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/proj4-src.js#L2303-L2361
10,565
NASAWorldWind/WebWorldWind
src/util/proj4-src.js
decode
function decode(mgrsString) { if (mgrsString && mgrsString.length === 0) { throw ("MGRSPoint coverting from nothing"); } var length = mgrsString.length; var hunK = null; var sb = ""; var testChar; var i = 0; // get Zone number while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) { if (i >= 2) { throw ("MGRSPoint bad conversion from: " + mgrsString); } sb += testChar; i++; } var zoneNumber = parseInt(sb, 10); if (i === 0 || i + 3 > length) { // A good MGRS string has to be 4-5 digits long, // ##AAA/#AAA at least. throw ("MGRSPoint bad conversion from: " + mgrsString); } var zoneLetter = mgrsString.charAt(i++); // Should we check the zone letter here? Why not. if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') { throw ("MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString); } hunK = mgrsString.substring(i, i += 2); var set = get100kSetForZone(zoneNumber); var east100k = getEastingFromChar(hunK.charAt(0), set); var north100k = getNorthingFromChar(hunK.charAt(1), set); // We have a bug where the northing may be 2000000 too low. // How // do we know when to roll over? while (north100k < getMinNorthing(zoneLetter)) { north100k += 2000000; } // calculate the char index for easting/northing separator var remainder = length - i; if (remainder % 2 !== 0) { throw ("MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + mgrsString); } var sep = remainder / 2; var sepEasting = 0.0; var sepNorthing = 0.0; var accuracyBonus, sepEastingString, sepNorthingString, easting, northing; if (sep > 0) { accuracyBonus = 100000.0 / Math.pow(10, sep); sepEastingString = mgrsString.substring(i, i + sep); sepEasting = parseFloat(sepEastingString) * accuracyBonus; sepNorthingString = mgrsString.substring(i + sep); sepNorthing = parseFloat(sepNorthingString) * accuracyBonus; } easting = sepEasting + east100k; northing = sepNorthing + north100k; return { easting: easting, northing: northing, zoneLetter: zoneLetter, zoneNumber: zoneNumber, accuracy: accuracyBonus }; }
javascript
function decode(mgrsString) { if (mgrsString && mgrsString.length === 0) { throw ("MGRSPoint coverting from nothing"); } var length = mgrsString.length; var hunK = null; var sb = ""; var testChar; var i = 0; // get Zone number while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) { if (i >= 2) { throw ("MGRSPoint bad conversion from: " + mgrsString); } sb += testChar; i++; } var zoneNumber = parseInt(sb, 10); if (i === 0 || i + 3 > length) { // A good MGRS string has to be 4-5 digits long, // ##AAA/#AAA at least. throw ("MGRSPoint bad conversion from: " + mgrsString); } var zoneLetter = mgrsString.charAt(i++); // Should we check the zone letter here? Why not. if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') { throw ("MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString); } hunK = mgrsString.substring(i, i += 2); var set = get100kSetForZone(zoneNumber); var east100k = getEastingFromChar(hunK.charAt(0), set); var north100k = getNorthingFromChar(hunK.charAt(1), set); // We have a bug where the northing may be 2000000 too low. // How // do we know when to roll over? while (north100k < getMinNorthing(zoneLetter)) { north100k += 2000000; } // calculate the char index for easting/northing separator var remainder = length - i; if (remainder % 2 !== 0) { throw ("MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + mgrsString); } var sep = remainder / 2; var sepEasting = 0.0; var sepNorthing = 0.0; var accuracyBonus, sepEastingString, sepNorthingString, easting, northing; if (sep > 0) { accuracyBonus = 100000.0 / Math.pow(10, sep); sepEastingString = mgrsString.substring(i, i + sep); sepEasting = parseFloat(sepEastingString) * accuracyBonus; sepNorthingString = mgrsString.substring(i + sep); sepNorthing = parseFloat(sepNorthingString) * accuracyBonus; } easting = sepEasting + east100k; northing = sepNorthing + north100k; return { easting: easting, northing: northing, zoneLetter: zoneLetter, zoneNumber: zoneNumber, accuracy: accuracyBonus }; }
[ "function", "decode", "(", "mgrsString", ")", "{", "if", "(", "mgrsString", "&&", "mgrsString", ".", "length", "===", "0", ")", "{", "throw", "(", "\"MGRSPoint coverting from nothing\"", ")", ";", "}", "var", "length", "=", "mgrsString", ".", "length", ";", "var", "hunK", "=", "null", ";", "var", "sb", "=", "\"\"", ";", "var", "testChar", ";", "var", "i", "=", "0", ";", "// get Zone number", "while", "(", "!", "(", "/", "[A-Z]", "/", ")", ".", "test", "(", "testChar", "=", "mgrsString", ".", "charAt", "(", "i", ")", ")", ")", "{", "if", "(", "i", ">=", "2", ")", "{", "throw", "(", "\"MGRSPoint bad conversion from: \"", "+", "mgrsString", ")", ";", "}", "sb", "+=", "testChar", ";", "i", "++", ";", "}", "var", "zoneNumber", "=", "parseInt", "(", "sb", ",", "10", ")", ";", "if", "(", "i", "===", "0", "||", "i", "+", "3", ">", "length", ")", "{", "// A good MGRS string has to be 4-5 digits long,", "// ##AAA/#AAA at least.", "throw", "(", "\"MGRSPoint bad conversion from: \"", "+", "mgrsString", ")", ";", "}", "var", "zoneLetter", "=", "mgrsString", ".", "charAt", "(", "i", "++", ")", ";", "// Should we check the zone letter here? Why not.", "if", "(", "zoneLetter", "<=", "'A'", "||", "zoneLetter", "===", "'B'", "||", "zoneLetter", "===", "'Y'", "||", "zoneLetter", ">=", "'Z'", "||", "zoneLetter", "===", "'I'", "||", "zoneLetter", "===", "'O'", ")", "{", "throw", "(", "\"MGRSPoint zone letter \"", "+", "zoneLetter", "+", "\" not handled: \"", "+", "mgrsString", ")", ";", "}", "hunK", "=", "mgrsString", ".", "substring", "(", "i", ",", "i", "+=", "2", ")", ";", "var", "set", "=", "get100kSetForZone", "(", "zoneNumber", ")", ";", "var", "east100k", "=", "getEastingFromChar", "(", "hunK", ".", "charAt", "(", "0", ")", ",", "set", ")", ";", "var", "north100k", "=", "getNorthingFromChar", "(", "hunK", ".", "charAt", "(", "1", ")", ",", "set", ")", ";", "// We have a bug where the northing may be 2000000 too low.", "// How", "// do we know when to roll over?", "while", "(", "north100k", "<", "getMinNorthing", "(", "zoneLetter", ")", ")", "{", "north100k", "+=", "2000000", ";", "}", "// calculate the char index for easting/northing separator", "var", "remainder", "=", "length", "-", "i", ";", "if", "(", "remainder", "%", "2", "!==", "0", ")", "{", "throw", "(", "\"MGRSPoint has to have an even number \\nof digits after the zone letter and two 100km letters - front \\nhalf for easting meters, second half for \\nnorthing meters\"", "+", "mgrsString", ")", ";", "}", "var", "sep", "=", "remainder", "/", "2", ";", "var", "sepEasting", "=", "0.0", ";", "var", "sepNorthing", "=", "0.0", ";", "var", "accuracyBonus", ",", "sepEastingString", ",", "sepNorthingString", ",", "easting", ",", "northing", ";", "if", "(", "sep", ">", "0", ")", "{", "accuracyBonus", "=", "100000.0", "/", "Math", ".", "pow", "(", "10", ",", "sep", ")", ";", "sepEastingString", "=", "mgrsString", ".", "substring", "(", "i", ",", "i", "+", "sep", ")", ";", "sepEasting", "=", "parseFloat", "(", "sepEastingString", ")", "*", "accuracyBonus", ";", "sepNorthingString", "=", "mgrsString", ".", "substring", "(", "i", "+", "sep", ")", ";", "sepNorthing", "=", "parseFloat", "(", "sepNorthingString", ")", "*", "accuracyBonus", ";", "}", "easting", "=", "sepEasting", "+", "east100k", ";", "northing", "=", "sepNorthing", "+", "north100k", ";", "return", "{", "easting", ":", "easting", ",", "northing", ":", "northing", ",", "zoneLetter", ":", "zoneLetter", ",", "zoneNumber", ":", "zoneNumber", ",", "accuracy", ":", "accuracyBonus", "}", ";", "}" ]
Decode the UTM parameters from a MGRS string. @private @param {string} mgrsString an UPPERCASE coordinate string is expected. @return {object} An object literal with easting, northing, zoneLetter, zoneNumber and accuracy (in meters) properties.
[ "Decode", "the", "UTM", "parameters", "from", "a", "MGRS", "string", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/proj4-src.js#L2371-L2453
10,566
NASAWorldWind/WebWorldWind
src/util/proj4-src.js
getEastingFromChar
function getEastingFromChar(e, set) { // colOrigin is the letter at the origin of the set for the // column var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1); var eastingValue = 100000.0; var rewindMarker = false; while (curCol !== e.charCodeAt(0)) { curCol++; if (curCol === I) { curCol++; } if (curCol === O) { curCol++; } if (curCol > Z) { if (rewindMarker) { throw ("Bad character: " + e); } curCol = A; rewindMarker = true; } eastingValue += 100000.0; } return eastingValue; }
javascript
function getEastingFromChar(e, set) { // colOrigin is the letter at the origin of the set for the // column var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1); var eastingValue = 100000.0; var rewindMarker = false; while (curCol !== e.charCodeAt(0)) { curCol++; if (curCol === I) { curCol++; } if (curCol === O) { curCol++; } if (curCol > Z) { if (rewindMarker) { throw ("Bad character: " + e); } curCol = A; rewindMarker = true; } eastingValue += 100000.0; } return eastingValue; }
[ "function", "getEastingFromChar", "(", "e", ",", "set", ")", "{", "// colOrigin is the letter at the origin of the set for the", "// column", "var", "curCol", "=", "SET_ORIGIN_COLUMN_LETTERS", ".", "charCodeAt", "(", "set", "-", "1", ")", ";", "var", "eastingValue", "=", "100000.0", ";", "var", "rewindMarker", "=", "false", ";", "while", "(", "curCol", "!==", "e", ".", "charCodeAt", "(", "0", ")", ")", "{", "curCol", "++", ";", "if", "(", "curCol", "===", "I", ")", "{", "curCol", "++", ";", "}", "if", "(", "curCol", "===", "O", ")", "{", "curCol", "++", ";", "}", "if", "(", "curCol", ">", "Z", ")", "{", "if", "(", "rewindMarker", ")", "{", "throw", "(", "\"Bad character: \"", "+", "e", ")", ";", "}", "curCol", "=", "A", ";", "rewindMarker", "=", "true", ";", "}", "eastingValue", "+=", "100000.0", ";", "}", "return", "eastingValue", ";", "}" ]
Given the first letter from a two-letter MGRS 100k zone, and given the MGRS table set for the zone number, figure out the easting value that should be added to the other, secondary easting value. @private @param {char} e The first letter from a two-letter MGRS 100´k zone. @param {number} set The MGRS table set for the zone number. @return {number} The easting value for the given letter and set.
[ "Given", "the", "first", "letter", "from", "a", "two", "-", "letter", "MGRS", "100k", "zone", "and", "given", "the", "MGRS", "table", "set", "for", "the", "zone", "number", "figure", "out", "the", "easting", "value", "that", "should", "be", "added", "to", "the", "other", "secondary", "easting", "value", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/proj4-src.js#L2465-L2491
10,567
NASAWorldWind/WebWorldWind
src/util/BingImageryUrlBuilder.js
function (imagerySet, bingMapsKey) { var wwBingMapsKey = "AkttWCS8p6qzxvx5RH3qUcCPgwG9nRJ7IwlpFGb14B0rBorB5DvmXr2Y_eCUNIxH"; // Use key specified for this layer this.bingMapsKey = bingMapsKey; // If none, fallback to key specified globally if (!this.bingMapsKey) { this.bingMapsKey = WorldWind.BingMapsKey; } // If none, fallback to default demo key if (!this.bingMapsKey) { this.bingMapsKey = wwBingMapsKey; } // If using WorldWind Bing Maps demo key, show warning if (this.bingMapsKey === wwBingMapsKey) { BingImageryUrlBuilder.showBingMapsKeyWarning(); } this.imagerySet = imagerySet; }
javascript
function (imagerySet, bingMapsKey) { var wwBingMapsKey = "AkttWCS8p6qzxvx5RH3qUcCPgwG9nRJ7IwlpFGb14B0rBorB5DvmXr2Y_eCUNIxH"; // Use key specified for this layer this.bingMapsKey = bingMapsKey; // If none, fallback to key specified globally if (!this.bingMapsKey) { this.bingMapsKey = WorldWind.BingMapsKey; } // If none, fallback to default demo key if (!this.bingMapsKey) { this.bingMapsKey = wwBingMapsKey; } // If using WorldWind Bing Maps demo key, show warning if (this.bingMapsKey === wwBingMapsKey) { BingImageryUrlBuilder.showBingMapsKeyWarning(); } this.imagerySet = imagerySet; }
[ "function", "(", "imagerySet", ",", "bingMapsKey", ")", "{", "var", "wwBingMapsKey", "=", "\"AkttWCS8p6qzxvx5RH3qUcCPgwG9nRJ7IwlpFGb14B0rBorB5DvmXr2Y_eCUNIxH\"", ";", "// Use key specified for this layer", "this", ".", "bingMapsKey", "=", "bingMapsKey", ";", "// If none, fallback to key specified globally", "if", "(", "!", "this", ".", "bingMapsKey", ")", "{", "this", ".", "bingMapsKey", "=", "WorldWind", ".", "BingMapsKey", ";", "}", "// If none, fallback to default demo key", "if", "(", "!", "this", ".", "bingMapsKey", ")", "{", "this", ".", "bingMapsKey", "=", "wwBingMapsKey", ";", "}", "// If using WorldWind Bing Maps demo key, show warning", "if", "(", "this", ".", "bingMapsKey", "===", "wwBingMapsKey", ")", "{", "BingImageryUrlBuilder", ".", "showBingMapsKeyWarning", "(", ")", ";", "}", "this", ".", "imagerySet", "=", "imagerySet", ";", "}" ]
Constructs a URL builder for Bing imagery. @alias BingImageryUrlBuilder @constructor @classdesc Provides a factory to create URLs for Bing image requests. @param {String} imagerySet The name of the imagery set to display. @param {String} bingMapsKey The Bing Maps key to use for the image requests. If null or undefined, the key at [WorldWind.BingMapsKey]{@link WorldWind#BingMapsKey} is used. If that is null or undefined, the default WorldWind Bing Maps key is used, but this fallback is provided only for non-production use. If you are using Web WorldWind in an app or a web page, you must obtain your own key from the [Bing Maps Portal]{@link https://www.microsoft.com/maps/choose-your-bing-maps-API.aspx} and either pass it as a parameter to this constructor or specify it as the property [WorldWind.BingMapsKey]{@link WorldWind#BingMapsKey}.
[ "Constructs", "a", "URL", "builder", "for", "Bing", "imagery", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/BingImageryUrlBuilder.js#L45-L67
10,568
NASAWorldWind/WebWorldWind
src/formats/collada/ColladaNode.js
function () { this.id = ""; this.name = ""; this.sid = ""; this.children = []; this.materials = []; this.mesh = ""; this.localMatrix = Matrix.fromIdentity(); this.worldMatrix = Matrix.fromIdentity(); }
javascript
function () { this.id = ""; this.name = ""; this.sid = ""; this.children = []; this.materials = []; this.mesh = ""; this.localMatrix = Matrix.fromIdentity(); this.worldMatrix = Matrix.fromIdentity(); }
[ "function", "(", ")", "{", "this", ".", "id", "=", "\"\"", ";", "this", ".", "name", "=", "\"\"", ";", "this", ".", "sid", "=", "\"\"", ";", "this", ".", "children", "=", "[", "]", ";", "this", ".", "materials", "=", "[", "]", ";", "this", ".", "mesh", "=", "\"\"", ";", "this", ".", "localMatrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ";", "this", ".", "worldMatrix", "=", "Matrix", ".", "fromIdentity", "(", ")", ";", "}" ]
Constructs a ColladaNode @alias ColladaNode @constructor @classdesc Represents a collada node tag.
[ "Constructs", "a", "ColladaNode" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/collada/ColladaNode.js#L30-L39
10,569
NASAWorldWind/WebWorldWind
src/WorldWindowController.js
function (worldWindow) { if (!worldWindow) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WorldWindowController", "constructor", "missingWorldWindow")); } /** * The WorldWindow associated with this controller. * @type {WorldWindow} * @readonly */ this.wwd = worldWindow; // Intentionally not documented. this.allGestureListeners = []; }
javascript
function (worldWindow) { if (!worldWindow) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WorldWindowController", "constructor", "missingWorldWindow")); } /** * The WorldWindow associated with this controller. * @type {WorldWindow} * @readonly */ this.wwd = worldWindow; // Intentionally not documented. this.allGestureListeners = []; }
[ "function", "(", "worldWindow", ")", "{", "if", "(", "!", "worldWindow", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WorldWindowController\"", ",", "\"constructor\"", ",", "\"missingWorldWindow\"", ")", ")", ";", "}", "/**\n * The WorldWindow associated with this controller.\n * @type {WorldWindow}\n * @readonly\n */", "this", ".", "wwd", "=", "worldWindow", ";", "// Intentionally not documented.", "this", ".", "allGestureListeners", "=", "[", "]", ";", "}" ]
Constructs a root window controller. @alias WorldWindowController @constructor @abstract @classDesc This class provides a base window controller with required properties and methods which sub-classes may inherit from to create custom window controllers for controlling the globe via user interaction. @param {WorldWindow} worldWindow The WorldWindow associated with this layer. @throws {ArgumentError} If the specified WorldWindow is null or undefined.
[ "Constructs", "a", "root", "window", "controller", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/WorldWindowController.js#L40-L55
10,570
NASAWorldWind/WebWorldWind
src/geom/Line.js
function (origin, direction) { if (!origin) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Line", "constructor", "Origin is null or undefined.")); } if (!direction) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Line", "constructor", "Direction is null or undefined.")); } /** * This line's origin. * @type {Vec3} */ this.origin = origin; /** * This line's direction. * @type {Vec3} */ this.direction = direction; }
javascript
function (origin, direction) { if (!origin) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Line", "constructor", "Origin is null or undefined.")); } if (!direction) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "Line", "constructor", "Direction is null or undefined.")); } /** * This line's origin. * @type {Vec3} */ this.origin = origin; /** * This line's direction. * @type {Vec3} */ this.direction = direction; }
[ "function", "(", "origin", ",", "direction", ")", "{", "if", "(", "!", "origin", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Line\"", ",", "\"constructor\"", ",", "\"Origin is null or undefined.\"", ")", ")", ";", "}", "if", "(", "!", "direction", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Line\"", ",", "\"constructor\"", ",", "\"Direction is null or undefined.\"", ")", ")", ";", "}", "/**\n * This line's origin.\n * @type {Vec3}\n */", "this", ".", "origin", "=", "origin", ";", "/**\n * This line's direction.\n * @type {Vec3}\n */", "this", ".", "direction", "=", "direction", ";", "}" ]
Constructs a line from a specified origin and direction. @alias Line @constructor @classdesc Represents a line in Cartesian coordinates. @param {Vec3} origin The line's origin. @param {Vec3} direction The line's direction. @throws {ArgumentError} If either the origin or the direction are null or undefined.
[ "Constructs", "a", "line", "from", "a", "specified", "origin", "and", "direction", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/geom/Line.js#L38-L60
10,571
NASAWorldWind/WebWorldWind
src/util/ImageSource.js
function (image) { if (!image) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "ImageSource", "constructor", "missingImage")); } /** * This image source's image * @type {Image} * @readonly */ this.image = image; /** * This image source's key. A unique key is automatically generated and assigned during construction. * Applications may assign a different key after construction. * @type {String} * @default A unique string for this image source. */ this.key = "ImageSource " + ++ImageSource.keyPool; }
javascript
function (image) { if (!image) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "ImageSource", "constructor", "missingImage")); } /** * This image source's image * @type {Image} * @readonly */ this.image = image; /** * This image source's key. A unique key is automatically generated and assigned during construction. * Applications may assign a different key after construction. * @type {String} * @default A unique string for this image source. */ this.key = "ImageSource " + ++ImageSource.keyPool; }
[ "function", "(", "image", ")", "{", "if", "(", "!", "image", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"ImageSource\"", ",", "\"constructor\"", ",", "\"missingImage\"", ")", ")", ";", "}", "/**\n * This image source's image\n * @type {Image}\n * @readonly\n */", "this", ".", "image", "=", "image", ";", "/**\n * This image source's key. A unique key is automatically generated and assigned during construction.\n * Applications may assign a different key after construction.\n * @type {String}\n * @default A unique string for this image source.\n */", "this", ".", "key", "=", "\"ImageSource \"", "+", "++", "ImageSource", ".", "keyPool", ";", "}" ]
Constructs an image source. @alias ImageSource @constructor @classdesc Holds an Image with an associated key that uniquely identifies that image. The key is automatically generated but may be reassigned after construction. Instances of this class are used to specify dynamically created image sources for {@link Placemark}, {@link SurfaceImage}, {@link Polygon} textures and other shapes that display imagery. @param {Image} image The image for this image source. @throws {ArgumentError} If the specified image is null or undefined.
[ "Constructs", "an", "image", "source", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/ImageSource.js#L41-L61
10,572
NASAWorldWind/WebWorldWind
src/layer/WmsTimeDimensionedLayer.js
function (config) { if (!config) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmsTimeDimensionedLayer", "constructor", "No configuration specified.")); } Layer.call(this, "WMS Time Dimensioned Layer"); /** * The configuration object specified at construction. * @type {{}} * @readonly */ this.config = config; // Intentionally not documented. this.displayName = config.title; this.pickEnabled = false; // Intentionally not documented. Contains the lazily loaded list of sub-layers. this.layers = {}; }
javascript
function (config) { if (!config) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmsTimeDimensionedLayer", "constructor", "No configuration specified.")); } Layer.call(this, "WMS Time Dimensioned Layer"); /** * The configuration object specified at construction. * @type {{}} * @readonly */ this.config = config; // Intentionally not documented. this.displayName = config.title; this.pickEnabled = false; // Intentionally not documented. Contains the lazily loaded list of sub-layers. this.layers = {}; }
[ "function", "(", "config", ")", "{", "if", "(", "!", "config", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WmsTimeDimensionedLayer\"", ",", "\"constructor\"", ",", "\"No configuration specified.\"", ")", ")", ";", "}", "Layer", ".", "call", "(", "this", ",", "\"WMS Time Dimensioned Layer\"", ")", ";", "/**\n * The configuration object specified at construction.\n * @type {{}}\n * @readonly\n */", "this", ".", "config", "=", "config", ";", "// Intentionally not documented.", "this", ".", "displayName", "=", "config", ".", "title", ";", "this", ".", "pickEnabled", "=", "false", ";", "// Intentionally not documented. Contains the lazily loaded list of sub-layers.", "this", ".", "layers", "=", "{", "}", ";", "}" ]
Constructs a WMS time-dimensioned image layer. @alias WmsTimeDimensionedLayer @constructor @augments Layer @classdesc Displays a time-series WMS image layer. This layer contains a collection of {@link WmsLayer}s, each representing a different time in a time sequence. Only the layer indicated by this layer's [time]{@link WmsTimeDimensionedLayer#time} property is displayed during any frame. @param {{}} config Specifies configuration information for the layer. See the constructor description for {@link WmsLayer} for a description of the required properties. @throws {ArgumentError} If the specified configuration is null or undefined.
[ "Constructs", "a", "WMS", "time", "-", "dimensioned", "image", "layer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/WmsTimeDimensionedLayer.js#L44-L66
10,573
NASAWorldWind/WebWorldWind
src/geom/Angle.js
function (degrees) { var sign, temp, d, m, s; sign = degrees < 0 ? -1 : 1; temp = sign * degrees; d = Math.floor(temp); temp = (temp - d) * 60; m = Math.floor(temp); temp = (temp - m) * 60; s = Math.round(temp); if (s == 60) { m++; s = 0; } if (m == 60) { d++; m = 0; } return (sign == -1 ? "-" : "") + d + "\u00B0" + " " + m + "\u2019" + " " + s + "\u201D"; }
javascript
function (degrees) { var sign, temp, d, m, s; sign = degrees < 0 ? -1 : 1; temp = sign * degrees; d = Math.floor(temp); temp = (temp - d) * 60; m = Math.floor(temp); temp = (temp - m) * 60; s = Math.round(temp); if (s == 60) { m++; s = 0; } if (m == 60) { d++; m = 0; } return (sign == -1 ? "-" : "") + d + "\u00B0" + " " + m + "\u2019" + " " + s + "\u201D"; }
[ "function", "(", "degrees", ")", "{", "var", "sign", ",", "temp", ",", "d", ",", "m", ",", "s", ";", "sign", "=", "degrees", "<", "0", "?", "-", "1", ":", "1", ";", "temp", "=", "sign", "*", "degrees", ";", "d", "=", "Math", ".", "floor", "(", "temp", ")", ";", "temp", "=", "(", "temp", "-", "d", ")", "*", "60", ";", "m", "=", "Math", ".", "floor", "(", "temp", ")", ";", "temp", "=", "(", "temp", "-", "m", ")", "*", "60", ";", "s", "=", "Math", ".", "round", "(", "temp", ")", ";", "if", "(", "s", "==", "60", ")", "{", "m", "++", ";", "s", "=", "0", ";", "}", "if", "(", "m", "==", "60", ")", "{", "d", "++", ";", "m", "=", "0", ";", "}", "return", "(", "sign", "==", "-", "1", "?", "\"-\"", ":", "\"\"", ")", "+", "d", "+", "\"\\u00B0\"", "+", "\" \"", "+", "m", "+", "\"\\u2019\"", "+", "\" \"", "+", "s", "+", "\"\\u201D\"", ";", "}" ]
Returns a degrees-minutes-seconds string representation of a specified value in degrees. @param {Number} degrees The value for which to compute the string. @returns {String} The computed string in degrees, minutes and decimal seconds.
[ "Returns", "a", "degrees", "-", "minutes", "-", "seconds", "string", "representation", "of", "a", "specified", "value", "in", "degrees", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/geom/Angle.js#L153-L178
10,574
NASAWorldWind/WebWorldWind
src/ogc/ows/OwsOperationsMetadata.js
function (element) { if (!element) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "OwsOperationsMetadata", "constructor", "missingDomElement")); } var children = element.children || element.childNodes; for (var c = 0; c < children.length; c++) { var child = children[c]; if (child.localName === "Operation") { this.operation = this.operation || []; this.operation.push(OwsOperationsMetadata.assembleOperation(child)); } // TODO: Parameter, Constraint, ExtendedCapabilities } }
javascript
function (element) { if (!element) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "OwsOperationsMetadata", "constructor", "missingDomElement")); } var children = element.children || element.childNodes; for (var c = 0; c < children.length; c++) { var child = children[c]; if (child.localName === "Operation") { this.operation = this.operation || []; this.operation.push(OwsOperationsMetadata.assembleOperation(child)); } // TODO: Parameter, Constraint, ExtendedCapabilities } }
[ "function", "(", "element", ")", "{", "if", "(", "!", "element", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"OwsOperationsMetadata\"", ",", "\"constructor\"", ",", "\"missingDomElement\"", ")", ")", ";", "}", "var", "children", "=", "element", ".", "children", "||", "element", ".", "childNodes", ";", "for", "(", "var", "c", "=", "0", ";", "c", "<", "children", ".", "length", ";", "c", "++", ")", "{", "var", "child", "=", "children", "[", "c", "]", ";", "if", "(", "child", ".", "localName", "===", "\"Operation\"", ")", "{", "this", ".", "operation", "=", "this", ".", "operation", "||", "[", "]", ";", "this", ".", "operation", ".", "push", "(", "OwsOperationsMetadata", ".", "assembleOperation", "(", "child", ")", ")", ";", "}", "// TODO: Parameter, Constraint, ExtendedCapabilities", "}", "}" ]
Constructs an OWS Operations Metadata instance from an XML DOM. @alias OwsOperationsMetadata @constructor @classdesc Represents an OWS Operations Metadata section of an OGC capabilities document. This object holds as properties all the fields specified in the OWS Operations Metadata section. Most fields can be accessed as properties named according to their document names converted to camel case. For example, "operations". @param {Element} element An XML DOM element representing the OWS Service Provider section. @throws {ArgumentError} If the specified XML DOM element is null or undefined.
[ "Constructs", "an", "OWS", "Operations", "Metadata", "instance", "from", "an", "XML", "DOM", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/ogc/ows/OwsOperationsMetadata.js#L41-L57
10,575
NASAWorldWind/WebWorldWind
src/render/ScreenCreditController.js
function () { Layer.call(this, "ScreenCreditController"); /** * An {@link Offset} indicating where to place the attributions on the screen. * @type {Offset} * @default The lower left corner of the window with an 11px left margin and a 2px bottom margin. */ this.creditPlacement = new Offset(WorldWind.OFFSET_PIXELS, 11, WorldWind.OFFSET_PIXELS, 2); /** * The amount of horizontal spacing between adjacent attributions. * @type {number} * @default An 11px margin between attributions. */ this.creditMargin = 11; // Apply 50% opacity to all shapes rendered by this layer. this.opacity = 0.5; // Internal. Intentionally not documented. this.credits = []; }
javascript
function () { Layer.call(this, "ScreenCreditController"); /** * An {@link Offset} indicating where to place the attributions on the screen. * @type {Offset} * @default The lower left corner of the window with an 11px left margin and a 2px bottom margin. */ this.creditPlacement = new Offset(WorldWind.OFFSET_PIXELS, 11, WorldWind.OFFSET_PIXELS, 2); /** * The amount of horizontal spacing between adjacent attributions. * @type {number} * @default An 11px margin between attributions. */ this.creditMargin = 11; // Apply 50% opacity to all shapes rendered by this layer. this.opacity = 0.5; // Internal. Intentionally not documented. this.credits = []; }
[ "function", "(", ")", "{", "Layer", ".", "call", "(", "this", ",", "\"ScreenCreditController\"", ")", ";", "/**\n * An {@link Offset} indicating where to place the attributions on the screen.\n * @type {Offset}\n * @default The lower left corner of the window with an 11px left margin and a 2px bottom margin.\n */", "this", ".", "creditPlacement", "=", "new", "Offset", "(", "WorldWind", ".", "OFFSET_PIXELS", ",", "11", ",", "WorldWind", ".", "OFFSET_PIXELS", ",", "2", ")", ";", "/**\n * The amount of horizontal spacing between adjacent attributions.\n * @type {number}\n * @default An 11px margin between attributions.\n */", "this", ".", "creditMargin", "=", "11", ";", "// Apply 50% opacity to all shapes rendered by this layer.", "this", ".", "opacity", "=", "0.5", ";", "// Internal. Intentionally not documented.", "this", ".", "credits", "=", "[", "]", ";", "}" ]
Constructs a screen credit controller. @alias ScreenCreditController @constructor @augments Layer @classdesc Collects and displays screen credits.
[ "Constructs", "a", "screen", "credit", "controller", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/render/ScreenCreditController.js#L45-L67
10,576
NASAWorldWind/WebWorldWind
src/util/WWUtil.js
function () { var protocol = window.location.protocol, host = window.location.host, path = window.location.pathname, pathParts = path.split("/"), newPath = ""; for (var i = 0, len = pathParts.length; i < len - 1; i++) { if (pathParts[i].length > 0) { newPath = newPath + "/" + pathParts[i]; } } return protocol + "//" + host + newPath; }
javascript
function () { var protocol = window.location.protocol, host = window.location.host, path = window.location.pathname, pathParts = path.split("/"), newPath = ""; for (var i = 0, len = pathParts.length; i < len - 1; i++) { if (pathParts[i].length > 0) { newPath = newPath + "/" + pathParts[i]; } } return protocol + "//" + host + newPath; }
[ "function", "(", ")", "{", "var", "protocol", "=", "window", ".", "location", ".", "protocol", ",", "host", "=", "window", ".", "location", ".", "host", ",", "path", "=", "window", ".", "location", ".", "pathname", ",", "pathParts", "=", "path", ".", "split", "(", "\"/\"", ")", ",", "newPath", "=", "\"\"", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "pathParts", ".", "length", ";", "i", "<", "len", "-", "1", ";", "i", "++", ")", "{", "if", "(", "pathParts", "[", "i", "]", ".", "length", ">", "0", ")", "{", "newPath", "=", "newPath", "+", "\"/\"", "+", "pathParts", "[", "i", "]", ";", "}", "}", "return", "protocol", "+", "\"//\"", "+", "host", "+", "newPath", ";", "}" ]
Returns the current location URL as obtained from window.location with the last path component removed. @returns {String} The current location URL with the last path component removed.
[ "Returns", "the", "current", "location", "URL", "as", "obtained", "from", "window", ".", "location", "with", "the", "last", "path", "component", "removed", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWUtil.js#L64-L78
10,577
NASAWorldWind/WebWorldWind
src/util/WWUtil.js
function () { var scripts = document.getElementsByTagName("script"), libraryName = "/worldwind."; for (var i = 0; i < scripts.length; i++) { var index = scripts[i].src.indexOf(libraryName); if (index >= 0) { return scripts[i].src.substring(0, index) + "/"; } } return null; }
javascript
function () { var scripts = document.getElementsByTagName("script"), libraryName = "/worldwind."; for (var i = 0; i < scripts.length; i++) { var index = scripts[i].src.indexOf(libraryName); if (index >= 0) { return scripts[i].src.substring(0, index) + "/"; } } return null; }
[ "function", "(", ")", "{", "var", "scripts", "=", "document", ".", "getElementsByTagName", "(", "\"script\"", ")", ",", "libraryName", "=", "\"/worldwind.\"", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "scripts", ".", "length", ";", "i", "++", ")", "{", "var", "index", "=", "scripts", "[", "i", "]", ".", "src", ".", "indexOf", "(", "libraryName", ")", ";", "if", "(", "index", ">=", "0", ")", "{", "return", "scripts", "[", "i", "]", ".", "src", ".", "substring", "(", "0", ",", "index", ")", "+", "\"/\"", ";", "}", "}", "return", "null", ";", "}" ]
Returns the URL of the directory containing the WorldWind library. @returns {String} The URL of the directory containing the WorldWind library, or null if that directory cannot be determined.
[ "Returns", "the", "URL", "of", "the", "directory", "containing", "the", "WorldWind", "library", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWUtil.js#L85-L97
10,578
NASAWorldWind/WebWorldWind
src/util/WWUtil.js
function (url) { if (!url) return ""; var urlParts = url.split("/"), newPath = ""; for (var i = 0, len = urlParts.length; i < len; i++) { var part = urlParts[i]; if (!part || part.length === 0 || part.indexOf(":") != -1 || part === "." || part === ".." || part === "null" || part === "undefined") { continue; } if (newPath.length !== 0) { newPath = newPath + "/"; } newPath = newPath + part; } return newPath; }
javascript
function (url) { if (!url) return ""; var urlParts = url.split("/"), newPath = ""; for (var i = 0, len = urlParts.length; i < len; i++) { var part = urlParts[i]; if (!part || part.length === 0 || part.indexOf(":") != -1 || part === "." || part === ".." || part === "null" || part === "undefined") { continue; } if (newPath.length !== 0) { newPath = newPath + "/"; } newPath = newPath + part; } return newPath; }
[ "function", "(", "url", ")", "{", "if", "(", "!", "url", ")", "return", "\"\"", ";", "var", "urlParts", "=", "url", ".", "split", "(", "\"/\"", ")", ",", "newPath", "=", "\"\"", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "urlParts", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "var", "part", "=", "urlParts", "[", "i", "]", ";", "if", "(", "!", "part", "||", "part", ".", "length", "===", "0", "||", "part", ".", "indexOf", "(", "\":\"", ")", "!=", "-", "1", "||", "part", "===", "\".\"", "||", "part", "===", "\"..\"", "||", "part", "===", "\"null\"", "||", "part", "===", "\"undefined\"", ")", "{", "continue", ";", "}", "if", "(", "newPath", ".", "length", "!==", "0", ")", "{", "newPath", "=", "newPath", "+", "\"/\"", ";", "}", "newPath", "=", "newPath", "+", "part", ";", "}", "return", "newPath", ";", "}" ]
Returns the path component of a specified URL. @param {String} url The URL from which to determine the path component. @returns {String} The path component, or the empty string if the specified URL is null, undefined or empty.
[ "Returns", "the", "path", "component", "of", "a", "specified", "URL", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWUtil.js#L105-L132
10,579
NASAWorldWind/WebWorldWind
src/util/WWUtil.js
function (url, parameterName, callback) { // Generate a unique function name for the JSONP callback. var functionName = "gov_nasa_worldwind_jsonp_" + WWUtil.jsonpCounter++; // Define a JSONP callback function. Assign it to global scope the browser can find it. window[functionName] = function (jsonData) { // Remove the JSONP callback from global scope. delete window[functionName]; // Call the client's callback function. callback(jsonData); }; // Append the callback query parameter to the URL. var jsonpUrl = url + (url.indexOf('?') === -1 ? '?' : '&'); jsonpUrl += parameterName + "=" + functionName; // Create a script element for the browser to invoke. var script = document.createElement('script'); script.async = true; script.src = jsonpUrl; // Prepare to add the script to the document's head. var head = document.getElementsByTagName('head')[0]; // Set up to remove the script element once it's invoked. var cleanup = function () { script.onload = undefined; script.onerror = undefined; head.removeChild(script); }; script.onload = cleanup; script.onerror = cleanup; // Add the script element to the document, causing the browser to invoke it. head.appendChild(script); }
javascript
function (url, parameterName, callback) { // Generate a unique function name for the JSONP callback. var functionName = "gov_nasa_worldwind_jsonp_" + WWUtil.jsonpCounter++; // Define a JSONP callback function. Assign it to global scope the browser can find it. window[functionName] = function (jsonData) { // Remove the JSONP callback from global scope. delete window[functionName]; // Call the client's callback function. callback(jsonData); }; // Append the callback query parameter to the URL. var jsonpUrl = url + (url.indexOf('?') === -1 ? '?' : '&'); jsonpUrl += parameterName + "=" + functionName; // Create a script element for the browser to invoke. var script = document.createElement('script'); script.async = true; script.src = jsonpUrl; // Prepare to add the script to the document's head. var head = document.getElementsByTagName('head')[0]; // Set up to remove the script element once it's invoked. var cleanup = function () { script.onload = undefined; script.onerror = undefined; head.removeChild(script); }; script.onload = cleanup; script.onerror = cleanup; // Add the script element to the document, causing the browser to invoke it. head.appendChild(script); }
[ "function", "(", "url", ",", "parameterName", ",", "callback", ")", "{", "// Generate a unique function name for the JSONP callback.", "var", "functionName", "=", "\"gov_nasa_worldwind_jsonp_\"", "+", "WWUtil", ".", "jsonpCounter", "++", ";", "// Define a JSONP callback function. Assign it to global scope the browser can find it.", "window", "[", "functionName", "]", "=", "function", "(", "jsonData", ")", "{", "// Remove the JSONP callback from global scope.", "delete", "window", "[", "functionName", "]", ";", "// Call the client's callback function.", "callback", "(", "jsonData", ")", ";", "}", ";", "// Append the callback query parameter to the URL.", "var", "jsonpUrl", "=", "url", "+", "(", "url", ".", "indexOf", "(", "'?'", ")", "===", "-", "1", "?", "'?'", ":", "'&'", ")", ";", "jsonpUrl", "+=", "parameterName", "+", "\"=\"", "+", "functionName", ";", "// Create a script element for the browser to invoke.", "var", "script", "=", "document", ".", "createElement", "(", "'script'", ")", ";", "script", ".", "async", "=", "true", ";", "script", ".", "src", "=", "jsonpUrl", ";", "// Prepare to add the script to the document's head.", "var", "head", "=", "document", ".", "getElementsByTagName", "(", "'head'", ")", "[", "0", "]", ";", "// Set up to remove the script element once it's invoked.", "var", "cleanup", "=", "function", "(", ")", "{", "script", ".", "onload", "=", "undefined", ";", "script", ".", "onerror", "=", "undefined", ";", "head", ".", "removeChild", "(", "script", ")", ";", "}", ";", "script", ".", "onload", "=", "cleanup", ";", "script", ".", "onerror", "=", "cleanup", ";", "// Add the script element to the document, causing the browser to invoke it.", "head", ".", "appendChild", "(", "script", ")", ";", "}" ]
Request a resource using JSONP. @param {String} url The url to receive the request. @param {String} parameterName The JSONP callback function key required by the server. Typically "jsonp" or "callback". @param {Function} callback The function to invoke when the request succeeds. The function receives one argument, the JSON payload of the JSONP request.
[ "Request", "a", "resource", "using", "JSONP", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWUtil.js#L178-L216
10,580
NASAWorldWind/WebWorldWind
src/util/WWUtil.js
function (original) { var clone = {}; var i, keys = Object.keys(original); for (i = 0; i < keys.length; i++) { // copy each property into the clone clone[keys[i]] = original[keys[i]]; } return clone; }
javascript
function (original) { var clone = {}; var i, keys = Object.keys(original); for (i = 0; i < keys.length; i++) { // copy each property into the clone clone[keys[i]] = original[keys[i]]; } return clone; }
[ "function", "(", "original", ")", "{", "var", "clone", "=", "{", "}", ";", "var", "i", ",", "keys", "=", "Object", ".", "keys", "(", "original", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "i", "++", ")", "{", "// copy each property into the clone", "clone", "[", "keys", "[", "i", "]", "]", "=", "original", "[", "keys", "[", "i", "]", "]", ";", "}", "return", "clone", ";", "}" ]
It clones original object into the new one. It is necessary to retain the options information valid for all nodes. @param original Object to clone @returns {Object} Cloned object
[ "It", "clones", "original", "object", "into", "the", "new", "one", ".", "It", "is", "necessary", "to", "retain", "the", "options", "information", "valid", "for", "all", "nodes", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWUtil.js#L244-L254
10,581
NASAWorldWind/WebWorldWind
src/util/WWUtil.js
function(subjectString, searchString, position) { position = position || 0; return subjectString.substr(position, searchString.length) === searchString; }
javascript
function(subjectString, searchString, position) { position = position || 0; return subjectString.substr(position, searchString.length) === searchString; }
[ "function", "(", "subjectString", ",", "searchString", ",", "position", ")", "{", "position", "=", "position", "||", "0", ";", "return", "subjectString", ".", "substr", "(", "position", ",", "searchString", ".", "length", ")", "===", "searchString", ";", "}" ]
Determines whether subjectString begins with the characters of searchString. @param {String} subjectString The string to analyse. @param {String} searchString The characters to be searched for at the start of subjectString. @param {Number} position The position in subjectString at which to begin searching for searchString; defaults to 0. @return {Boolean} true if the given characters are found at the beginning of the string; otherwise, false.
[ "Determines", "whether", "subjectString", "begins", "with", "the", "characters", "of", "searchString", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWUtil.js#L287-L290
10,582
NASAWorldWind/WebWorldWind
src/util/WWUtil.js
function(subjectString, searchString, length) { if (typeof length !== 'number' || !isFinite(length) || Math.floor(length) !== length || length > subjectString.length) { length = subjectString.length; } length -= searchString.length; var lastIndex = subjectString.lastIndexOf(searchString, length); return lastIndex !== -1 && lastIndex === length; }
javascript
function(subjectString, searchString, length) { if (typeof length !== 'number' || !isFinite(length) || Math.floor(length) !== length || length > subjectString.length) { length = subjectString.length; } length -= searchString.length; var lastIndex = subjectString.lastIndexOf(searchString, length); return lastIndex !== -1 && lastIndex === length; }
[ "function", "(", "subjectString", ",", "searchString", ",", "length", ")", "{", "if", "(", "typeof", "length", "!==", "'number'", "||", "!", "isFinite", "(", "length", ")", "||", "Math", ".", "floor", "(", "length", ")", "!==", "length", "||", "length", ">", "subjectString", ".", "length", ")", "{", "length", "=", "subjectString", ".", "length", ";", "}", "length", "-=", "searchString", ".", "length", ";", "var", "lastIndex", "=", "subjectString", ".", "lastIndexOf", "(", "searchString", ",", "length", ")", ";", "return", "lastIndex", "!==", "-", "1", "&&", "lastIndex", "===", "length", ";", "}" ]
Determines whether subjectString ends with the characters of searchString. @param {String} subjectString The string to analyse. @param {String} searchString The characters to be searched for at the end of subjectString. @param {Number} length Optional. If provided overwrites the considered length of the string to search in. If omitted, the default value is the length of the string. @return {Boolean} true if the given characters are found at the end of the string; otherwise, false.
[ "Determines", "whether", "subjectString", "ends", "with", "the", "characters", "of", "searchString", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WWUtil.js#L299-L306
10,583
NASAWorldWind/WebWorldWind
src/globe/WcsEarthElevationCoverage.js
function () { TiledElevationCoverage.call(this, { coverageSector: Sector.FULL_SPHERE, resolution: 0.008333333333333, retrievalImageFormat: "image/tiff", minElevation: -11000, maxElevation: 8850, urlBuilder: new WcsTileUrlBuilder("https://worldwind26.arc.nasa.gov/wms2", "NASA_SRTM30_900m_Tiled", "1.0.0") }); this.displayName = "WCS Earth Elevation Coverage"; }
javascript
function () { TiledElevationCoverage.call(this, { coverageSector: Sector.FULL_SPHERE, resolution: 0.008333333333333, retrievalImageFormat: "image/tiff", minElevation: -11000, maxElevation: 8850, urlBuilder: new WcsTileUrlBuilder("https://worldwind26.arc.nasa.gov/wms2", "NASA_SRTM30_900m_Tiled", "1.0.0") }); this.displayName = "WCS Earth Elevation Coverage"; }
[ "function", "(", ")", "{", "TiledElevationCoverage", ".", "call", "(", "this", ",", "{", "coverageSector", ":", "Sector", ".", "FULL_SPHERE", ",", "resolution", ":", "0.008333333333333", ",", "retrievalImageFormat", ":", "\"image/tiff\"", ",", "minElevation", ":", "-", "11000", ",", "maxElevation", ":", "8850", ",", "urlBuilder", ":", "new", "WcsTileUrlBuilder", "(", "\"https://worldwind26.arc.nasa.gov/wms2\"", ",", "\"NASA_SRTM30_900m_Tiled\"", ",", "\"1.0.0\"", ")", "}", ")", ";", "this", ".", "displayName", "=", "\"WCS Earth Elevation Coverage\"", ";", "}" ]
Constructs an Earth elevation model. @alias WcsEarthElevationCoverage @constructor @augments TiledElevationCoverage @classdesc Provides elevations for Earth. Elevations are drawn from the NASA WorldWind elevation service. @deprecated
[ "Constructs", "an", "Earth", "elevation", "model", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/globe/WcsEarthElevationCoverage.js#L40-L52
10,584
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (contours, resultContours) { var doesCross = false; for (var i = 0, len = contours.length; i < len; i++) { var contourInfo = this.splitContour(contours[i]); if (contourInfo.polygons.length > 1) { doesCross = true; } resultContours.push(contourInfo); } return doesCross; }
javascript
function (contours, resultContours) { var doesCross = false; for (var i = 0, len = contours.length; i < len; i++) { var contourInfo = this.splitContour(contours[i]); if (contourInfo.polygons.length > 1) { doesCross = true; } resultContours.push(contourInfo); } return doesCross; }
[ "function", "(", "contours", ",", "resultContours", ")", "{", "var", "doesCross", "=", "false", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "contours", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "var", "contourInfo", "=", "this", ".", "splitContour", "(", "contours", "[", "i", "]", ")", ";", "if", "(", "contourInfo", ".", "polygons", ".", "length", ">", "1", ")", "{", "doesCross", "=", "true", ";", "}", "resultContours", ".", "push", "(", "contourInfo", ")", ";", "}", "return", "doesCross", ";", "}" ]
Splits an array of polygons that cross the anti-meridian or contain a pole. @param {Array} contours an array of arrays of Locations or Positions Each array entry defines one of this polygon's boundaries. @param {Array} resultContours an empty array to put the result of the split. Each element will have the shape of PolygonSplitter.formatContourOutput @returns {Boolean} true if one of the boundaries crosses the anti-meridian otherwise false
[ "Splits", "an", "array", "of", "polygons", "that", "cross", "the", "anti", "-", "meridian", "or", "contain", "a", "pole", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L54-L66
10,585
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (points) { var iMap = new HashMap(); var newPoints = []; var intersections = []; var polygons = []; var iMaps = []; var poleIndex = -1; var pole = this.findIntersectionAndPole(points, newPoints, intersections, iMap); if (intersections.length === 0) { polygons.push(newPoints); iMaps.push(iMap); return this.formatContourOutput(polygons, pole, poleIndex, iMaps); } if (intersections.length > 2) { intersections.sort(function (a, b) { return b.latitude - a.latitude; }); } if (pole !== Location.poles.NONE) { newPoints = this.handleOnePole(newPoints, intersections, iMap, pole); iMap = this.reindexIntersections(intersections, iMap, this.poleIndexOffset); } if (intersections.length === 0) { polygons.push(newPoints); iMaps.push(iMap); poleIndex = 0; return this.formatContourOutput(polygons, pole, poleIndex, iMaps); } this.linkIntersections(intersections, iMap); poleIndex = this.makePolygons(newPoints, intersections, iMap, polygons, iMaps); return this.formatContourOutput(polygons, pole, poleIndex, iMaps); }
javascript
function (points) { var iMap = new HashMap(); var newPoints = []; var intersections = []; var polygons = []; var iMaps = []; var poleIndex = -1; var pole = this.findIntersectionAndPole(points, newPoints, intersections, iMap); if (intersections.length === 0) { polygons.push(newPoints); iMaps.push(iMap); return this.formatContourOutput(polygons, pole, poleIndex, iMaps); } if (intersections.length > 2) { intersections.sort(function (a, b) { return b.latitude - a.latitude; }); } if (pole !== Location.poles.NONE) { newPoints = this.handleOnePole(newPoints, intersections, iMap, pole); iMap = this.reindexIntersections(intersections, iMap, this.poleIndexOffset); } if (intersections.length === 0) { polygons.push(newPoints); iMaps.push(iMap); poleIndex = 0; return this.formatContourOutput(polygons, pole, poleIndex, iMaps); } this.linkIntersections(intersections, iMap); poleIndex = this.makePolygons(newPoints, intersections, iMap, polygons, iMaps); return this.formatContourOutput(polygons, pole, poleIndex, iMaps); }
[ "function", "(", "points", ")", "{", "var", "iMap", "=", "new", "HashMap", "(", ")", ";", "var", "newPoints", "=", "[", "]", ";", "var", "intersections", "=", "[", "]", ";", "var", "polygons", "=", "[", "]", ";", "var", "iMaps", "=", "[", "]", ";", "var", "poleIndex", "=", "-", "1", ";", "var", "pole", "=", "this", ".", "findIntersectionAndPole", "(", "points", ",", "newPoints", ",", "intersections", ",", "iMap", ")", ";", "if", "(", "intersections", ".", "length", "===", "0", ")", "{", "polygons", ".", "push", "(", "newPoints", ")", ";", "iMaps", ".", "push", "(", "iMap", ")", ";", "return", "this", ".", "formatContourOutput", "(", "polygons", ",", "pole", ",", "poleIndex", ",", "iMaps", ")", ";", "}", "if", "(", "intersections", ".", "length", ">", "2", ")", "{", "intersections", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "return", "b", ".", "latitude", "-", "a", ".", "latitude", ";", "}", ")", ";", "}", "if", "(", "pole", "!==", "Location", ".", "poles", ".", "NONE", ")", "{", "newPoints", "=", "this", ".", "handleOnePole", "(", "newPoints", ",", "intersections", ",", "iMap", ",", "pole", ")", ";", "iMap", "=", "this", ".", "reindexIntersections", "(", "intersections", ",", "iMap", ",", "this", ".", "poleIndexOffset", ")", ";", "}", "if", "(", "intersections", ".", "length", "===", "0", ")", "{", "polygons", ".", "push", "(", "newPoints", ")", ";", "iMaps", ".", "push", "(", "iMap", ")", ";", "poleIndex", "=", "0", ";", "return", "this", ".", "formatContourOutput", "(", "polygons", ",", "pole", ",", "poleIndex", ",", "iMaps", ")", ";", "}", "this", ".", "linkIntersections", "(", "intersections", ",", "iMap", ")", ";", "poleIndex", "=", "this", ".", "makePolygons", "(", "newPoints", ",", "intersections", ",", "iMap", ",", "polygons", ",", "iMaps", ")", ";", "return", "this", ".", "formatContourOutput", "(", "polygons", ",", "pole", ",", "poleIndex", ",", "iMaps", ")", ";", "}" ]
Splits a polygon that cross the anti-meridian or contain a pole. @param {Location[] | Position[]} points an array of Locations or Positions that define a polygon @returns {Object} @see PolygonSplitter.formatContourOutput
[ "Splits", "a", "polygon", "that", "cross", "the", "anti", "-", "meridian", "or", "contain", "a", "pole", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L74-L112
10,586
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (points, newPoints, intersections, iMap) { var containsPole = false; var minLatitude = 90.0; var maxLatitude = -90.0; this.addedIndex = -1; for (var i = 0, lenC = points.length; i < lenC; i++) { var pt1 = points[i]; var pt2 = points[(i + 1) % lenC]; minLatitude = Math.min(minLatitude, pt1.latitude); maxLatitude = Math.max(maxLatitude, pt1.latitude); var doesCross = Location.locationsCrossDateLine([pt1, pt2]); if (doesCross) { containsPole = !containsPole; var iLatitude = Location.meridianIntersection(pt1, pt2, 180); if (iLatitude === null) { iLatitude = (pt1.latitude + pt2.latitude) / 2; } var iLongitude = WWMath.signum(pt1.longitude) * 180 || 180; var iLoc1 = this.createPoint(iLatitude, iLongitude, pt1.altitude); var iLoc2 = this.createPoint(iLatitude, -iLongitude, pt2.altitude); this.safeAdd(newPoints, pt1, i, lenC); var index = newPoints.length; iMap.set(index, this.makeIntersectionEntry(index)); iMap.set(index + 1, this.makeIntersectionEntry(index + 1)); intersections.push({ indexEnd: index, indexStart: index + 1, latitude: iLatitude }); newPoints.push(iLoc1); newPoints.push(iLoc2); this.safeAdd(newPoints, pt2, i + 1, lenC); } else { this.safeAdd(newPoints, pt1, i, lenC); this.safeAdd(newPoints, pt2, i + 1, lenC); } } var pole = Location.poles.NONE; if (containsPole) { pole = this.determinePole(minLatitude, maxLatitude); } return pole; }
javascript
function (points, newPoints, intersections, iMap) { var containsPole = false; var minLatitude = 90.0; var maxLatitude = -90.0; this.addedIndex = -1; for (var i = 0, lenC = points.length; i < lenC; i++) { var pt1 = points[i]; var pt2 = points[(i + 1) % lenC]; minLatitude = Math.min(minLatitude, pt1.latitude); maxLatitude = Math.max(maxLatitude, pt1.latitude); var doesCross = Location.locationsCrossDateLine([pt1, pt2]); if (doesCross) { containsPole = !containsPole; var iLatitude = Location.meridianIntersection(pt1, pt2, 180); if (iLatitude === null) { iLatitude = (pt1.latitude + pt2.latitude) / 2; } var iLongitude = WWMath.signum(pt1.longitude) * 180 || 180; var iLoc1 = this.createPoint(iLatitude, iLongitude, pt1.altitude); var iLoc2 = this.createPoint(iLatitude, -iLongitude, pt2.altitude); this.safeAdd(newPoints, pt1, i, lenC); var index = newPoints.length; iMap.set(index, this.makeIntersectionEntry(index)); iMap.set(index + 1, this.makeIntersectionEntry(index + 1)); intersections.push({ indexEnd: index, indexStart: index + 1, latitude: iLatitude }); newPoints.push(iLoc1); newPoints.push(iLoc2); this.safeAdd(newPoints, pt2, i + 1, lenC); } else { this.safeAdd(newPoints, pt1, i, lenC); this.safeAdd(newPoints, pt2, i + 1, lenC); } } var pole = Location.poles.NONE; if (containsPole) { pole = this.determinePole(minLatitude, maxLatitude); } return pole; }
[ "function", "(", "points", ",", "newPoints", ",", "intersections", ",", "iMap", ")", "{", "var", "containsPole", "=", "false", ";", "var", "minLatitude", "=", "90.0", ";", "var", "maxLatitude", "=", "-", "90.0", ";", "this", ".", "addedIndex", "=", "-", "1", ";", "for", "(", "var", "i", "=", "0", ",", "lenC", "=", "points", ".", "length", ";", "i", "<", "lenC", ";", "i", "++", ")", "{", "var", "pt1", "=", "points", "[", "i", "]", ";", "var", "pt2", "=", "points", "[", "(", "i", "+", "1", ")", "%", "lenC", "]", ";", "minLatitude", "=", "Math", ".", "min", "(", "minLatitude", ",", "pt1", ".", "latitude", ")", ";", "maxLatitude", "=", "Math", ".", "max", "(", "maxLatitude", ",", "pt1", ".", "latitude", ")", ";", "var", "doesCross", "=", "Location", ".", "locationsCrossDateLine", "(", "[", "pt1", ",", "pt2", "]", ")", ";", "if", "(", "doesCross", ")", "{", "containsPole", "=", "!", "containsPole", ";", "var", "iLatitude", "=", "Location", ".", "meridianIntersection", "(", "pt1", ",", "pt2", ",", "180", ")", ";", "if", "(", "iLatitude", "===", "null", ")", "{", "iLatitude", "=", "(", "pt1", ".", "latitude", "+", "pt2", ".", "latitude", ")", "/", "2", ";", "}", "var", "iLongitude", "=", "WWMath", ".", "signum", "(", "pt1", ".", "longitude", ")", "*", "180", "||", "180", ";", "var", "iLoc1", "=", "this", ".", "createPoint", "(", "iLatitude", ",", "iLongitude", ",", "pt1", ".", "altitude", ")", ";", "var", "iLoc2", "=", "this", ".", "createPoint", "(", "iLatitude", ",", "-", "iLongitude", ",", "pt2", ".", "altitude", ")", ";", "this", ".", "safeAdd", "(", "newPoints", ",", "pt1", ",", "i", ",", "lenC", ")", ";", "var", "index", "=", "newPoints", ".", "length", ";", "iMap", ".", "set", "(", "index", ",", "this", ".", "makeIntersectionEntry", "(", "index", ")", ")", ";", "iMap", ".", "set", "(", "index", "+", "1", ",", "this", ".", "makeIntersectionEntry", "(", "index", "+", "1", ")", ")", ";", "intersections", ".", "push", "(", "{", "indexEnd", ":", "index", ",", "indexStart", ":", "index", "+", "1", ",", "latitude", ":", "iLatitude", "}", ")", ";", "newPoints", ".", "push", "(", "iLoc1", ")", ";", "newPoints", ".", "push", "(", "iLoc2", ")", ";", "this", ".", "safeAdd", "(", "newPoints", ",", "pt2", ",", "i", "+", "1", ",", "lenC", ")", ";", "}", "else", "{", "this", ".", "safeAdd", "(", "newPoints", ",", "pt1", ",", "i", ",", "lenC", ")", ";", "this", ".", "safeAdd", "(", "newPoints", ",", "pt2", ",", "i", "+", "1", ",", "lenC", ")", ";", "}", "}", "var", "pole", "=", "Location", ".", "poles", ".", "NONE", ";", "if", "(", "containsPole", ")", "{", "pole", "=", "this", ".", "determinePole", "(", "minLatitude", ",", "maxLatitude", ")", ";", "}", "return", "pole", ";", "}" ]
Internal. Applications should not call this method. Finds the intersections with the anti-meridian and if the polygon contains one of the poles. A new polygon is constructed with the intersections and pole points and stored in newPoints @param {Location[] | Position[]} points An array of Locations or Positions that define a polygon @param {Location[] | Position[]} newPoints An empty array where to store the resulting polygon with intersections @param {Array} intersections An empty array where to store the intersection latitude and index @param {HashMap} iMap A hashMap to store intersection data The key is the index in the newPoints array and value is PolygonSplitter.makeIntersectionEntry @returns {Number} The pole number @see Location.poles
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "Finds", "the", "intersections", "with", "the", "anti", "-", "meridian", "and", "if", "the", "polygon", "contains", "one", "of", "the", "poles", ".", "A", "new", "polygon", "is", "constructed", "with", "the", "intersections", "and", "pole", "points", "and", "stored", "in", "newPoints" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L126-L180
10,587
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (minLatitude, maxLatitude) { var pole; if (minLatitude > 0) { pole = Location.poles.NORTH; // Entirely in Northern Hemisphere. } else if (maxLatitude < 0) { pole = Location.poles.SOUTH; // Entirely in Southern Hemisphere. } else if (Math.abs(maxLatitude) >= Math.abs(minLatitude)) { pole = Location.poles.NORTH; // Spans equator, but more north than south. } else { pole = Location.poles.SOUTH; // Spans equator, but more south than north. } return pole; }
javascript
function (minLatitude, maxLatitude) { var pole; if (minLatitude > 0) { pole = Location.poles.NORTH; // Entirely in Northern Hemisphere. } else if (maxLatitude < 0) { pole = Location.poles.SOUTH; // Entirely in Southern Hemisphere. } else if (Math.abs(maxLatitude) >= Math.abs(minLatitude)) { pole = Location.poles.NORTH; // Spans equator, but more north than south. } else { pole = Location.poles.SOUTH; // Spans equator, but more south than north. } return pole; }
[ "function", "(", "minLatitude", ",", "maxLatitude", ")", "{", "var", "pole", ";", "if", "(", "minLatitude", ">", "0", ")", "{", "pole", "=", "Location", ".", "poles", ".", "NORTH", ";", "// Entirely in Northern Hemisphere.", "}", "else", "if", "(", "maxLatitude", "<", "0", ")", "{", "pole", "=", "Location", ".", "poles", ".", "SOUTH", ";", "// Entirely in Southern Hemisphere.", "}", "else", "if", "(", "Math", ".", "abs", "(", "maxLatitude", ")", ">=", "Math", ".", "abs", "(", "minLatitude", ")", ")", "{", "pole", "=", "Location", ".", "poles", ".", "NORTH", ";", "// Spans equator, but more north than south.", "}", "else", "{", "pole", "=", "Location", ".", "poles", ".", "SOUTH", ";", "// Spans equator, but more south than north.", "}", "return", "pole", ";", "}" ]
Internal. Applications should not call this method. Determine which pole is enclosed. If the shape is entirely in one hemisphere, then assume that it encloses the pole in that hemisphere. Otherwise, assume that it encloses the pole that is closest to the shape's extreme latitude. @param {Number} minLatitude The minimum latitude of a polygon that contains a pole @param {Number} maxLatitude The maximum latitude of a polygon that contains a pole @returns {Number} The pole number @see Location.poles
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "Determine", "which", "pole", "is", "enclosed", ".", "If", "the", "shape", "is", "entirely", "in", "one", "hemisphere", "then", "assume", "that", "it", "encloses", "the", "pole", "in", "that", "hemisphere", ".", "Otherwise", "assume", "that", "it", "encloses", "the", "pole", "that", "is", "closest", "to", "the", "shape", "s", "extreme", "latitude", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L191-L206
10,588
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (points, intersections, iMap, pole) { var pointsClone; if (pole === Location.poles.NORTH) { var intersection = intersections.shift(); var poleLat = 90; } else if (pole === Location.poles.SOUTH) { intersection = intersections.pop(); poleLat = -90; } var iEnd = iMap.get(intersection.indexEnd); var iStart = iMap.get(intersection.indexStart); iEnd.forPole = true; iStart.forPole = true; this.poleIndexOffset = intersection.indexStart; pointsClone = points.slice(0, intersection.indexEnd + 1); var polePoint1 = this.createPoint(poleLat, points[iEnd.index].longitude, points[iEnd.index].altitude); var polePoint2 = this.createPoint(poleLat, points[iStart.index].longitude, points[iStart.index].altitude); pointsClone.push(polePoint1, polePoint2); pointsClone = pointsClone.concat(points.slice(this.poleIndexOffset)); return pointsClone; }
javascript
function (points, intersections, iMap, pole) { var pointsClone; if (pole === Location.poles.NORTH) { var intersection = intersections.shift(); var poleLat = 90; } else if (pole === Location.poles.SOUTH) { intersection = intersections.pop(); poleLat = -90; } var iEnd = iMap.get(intersection.indexEnd); var iStart = iMap.get(intersection.indexStart); iEnd.forPole = true; iStart.forPole = true; this.poleIndexOffset = intersection.indexStart; pointsClone = points.slice(0, intersection.indexEnd + 1); var polePoint1 = this.createPoint(poleLat, points[iEnd.index].longitude, points[iEnd.index].altitude); var polePoint2 = this.createPoint(poleLat, points[iStart.index].longitude, points[iStart.index].altitude); pointsClone.push(polePoint1, polePoint2); pointsClone = pointsClone.concat(points.slice(this.poleIndexOffset)); return pointsClone; }
[ "function", "(", "points", ",", "intersections", ",", "iMap", ",", "pole", ")", "{", "var", "pointsClone", ";", "if", "(", "pole", "===", "Location", ".", "poles", ".", "NORTH", ")", "{", "var", "intersection", "=", "intersections", ".", "shift", "(", ")", ";", "var", "poleLat", "=", "90", ";", "}", "else", "if", "(", "pole", "===", "Location", ".", "poles", ".", "SOUTH", ")", "{", "intersection", "=", "intersections", ".", "pop", "(", ")", ";", "poleLat", "=", "-", "90", ";", "}", "var", "iEnd", "=", "iMap", ".", "get", "(", "intersection", ".", "indexEnd", ")", ";", "var", "iStart", "=", "iMap", ".", "get", "(", "intersection", ".", "indexStart", ")", ";", "iEnd", ".", "forPole", "=", "true", ";", "iStart", ".", "forPole", "=", "true", ";", "this", ".", "poleIndexOffset", "=", "intersection", ".", "indexStart", ";", "pointsClone", "=", "points", ".", "slice", "(", "0", ",", "intersection", ".", "indexEnd", "+", "1", ")", ";", "var", "polePoint1", "=", "this", ".", "createPoint", "(", "poleLat", ",", "points", "[", "iEnd", ".", "index", "]", ".", "longitude", ",", "points", "[", "iEnd", ".", "index", "]", ".", "altitude", ")", ";", "var", "polePoint2", "=", "this", ".", "createPoint", "(", "poleLat", ",", "points", "[", "iStart", ".", "index", "]", ".", "longitude", ",", "points", "[", "iStart", ".", "index", "]", ".", "altitude", ")", ";", "pointsClone", ".", "push", "(", "polePoint1", ",", "polePoint2", ")", ";", "pointsClone", "=", "pointsClone", ".", "concat", "(", "points", ".", "slice", "(", "this", ".", "poleIndexOffset", ")", ")", ";", "return", "pointsClone", ";", "}" ]
Internal. Applications should not call this method. Creates a new array of points containing the two pole locations on both sides of the anti-meridian @param {Location[] | Position[]} points @param {Array} intersections @param {HashMap} iMap @param {Number} pole @return {Object} an object containing the new points and a new reIndexed iMap
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "Creates", "a", "new", "array", "of", "points", "containing", "the", "two", "pole", "locations", "on", "both", "sides", "of", "the", "anti", "-", "meridian" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L218-L244
10,589
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (intersections, iMap) { for (var i = 0; i < intersections.length - 1; i += 2) { var i0 = intersections[i]; var i1 = intersections[i + 1]; var iEnd0 = iMap.get(i0.indexEnd); var iStart0 = iMap.get(i0.indexStart); var iEnd1 = iMap.get(i1.indexEnd); var iStart1 = iMap.get(i1.indexStart); iEnd0.linkTo = i1.indexStart; iStart0.linkTo = i1.indexEnd; iEnd1.linkTo = i0.indexStart; iStart1.linkTo = i0.indexEnd; } }
javascript
function (intersections, iMap) { for (var i = 0; i < intersections.length - 1; i += 2) { var i0 = intersections[i]; var i1 = intersections[i + 1]; var iEnd0 = iMap.get(i0.indexEnd); var iStart0 = iMap.get(i0.indexStart); var iEnd1 = iMap.get(i1.indexEnd); var iStart1 = iMap.get(i1.indexStart); iEnd0.linkTo = i1.indexStart; iStart0.linkTo = i1.indexEnd; iEnd1.linkTo = i0.indexStart; iStart1.linkTo = i0.indexEnd; } }
[ "function", "(", "intersections", ",", "iMap", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "intersections", ".", "length", "-", "1", ";", "i", "+=", "2", ")", "{", "var", "i0", "=", "intersections", "[", "i", "]", ";", "var", "i1", "=", "intersections", "[", "i", "+", "1", "]", ";", "var", "iEnd0", "=", "iMap", ".", "get", "(", "i0", ".", "indexEnd", ")", ";", "var", "iStart0", "=", "iMap", ".", "get", "(", "i0", ".", "indexStart", ")", ";", "var", "iEnd1", "=", "iMap", ".", "get", "(", "i1", ".", "indexEnd", ")", ";", "var", "iStart1", "=", "iMap", ".", "get", "(", "i1", ".", "indexStart", ")", ";", "iEnd0", ".", "linkTo", "=", "i1", ".", "indexStart", ";", "iStart0", ".", "linkTo", "=", "i1", ".", "indexEnd", ";", "iEnd1", ".", "linkTo", "=", "i0", ".", "indexStart", ";", "iStart1", ".", "linkTo", "=", "i0", ".", "indexEnd", ";", "}", "}" ]
Internal. Applications should not call this method. Links adjacents pairs of intersection by index @param {Array} intersections @param {HashMap} iMap
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "Links", "adjacents", "pairs", "of", "intersection", "by", "index" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L252-L267
10,590
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (intersections, iMap, indexOffset) { iMap = HashMap.reIndex(iMap, indexOffset, 2); for (var i = 0, len = intersections.length; i < len; i++) { if (intersections[i].indexEnd >= indexOffset) { intersections[i].indexEnd += 2; } if (intersections[i].indexStart >= indexOffset) { intersections[i].indexStart += 2; } } return iMap; }
javascript
function (intersections, iMap, indexOffset) { iMap = HashMap.reIndex(iMap, indexOffset, 2); for (var i = 0, len = intersections.length; i < len; i++) { if (intersections[i].indexEnd >= indexOffset) { intersections[i].indexEnd += 2; } if (intersections[i].indexStart >= indexOffset) { intersections[i].indexStart += 2; } } return iMap; }
[ "function", "(", "intersections", ",", "iMap", ",", "indexOffset", ")", "{", "iMap", "=", "HashMap", ".", "reIndex", "(", "iMap", ",", "indexOffset", ",", "2", ")", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "intersections", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "intersections", "[", "i", "]", ".", "indexEnd", ">=", "indexOffset", ")", "{", "intersections", "[", "i", "]", ".", "indexEnd", "+=", "2", ";", "}", "if", "(", "intersections", "[", "i", "]", ".", "indexStart", ">=", "indexOffset", ")", "{", "intersections", "[", "i", "]", ".", "indexStart", "+=", "2", ";", "}", "}", "return", "iMap", ";", "}" ]
Internal. Applications should not call this method. ReIndexes the intersections due to the poles being added to the array of points @param {Array} intersections @param {HashMap} iMap @param {Number} indexOffset the index from which to start reIndexing @returns {HashMap} a new hash map with the correct indices
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "ReIndexes", "the", "intersections", "due", "to", "the", "poles", "being", "added", "to", "the", "array", "of", "points" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L277-L290
10,591
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (start, end, points, iMap, resultPolygon, polygonHashMap) { var pass = false; var len = points.length; var containsPole = false; if (end < start) { end += len; } for (var i = start; i <= end; i++) { var idx = i % len; var pt = points[idx]; var intersection = iMap.get(idx); if (intersection) { if (intersection.visited) { break; } resultPolygon.push(pt); polygonHashMap.set(resultPolygon.length - 1, intersection); if (intersection.forPole) { containsPole = true; } else { if (pass) { i = intersection.linkTo - 1; if (i + 1 === start) { break; } } pass = !pass; intersection.visited = true; } } else { resultPolygon.push(pt); } } return containsPole; }
javascript
function (start, end, points, iMap, resultPolygon, polygonHashMap) { var pass = false; var len = points.length; var containsPole = false; if (end < start) { end += len; } for (var i = start; i <= end; i++) { var idx = i % len; var pt = points[idx]; var intersection = iMap.get(idx); if (intersection) { if (intersection.visited) { break; } resultPolygon.push(pt); polygonHashMap.set(resultPolygon.length - 1, intersection); if (intersection.forPole) { containsPole = true; } else { if (pass) { i = intersection.linkTo - 1; if (i + 1 === start) { break; } } pass = !pass; intersection.visited = true; } } else { resultPolygon.push(pt); } } return containsPole; }
[ "function", "(", "start", ",", "end", ",", "points", ",", "iMap", ",", "resultPolygon", ",", "polygonHashMap", ")", "{", "var", "pass", "=", "false", ";", "var", "len", "=", "points", ".", "length", ";", "var", "containsPole", "=", "false", ";", "if", "(", "end", "<", "start", ")", "{", "end", "+=", "len", ";", "}", "for", "(", "var", "i", "=", "start", ";", "i", "<=", "end", ";", "i", "++", ")", "{", "var", "idx", "=", "i", "%", "len", ";", "var", "pt", "=", "points", "[", "idx", "]", ";", "var", "intersection", "=", "iMap", ".", "get", "(", "idx", ")", ";", "if", "(", "intersection", ")", "{", "if", "(", "intersection", ".", "visited", ")", "{", "break", ";", "}", "resultPolygon", ".", "push", "(", "pt", ")", ";", "polygonHashMap", ".", "set", "(", "resultPolygon", ".", "length", "-", "1", ",", "intersection", ")", ";", "if", "(", "intersection", ".", "forPole", ")", "{", "containsPole", "=", "true", ";", "}", "else", "{", "if", "(", "pass", ")", "{", "i", "=", "intersection", ".", "linkTo", "-", "1", ";", "if", "(", "i", "+", "1", "===", "start", ")", "{", "break", ";", "}", "}", "pass", "=", "!", "pass", ";", "intersection", ".", "visited", "=", "true", ";", "}", "}", "else", "{", "resultPolygon", ".", "push", "(", "pt", ")", ";", "}", "}", "return", "containsPole", ";", "}" ]
Internal. Applications should not call this method. Paths from a start intersection index to an end intersection index and makes a polygon and a hashMap with the intersection indices @param {Number} start the index of a start type intersection @param {Number} end the index of an end type intersection @param {Location[] | Position[]} points @param {HashMap} iMap @param {Location[] | Position[]} resultPolygon an empty array to store the resulting polygon @param {HashMap} polygonHashMap a hash map to record the indices of the intersections in the polygon @returns {Boolean} true if the polygon contains a pole
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "Paths", "from", "a", "start", "intersection", "index", "to", "an", "end", "intersection", "index", "and", "makes", "a", "polygon", "and", "a", "hashMap", "with", "the", "intersection", "indices" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L349-L391
10,592
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (points, point, index, len) { if (this.addedIndex < index && this.addedIndex < len - 1) { points.push(point); this.addedIndex = index; } }
javascript
function (points, point, index, len) { if (this.addedIndex < index && this.addedIndex < len - 1) { points.push(point); this.addedIndex = index; } }
[ "function", "(", "points", ",", "point", ",", "index", ",", "len", ")", "{", "if", "(", "this", ".", "addedIndex", "<", "index", "&&", "this", ".", "addedIndex", "<", "len", "-", "1", ")", "{", "points", ".", "push", "(", "point", ")", ";", "this", ".", "addedIndex", "=", "index", ";", "}", "}" ]
Internal. Applications should not call this method. Adds an element to an array preventing duplication @param {Location[] | Position[]} points @param {Location | Position} point @param {Number} index The index of the Point from the source array @param {Number} len The length of the source array
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "Adds", "an", "element", "to", "an", "array", "preventing", "duplication" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L401-L406
10,593
NASAWorldWind/WebWorldWind
src/util/PolygonSplitter.js
function (latitude, longitude, altitude) { if (altitude == null) { return new Location(latitude, longitude); } return new Position(latitude, longitude, altitude); }
javascript
function (latitude, longitude, altitude) { if (altitude == null) { return new Location(latitude, longitude); } return new Position(latitude, longitude, altitude); }
[ "function", "(", "latitude", ",", "longitude", ",", "altitude", ")", "{", "if", "(", "altitude", "==", "null", ")", "{", "return", "new", "Location", "(", "latitude", ",", "longitude", ")", ";", "}", "return", "new", "Position", "(", "latitude", ",", "longitude", ",", "altitude", ")", ";", "}" ]
Internal. Applications should not call this method. Creates a Location or a Position @param {Number} latitude @param {Number} longitude @param {Number} altitude @returns Location | Position
[ "Internal", ".", "Applications", "should", "not", "call", "this", "method", ".", "Creates", "a", "Location", "or", "a", "Position" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/PolygonSplitter.js#L416-L421
10,594
NASAWorldWind/WebWorldWind
src/formats/wkt/geom/WktObject.js
function (type) { /** * Type of this object. * @type {WKTType} */ this.type = type; /** * It is possible for the WKT object to be displayed not in 2D but in 3D. * @type {Boolean} * @private */ this._is3d = false; /** * It is possible for the WKT object to be referenced using Linear referencing system. This is flag for it. * @type {boolean} * @private */ this._isLrs = false; /** * * @type {Position[]|Location[]} */ this.coordinates = []; /** * Options contains information relevant for parsing of this specific Object. Basically processed tokens, parsed * coordinates and amounts of parntheses used to find out whether the object was already finished. * @type {{coordinates: Array, leftParenthesis: number, rightParenthesis: number, tokens: Array}} */ this.options = { coordinates: [], leftParenthesis: 0, rightParenthesis: 0, tokens: [] }; }
javascript
function (type) { /** * Type of this object. * @type {WKTType} */ this.type = type; /** * It is possible for the WKT object to be displayed not in 2D but in 3D. * @type {Boolean} * @private */ this._is3d = false; /** * It is possible for the WKT object to be referenced using Linear referencing system. This is flag for it. * @type {boolean} * @private */ this._isLrs = false; /** * * @type {Position[]|Location[]} */ this.coordinates = []; /** * Options contains information relevant for parsing of this specific Object. Basically processed tokens, parsed * coordinates and amounts of parntheses used to find out whether the object was already finished. * @type {{coordinates: Array, leftParenthesis: number, rightParenthesis: number, tokens: Array}} */ this.options = { coordinates: [], leftParenthesis: 0, rightParenthesis: 0, tokens: [] }; }
[ "function", "(", "type", ")", "{", "/**\n * Type of this object.\n * @type {WKTType}\n */", "this", ".", "type", "=", "type", ";", "/**\n * It is possible for the WKT object to be displayed not in 2D but in 3D.\n * @type {Boolean}\n * @private\n */", "this", ".", "_is3d", "=", "false", ";", "/**\n * It is possible for the WKT object to be referenced using Linear referencing system. This is flag for it.\n * @type {boolean}\n * @private\n */", "this", ".", "_isLrs", "=", "false", ";", "/**\n *\n * @type {Position[]|Location[]}\n */", "this", ".", "coordinates", "=", "[", "]", ";", "/**\n * Options contains information relevant for parsing of this specific Object. Basically processed tokens, parsed\n * coordinates and amounts of parntheses used to find out whether the object was already finished.\n * @type {{coordinates: Array, leftParenthesis: number, rightParenthesis: number, tokens: Array}}\n */", "this", ".", "options", "=", "{", "coordinates", ":", "[", "]", ",", "leftParenthesis", ":", "0", ",", "rightParenthesis", ":", "0", ",", "tokens", ":", "[", "]", "}", ";", "}" ]
THis shouldn't be initiated from outside. It is only for internal use. Every other WKT Objects are themselves WktObject @alias WktObject @param type {String} Textual representation of the type of current object. @constructor
[ "THis", "shouldn", "t", "be", "initiated", "from", "outside", ".", "It", "is", "only", "for", "internal", "use", ".", "Every", "other", "WKT", "Objects", "are", "themselves", "WktObject" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/wkt/geom/WktObject.js#L36-L74
10,595
NASAWorldWind/WebWorldWind
examples/GoToLocation.js
function (recognizer) { // Obtain the event location. var x = recognizer.clientX, y = recognizer.clientY; // Perform the pick. Must first convert from window coordinates to canvas coordinates, which are // relative to the upper left corner of the canvas rather than the upper left corner of the page. var pickList = wwd.pick(wwd.canvasCoordinates(x, y)); // If only one thing is picked and it is the terrain, tell the WorldWindow to go to the picked location. if (pickList.objects.length === 1 && pickList.objects[0].isTerrain) { var position = pickList.objects[0].position; wwd.goTo(new WorldWind.Location(position.latitude, position.longitude)); } }
javascript
function (recognizer) { // Obtain the event location. var x = recognizer.clientX, y = recognizer.clientY; // Perform the pick. Must first convert from window coordinates to canvas coordinates, which are // relative to the upper left corner of the canvas rather than the upper left corner of the page. var pickList = wwd.pick(wwd.canvasCoordinates(x, y)); // If only one thing is picked and it is the terrain, tell the WorldWindow to go to the picked location. if (pickList.objects.length === 1 && pickList.objects[0].isTerrain) { var position = pickList.objects[0].position; wwd.goTo(new WorldWind.Location(position.latitude, position.longitude)); } }
[ "function", "(", "recognizer", ")", "{", "// Obtain the event location.", "var", "x", "=", "recognizer", ".", "clientX", ",", "y", "=", "recognizer", ".", "clientY", ";", "// Perform the pick. Must first convert from window coordinates to canvas coordinates, which are", "// relative to the upper left corner of the canvas rather than the upper left corner of the page.", "var", "pickList", "=", "wwd", ".", "pick", "(", "wwd", ".", "canvasCoordinates", "(", "x", ",", "y", ")", ")", ";", "// If only one thing is picked and it is the terrain, tell the WorldWindow to go to the picked location.", "if", "(", "pickList", ".", "objects", ".", "length", "===", "1", "&&", "pickList", ".", "objects", "[", "0", "]", ".", "isTerrain", ")", "{", "var", "position", "=", "pickList", ".", "objects", "[", "0", "]", ".", "position", ";", "wwd", ".", "goTo", "(", "new", "WorldWind", ".", "Location", "(", "position", ".", "latitude", ",", "position", ".", "longitude", ")", ")", ";", "}", "}" ]
Now set up to handle clicks and taps. The common gesture-handling function.
[ "Now", "set", "up", "to", "handle", "clicks", "and", "taps", ".", "The", "common", "gesture", "-", "handling", "function", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/GoToLocation.js#L54-L68
10,596
NASAWorldWind/WebWorldWind
src/layer/Layer.js
function (displayName) { /** * This layer's display name. * @type {String} * @default "Layer" */ this.displayName = displayName ? displayName : "Layer"; /** * Indicates whether to display this layer. * @type {Boolean} * @default true */ this.enabled = true; /** * Indicates whether this layer is pickable. * @type {Boolean} * @default true */ this.pickEnabled = true; /** * This layer's opacity, which is combined with the opacity of shapes within layers. * Opacity is in the range [0, 1], with 1 indicating fully opaque. * @type {Number} * @default 1 */ this.opacity = 1; /** * The eye altitude above which this layer is displayed, in meters. * @type {Number} * @default -Number.MAX_VALUE (always displayed) */ this.minActiveAltitude = -Number.MAX_VALUE; /** * The eye altitude below which this layer is displayed, in meters. * @type {Number} * @default Number.MAX_VALUE (always displayed) */ this.maxActiveAltitude = Number.MAX_VALUE; /** * Indicates whether elements of this layer were drawn in the most recently generated frame. * @type {Boolean} * @readonly */ this.inCurrentFrame = false; /** * The time to display. This property selects the layer contents that represents the specified time. * If null, layer-type dependent contents are displayed. * @type {Date} */ this.time = null; }
javascript
function (displayName) { /** * This layer's display name. * @type {String} * @default "Layer" */ this.displayName = displayName ? displayName : "Layer"; /** * Indicates whether to display this layer. * @type {Boolean} * @default true */ this.enabled = true; /** * Indicates whether this layer is pickable. * @type {Boolean} * @default true */ this.pickEnabled = true; /** * This layer's opacity, which is combined with the opacity of shapes within layers. * Opacity is in the range [0, 1], with 1 indicating fully opaque. * @type {Number} * @default 1 */ this.opacity = 1; /** * The eye altitude above which this layer is displayed, in meters. * @type {Number} * @default -Number.MAX_VALUE (always displayed) */ this.minActiveAltitude = -Number.MAX_VALUE; /** * The eye altitude below which this layer is displayed, in meters. * @type {Number} * @default Number.MAX_VALUE (always displayed) */ this.maxActiveAltitude = Number.MAX_VALUE; /** * Indicates whether elements of this layer were drawn in the most recently generated frame. * @type {Boolean} * @readonly */ this.inCurrentFrame = false; /** * The time to display. This property selects the layer contents that represents the specified time. * If null, layer-type dependent contents are displayed. * @type {Date} */ this.time = null; }
[ "function", "(", "displayName", ")", "{", "/**\n * This layer's display name.\n * @type {String}\n * @default \"Layer\"\n */", "this", ".", "displayName", "=", "displayName", "?", "displayName", ":", "\"Layer\"", ";", "/**\n * Indicates whether to display this layer.\n * @type {Boolean}\n * @default true\n */", "this", ".", "enabled", "=", "true", ";", "/**\n * Indicates whether this layer is pickable.\n * @type {Boolean}\n * @default true\n */", "this", ".", "pickEnabled", "=", "true", ";", "/**\n * This layer's opacity, which is combined with the opacity of shapes within layers.\n * Opacity is in the range [0, 1], with 1 indicating fully opaque.\n * @type {Number}\n * @default 1\n */", "this", ".", "opacity", "=", "1", ";", "/**\n * The eye altitude above which this layer is displayed, in meters.\n * @type {Number}\n * @default -Number.MAX_VALUE (always displayed)\n */", "this", ".", "minActiveAltitude", "=", "-", "Number", ".", "MAX_VALUE", ";", "/**\n * The eye altitude below which this layer is displayed, in meters.\n * @type {Number}\n * @default Number.MAX_VALUE (always displayed)\n */", "this", ".", "maxActiveAltitude", "=", "Number", ".", "MAX_VALUE", ";", "/**\n * Indicates whether elements of this layer were drawn in the most recently generated frame.\n * @type {Boolean}\n * @readonly\n */", "this", ".", "inCurrentFrame", "=", "false", ";", "/**\n * The time to display. This property selects the layer contents that represents the specified time.\n * If null, layer-type dependent contents are displayed.\n * @type {Date}\n */", "this", ".", "time", "=", "null", ";", "}" ]
Constructs a layer. This constructor is meant to be called by subclasses and not directly by an application. @alias Layer @constructor @classdesc Provides an abstract base class for layer implementations. This class is not meant to be instantiated directly.
[ "Constructs", "a", "layer", ".", "This", "constructor", "is", "meant", "to", "be", "called", "by", "subclasses", "and", "not", "directly", "by", "an", "application", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/Layer.js#L33-L91
10,597
NASAWorldWind/WebWorldWind
src/util/GoToAnimator.js
function (worldWindow) { if (!worldWindow) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "GoToAnimator", "constructor", "missingWorldWindow")); } /** * The WorldWindow associated with this animator. * @type {WorldWindow} * @readonly */ this.wwd = worldWindow; /** * The frequency in milliseconds at which to animate the position change. * @type {Number} * @default 20 */ this.animationFrequency = 20; /** * The animation's duration, in milliseconds. When the distance is short, less than twice the viewport * size, the travel time is reduced proportionally to the distance to travel. It therefore takes less * time to move shorter distances. * @type {Number} * @default 3000 */ this.travelTime = 3000; /** * Indicates whether the current or most recent animation has been cancelled. Use the cancel() function * to cancel an animation. * @type {Boolean} * @default false * @readonly */ this.cancelled = false; }
javascript
function (worldWindow) { if (!worldWindow) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "GoToAnimator", "constructor", "missingWorldWindow")); } /** * The WorldWindow associated with this animator. * @type {WorldWindow} * @readonly */ this.wwd = worldWindow; /** * The frequency in milliseconds at which to animate the position change. * @type {Number} * @default 20 */ this.animationFrequency = 20; /** * The animation's duration, in milliseconds. When the distance is short, less than twice the viewport * size, the travel time is reduced proportionally to the distance to travel. It therefore takes less * time to move shorter distances. * @type {Number} * @default 3000 */ this.travelTime = 3000; /** * Indicates whether the current or most recent animation has been cancelled. Use the cancel() function * to cancel an animation. * @type {Boolean} * @default false * @readonly */ this.cancelled = false; }
[ "function", "(", "worldWindow", ")", "{", "if", "(", "!", "worldWindow", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"GoToAnimator\"", ",", "\"constructor\"", ",", "\"missingWorldWindow\"", ")", ")", ";", "}", "/**\n * The WorldWindow associated with this animator.\n * @type {WorldWindow}\n * @readonly\n */", "this", ".", "wwd", "=", "worldWindow", ";", "/**\n * The frequency in milliseconds at which to animate the position change.\n * @type {Number}\n * @default 20\n */", "this", ".", "animationFrequency", "=", "20", ";", "/**\n * The animation's duration, in milliseconds. When the distance is short, less than twice the viewport\n * size, the travel time is reduced proportionally to the distance to travel. It therefore takes less\n * time to move shorter distances.\n * @type {Number}\n * @default 3000\n */", "this", ".", "travelTime", "=", "3000", ";", "/**\n * Indicates whether the current or most recent animation has been cancelled. Use the cancel() function\n * to cancel an animation.\n * @type {Boolean}\n * @default false\n * @readonly\n */", "this", ".", "cancelled", "=", "false", ";", "}" ]
Constructs a GoTo animator. @alias GoToAnimator @constructor @classdesc Incrementally and smoothly moves a {@link Navigator} to a specified position. @param {WorldWindow} worldWindow The WorldWindow in which to perform the animation. @throws {ArgumentError} If the specified WorldWindow is null or undefined.
[ "Constructs", "a", "GoTo", "animator", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/GoToAnimator.js#L39-L76
10,598
NASAWorldWind/WebWorldWind
src/projections/GeographicProjection.js
function (displayName, continuous, projectionLimits) { /** * This projection's display name. * @type {string} */ this.displayName = displayName || "Geographic Projection"; /** * Indicates whether this projection should be treated as continuous with itself. If true, the 2D map * will appear to scroll continuously horizontally. * @type {boolean} * @readonly */ this.continuous = continuous; /** * Indicates the geographic limits of this projection. * @type {Sector} * @readonly */ this.projectionLimits = projectionLimits; /** * Indicates whether this projection is a 2D projection. * @type {boolean} * @readonly */ this.is2D = true; }
javascript
function (displayName, continuous, projectionLimits) { /** * This projection's display name. * @type {string} */ this.displayName = displayName || "Geographic Projection"; /** * Indicates whether this projection should be treated as continuous with itself. If true, the 2D map * will appear to scroll continuously horizontally. * @type {boolean} * @readonly */ this.continuous = continuous; /** * Indicates the geographic limits of this projection. * @type {Sector} * @readonly */ this.projectionLimits = projectionLimits; /** * Indicates whether this projection is a 2D projection. * @type {boolean} * @readonly */ this.is2D = true; }
[ "function", "(", "displayName", ",", "continuous", ",", "projectionLimits", ")", "{", "/**\n * This projection's display name.\n * @type {string}\n */", "this", ".", "displayName", "=", "displayName", "||", "\"Geographic Projection\"", ";", "/**\n * Indicates whether this projection should be treated as continuous with itself. If true, the 2D map\n * will appear to scroll continuously horizontally.\n * @type {boolean}\n * @readonly\n */", "this", ".", "continuous", "=", "continuous", ";", "/**\n * Indicates the geographic limits of this projection.\n * @type {Sector}\n * @readonly\n */", "this", ".", "projectionLimits", "=", "projectionLimits", ";", "/**\n * Indicates whether this projection is a 2D projection.\n * @type {boolean}\n * @readonly\n */", "this", ".", "is2D", "=", "true", ";", "}" ]
Constructs a base geographic projection. @alias GeographicProjection @constructor @classdesc Represents a geographic projection. This is an abstract class and is meant to be instantiated only by subclasses. See the following projections: <ul> <li>{@link ProjectionEquirectangular}</li> <li>{@link ProjectionMercator}</li> <li>{@link ProjectionPolarEquidistant}</li> <li>{@link ProjectionUPS}</li> </ul> @param {String} displayName The projection's display name. @param {boolean} continuous Indicates whether this projection is continuous. @param {Sector} projectionLimits This projection's projection limits. May be null to indicate the full range of latitude and longitude, +/- 90 degrees latitude, +/- 180 degrees longitude.
[ "Constructs", "a", "base", "geographic", "projection", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/projections/GeographicProjection.js#L50-L79
10,599
NASAWorldWind/WebWorldWind
src/projections/ProjectionPolarEquidistant.js
function (pole) { GeographicProjection.call(this, "Polar Equidistant", false, null); // Internal. Intentionally not documented. See "pole" property accessor below for public interface. this._pole = pole; // Internal. Intentionally not documented. this.north = !(pole === "South"); // Documented in superclass. this.displayName = this.north ? "North Polar" : "South Polar"; // Internal. Intentionally not documented. See "stateKey" property accessor below for public interface. this._stateKey = "projection polar equidistant " + this._pole + " "; }
javascript
function (pole) { GeographicProjection.call(this, "Polar Equidistant", false, null); // Internal. Intentionally not documented. See "pole" property accessor below for public interface. this._pole = pole; // Internal. Intentionally not documented. this.north = !(pole === "South"); // Documented in superclass. this.displayName = this.north ? "North Polar" : "South Polar"; // Internal. Intentionally not documented. See "stateKey" property accessor below for public interface. this._stateKey = "projection polar equidistant " + this._pole + " "; }
[ "function", "(", "pole", ")", "{", "GeographicProjection", ".", "call", "(", "this", ",", "\"Polar Equidistant\"", ",", "false", ",", "null", ")", ";", "// Internal. Intentionally not documented. See \"pole\" property accessor below for public interface.", "this", ".", "_pole", "=", "pole", ";", "// Internal. Intentionally not documented.", "this", ".", "north", "=", "!", "(", "pole", "===", "\"South\"", ")", ";", "// Documented in superclass.", "this", ".", "displayName", "=", "this", ".", "north", "?", "\"North Polar\"", ":", "\"South Polar\"", ";", "// Internal. Intentionally not documented. See \"stateKey\" property accessor below for public interface.", "this", ".", "_stateKey", "=", "\"projection polar equidistant \"", "+", "this", ".", "_pole", "+", "\" \"", ";", "}" ]
Constructs a polar equidistant geographic projection. @alias ProjectionPolarEquidistant @constructor @augments GeographicProjection @classdesc Represents a polar equidistant geographic projection. @param {String} pole Indicates the north or south aspect. Specify "North" for the north aspect or "South" for the south aspect.
[ "Constructs", "a", "polar", "equidistant", "geographic", "projection", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/projections/ProjectionPolarEquidistant.js#L41-L56