examples/Measurements.js
// Calculate the length and area measurements of the path defined before.
Calculate the length and area measurements of the path defined before.
Calculate the length and area measurements of the path defined before .
function doCalc() {
            var distance = lengthMeasurer.getLength(pathPositions, false, WorldWind.GREAT_CIRCLE);
            var terrainDistance = lengthMeasurer.getLength(pathPositions, true, WorldWind.GREAT_CIRCLE);
            var geographicDistance = lengthMeasurer.getGeographicDistance(pathPositions, WorldWind.GREAT_CIRCLE);
            var area = areaMeasurer.getArea(pathPositions, false);
            var terrainArea = areaMeasurer.getArea(pathPositions, true);
            geoDistSpan.textContent = (geographicDistance / 1e3).toFixed(3);
            distSpan.textContent = (distance / 1e3).toFixed(3);
            terrainDistSpan.textContent = (terrainDistance / 1e3).toFixed(3);
            projectedAreaSpan.textContent = (area / 1e6).toFixed(3);
            terrainAreaSpan.textContent = (terrainArea / 1e6).toFixed(3);
        }
function doCalc ( ) { var distance = lengthMeasurer . getLength ( pathPositions , false , WorldWind . GREAT_CIRCLE ) ; var terrainDistance = lengthMeasurer . getLength ( pathPositions , true , WorldWind . GREAT_CIRCLE ) ; var geographicDistance = lengthMeasurer . getGeographicDistance ( pathPositions , WorldWind . GREAT_CIRCLE ) ; var area = areaMeasurer . getArea ( pathPositions , false ) ; var terrainArea = areaMeasurer . getArea ( pathPositions , true ) ; geoDistSpan . textContent = ( geographicDistance / 1e3 ) . toFixed ( 3 ) ; distSpan . textContent = ( distance / 1e3 ) . toFixed ( 3 ) ; terrainDistSpan . textContent = ( terrainDistance / 1e3 ) . toFixed ( 3 ) ; projectedAreaSpan . textContent = ( area / 1e6 ) . toFixed ( 3 ) ; terrainAreaSpan . textContent = ( terrainArea / 1e6 ) . toFixed ( 3 ) ; }
Calculate the length and area measurements of the path defined before.
Calculate the length and area measurements of the path defined before .
// Display the results.