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
            }
        }
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 .