Select to view content in your preferred language

enhanced Draw Widget coordinate precision issue FV 3.0 Final

2623
3
Jump to solution
06-28-2012 02:48 PM
RhettZufelt
MVP Notable Contributor
I am using the enhanced Draw Widget v 3.0 with FlexViewer 3 Final (uncompiled version).

I see the <numericlabelprecision> tag only modifies the number of decimal places for the right-click context menu.  Is there a way to modify the number of decimal points for the "show measurements" option when a point is clicked?


Ideally, I would like the default 2 decimal places except when user selects Decimal Degrees.  Then would like more than two to show up, but as is, that is all we get.

R_
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   Find the numFormatter and change the precision form 2 to numPrecision:

        <mx:NumberFormatter id="numFormatter"                             precision="{numPrecision}"                             useThousandsSeparator="true"/>


This will allow the numericlabelprecision to take affect on the number placed as text on the screen as well. As far as having it a different precision when using decimal degrees, you will have to make that code change with some simple logic that checks the units choosen.

View solution in original post

0 Kudos
3 Replies
MLowry
by
Frequent Contributor

Is there a way to modify the number of decimal points for the "show measurements" option when a point is clicked?



Sure, just use a NumberFormatter like this:
<mx:NumberFormatter id="numFormatterMeasure"
                            precision="2"
                            useThousandsSeparator="false"/>

And find out what the variable being populated by the measurement is, such as a function like this: 
private function createLengthsLabel(length:Number, lengthAbbrev:String):String
            {
                return lengthLabel + " " + numFormatterMeasure.format(length) + " " + lengthAbbrev;
            }
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   Find the numFormatter and change the precision form 2 to numPrecision:

        <mx:NumberFormatter id="numFormatter"                             precision="{numPrecision}"                             useThousandsSeparator="true"/>


This will allow the numericlabelprecision to take affect on the number placed as text on the screen as well. As far as having it a different precision when using decimal degrees, you will have to make that code change with some simple logic that checks the units choosen.
0 Kudos
RhettZufelt
MVP Notable Contributor
Thanks guys, that got me on the right track.  However, it brought up some strange behaviour that I will mention in a separate post.

Wasn't sure how to rate this as both were  valuable info.  Roberts was more specific to the edrawwiget.mxml so I marked his as the answer, but gave M a point...

R_
0 Kudos