Select to view content in your preferred language

Elevation Profile - meters only?

4474
11
Jump to solution
01-22-2013 09:03 AM
DanJensen
Deactivated User
When configuring the Elevation Profile widget for ArcGIS Viewer for Flex 3.x to use feet (rather than meters), the graph's y-axis still shows numbers that are obviously meters even though they are labled as feet.  Does anyone have a solution for this problem?

I have also noticed the distance measurement (x-axis) looks correct but is off slightly, but I am chalking that one up to Web Mercatur.

Thanks,
-Dan
Tags (2)
11 Replies
DanJensen
Deactivated User
I must have downloaded a bad version of the widget.  I had to alter the code in both the elvations function and the consolidateDataForCharts function inside the CharWindow.mxml.  After adding the multiplication necessary to those two functions, I am now getting the correct values for elevation in feet.
0 Kudos
RhettZufelt
MVP Notable Contributor
Does look like you got some odd code, maybe even some development code or something as mine has this separated into two functions.

Here is my elevations function (and the addElevationsToPoints that looks like is "included" in your elevations function):

    function elevations( oResult:Object, nFromMeters:Number ):Array {
     var aryElevations:Array = new Array();
     for ( var iElevationSet:int = 0; iElevationSet < oResult.elevations.length; iElevationSet++ ) {
      var aryElevationSet:Array = oResult.elevations[ iElevationSet ];
      for ( var iElevation:int = 0; iElevation < aryElevationSet.length; iElevation++ ) 
       aryElevations.push( aryElevationSet[ iElevation ] * nFromMeters );
     }
     
     return aryElevations;
    }
    function addElevationsToPoints( oResult:Object, aryElevations:Array ):void {
     var aryResult:Array = new Array();
     var iCurItemIdx:int = -1;
     
     // For each geometry...
     for ( var iGeom:int = 0; iGeom < oResult.geometries.length; iGeom++ ) {
      var oGeom:Object = oResult.geometries[ iGeom ];
      
      // For each path in each geometry...
      for ( var iPath:int = 0; iPath < oGeom.paths.length; iPath++ ) {
       var aryPath:Array = oGeom.paths[ iPath ];
       
       // For each point in each path...
       for ( var iPt:int = 0; iPt < aryPath.length; iPt++ ) {
        var ptCurrent:Array = aryPath[ iPt ];
        ptCurrent.push( aryElevations[ ++iCurItemIdx ] );
       }
      }
     }
    }
   }


R_
0 Kudos