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");
                    }
                }
            }
        }
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 .