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;
        }
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 ; /**
             * 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 ; }
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 .