src/layer/CoordinatesDisplayLayer.js
function (worldWindow) {
            if (!worldWindow) {
                throw new ArgumentError(
                    Logger.logMessage(Logger.LEVEL_SEVERE, "CoordinatesDisplayLayer", "constructor", "missingWorldWindow"));
            }

            Layer.call(this, "Coordinates");

            /**
             * The WorldWindow associated with this layer.
             * @type {WorldWindow}
             * @readonly
             */
            this.wwd = worldWindow;

            // No picking of this layer's screen elements.
            this.pickEnabled = false;

            // Intentionally not documented.
            this.eventType = null;

            // Intentionally not documented.
            this.clientX = null;

            // Intentionally not documented.
            this.clientY = null;

            // Intentionally not documented.
            this.terrainPosition = null;

            // Intentionally not documented.
            this.latText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.latText.attributes = new TextAttributes(null);
            this.latText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            this.lonText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.lonText.attributes = new TextAttributes(null);
            this.lonText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            this.elevText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.elevText.attributes = new TextAttributes(null);
            this.elevText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            this.eyeText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.eyeText.attributes = new TextAttributes(null);
            this.eyeText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            var imageOffset = new Offset(WorldWind.OFFSET_FRACTION, 0.5, WorldWind.OFFSET_FRACTION, 0.5),
                imagePath = WorldWind.configuration.baseUrl + "images/crosshair.png";
            this.crosshairImage = new ScreenImage(imageOffset, imagePath);

            // Register user input event listeners on the WorldWindow.
            var thisLayer = this;

            function eventListener(event) {
                thisLayer.handleUIEvent(event);
            }

            if (window.PointerEvent) {
                worldWindow.addEventListener("pointerdown", eventListener);
                worldWindow.addEventListener("pointermove", eventListener);
                worldWindow.addEventListener("pointerleave", eventListener);
            } else {
                worldWindow.addEventListener("mousedown", eventListener);
                worldWindow.addEventListener("mousemove", eventListener);
                worldWindow.addEventListener("mouseleave", eventListener);
                worldWindow.addEventListener("touchstart", eventListener);
                worldWindow.addEventListener("touchmove", eventListener);
            }

            // Register a redraw callback on the WorldWindow.
            function redrawCallback(worldWindow, stage) {
                thisLayer.handleRedraw(stage);
            }

            this.wwd.redrawCallbacks.push(redrawCallback);
        }
function (worldWindow) {
            if (!worldWindow) {
                throw new ArgumentError(
                    Logger.logMessage(Logger.LEVEL_SEVERE, "CoordinatesDisplayLayer", "constructor", "missingWorldWindow"));
            }

            Layer.call(this, "Coordinates");

            /**
             * The WorldWindow associated with this layer.
             * @type {WorldWindow}
             * @readonly
             */
            this.wwd = worldWindow;

            // No picking of this layer's screen elements.
            this.pickEnabled = false;

            // Intentionally not documented.
            this.eventType = null;

            // Intentionally not documented.
            this.clientX = null;

            // Intentionally not documented.
            this.clientY = null;

            // Intentionally not documented.
            this.terrainPosition = null;

            // Intentionally not documented.
            this.latText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.latText.attributes = new TextAttributes(null);
            this.latText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            this.lonText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.lonText.attributes = new TextAttributes(null);
            this.lonText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            this.elevText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.elevText.attributes = new TextAttributes(null);
            this.elevText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            this.eyeText = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 0, WorldWind.OFFSET_PIXELS, 0), " ");
            this.eyeText.attributes = new TextAttributes(null);
            this.eyeText.attributes.color = Color.YELLOW;

            // Intentionally not documented.
            var imageOffset = new Offset(WorldWind.OFFSET_FRACTION, 0.5, WorldWind.OFFSET_FRACTION, 0.5),
                imagePath = WorldWind.configuration.baseUrl + "images/crosshair.png";
            this.crosshairImage = new ScreenImage(imageOffset, imagePath);

            // Register user input event listeners on the WorldWindow.
            var thisLayer = this;

            function eventListener(event) {
                thisLayer.handleUIEvent(event);
            }

            if (window.PointerEvent) {
                worldWindow.addEventListener("pointerdown", eventListener);
                worldWindow.addEventListener("pointermove", eventListener);
                worldWindow.addEventListener("pointerleave", eventListener);
            } else {
                worldWindow.addEventListener("mousedown", eventListener);
                worldWindow.addEventListener("mousemove", eventListener);
                worldWindow.addEventListener("mouseleave", eventListener);
                worldWindow.addEventListener("touchstart", eventListener);
                worldWindow.addEventListener("touchmove", eventListener);
            }

            // Register a redraw callback on the WorldWindow.
            function redrawCallback(worldWindow, stage) {
                thisLayer.handleRedraw(stage);
            }

            this.wwd.redrawCallbacks.push(redrawCallback);
        }
function ( worldWindow ) { if ( ! worldWindow ) { throw new ArgumentError ( Logger . logMessage ( Logger . LEVEL_SEVERE , "CoordinatesDisplayLayer" , "constructor" , "missingWorldWindow" ) ) ; } Layer . call ( this , "Coordinates" ) ; /**
             * The WorldWindow associated with this layer.
             * @type {WorldWindow}
             * @readonly
             */ this . wwd = worldWindow ; // No picking of this layer's screen elements. this . pickEnabled = false ; // Intentionally not documented. this . eventType = null ; // Intentionally not documented. this . clientX = null ; // Intentionally not documented. this . clientY = null ; // Intentionally not documented. this . terrainPosition = null ; // Intentionally not documented. this . latText = new ScreenText ( new Offset ( WorldWind . OFFSET_PIXELS , 0 , WorldWind . OFFSET_PIXELS , 0 ) , " " ) ; this . latText . attributes = new TextAttributes ( null ) ; this . latText . attributes . color = Color . YELLOW ; // Intentionally not documented. this . lonText = new ScreenText ( new Offset ( WorldWind . OFFSET_PIXELS , 0 , WorldWind . OFFSET_PIXELS , 0 ) , " " ) ; this . lonText . attributes = new TextAttributes ( null ) ; this . lonText . attributes . color = Color . YELLOW ; // Intentionally not documented. this . elevText = new ScreenText ( new Offset ( WorldWind . OFFSET_PIXELS , 0 , WorldWind . OFFSET_PIXELS , 0 ) , " " ) ; this . elevText . attributes = new TextAttributes ( null ) ; this . elevText . attributes . color = Color . YELLOW ; // Intentionally not documented. this . eyeText = new ScreenText ( new Offset ( WorldWind . OFFSET_PIXELS , 0 , WorldWind . OFFSET_PIXELS , 0 ) , " " ) ; this . eyeText . attributes = new TextAttributes ( null ) ; this . eyeText . attributes . color = Color . YELLOW ; // Intentionally not documented. var imageOffset = new Offset ( WorldWind . OFFSET_FRACTION , 0.5 , WorldWind . OFFSET_FRACTION , 0.5 ) , imagePath = WorldWind . configuration . baseUrl + "images/crosshair.png" ; this . crosshairImage = new ScreenImage ( imageOffset , imagePath ) ; // Register user input event listeners on the WorldWindow. var thisLayer = this ; function eventListener ( event ) { thisLayer . handleUIEvent ( event ) ; } if ( window . PointerEvent ) { worldWindow . addEventListener ( "pointerdown" , eventListener ) ; worldWindow . addEventListener ( "pointermove" , eventListener ) ; worldWindow . addEventListener ( "pointerleave" , eventListener ) ; } else { worldWindow . addEventListener ( "mousedown" , eventListener ) ; worldWindow . addEventListener ( "mousemove" , eventListener ) ; worldWindow . addEventListener ( "mouseleave" , eventListener ) ; worldWindow . addEventListener ( "touchstart" , eventListener ) ; worldWindow . addEventListener ( "touchmove" , eventListener ) ; } // Register a redraw callback on the WorldWindow. function redrawCallback ( worldWindow , stage ) { thisLayer . handleRedraw ( stage ) ; } this . wwd . redrawCallbacks . push ( redrawCallback ) ; }
Constructs a layer that displays the current map coordinates.
@alias CoordinatesDisplayLayer
@constructor
@augments Layer
@classDesc Displays the current map coordinates. A coordinates display layer cannot be shared among World
Windows. Each WorldWindow if it is to have a coordinates display layer must have its own. See the
MultiWindow example for guidance.
@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 coordinates display.
@throws {ArgumentError} If the specified WorldWindow is null or undefined.
Constructs a layer that displays the current map coordinates .