3.12 Measurement Widget Distance Conversion Incorrect

4408
2
01-09-2015 02:00 PM
JoelBennett
MVP Regular Contributor

I've found the 3.12 measurement widget gives incorrect results under certain circumstances.  This can be reproduced on the Measurement sample hosted by ESRI at:

http://developers.arcgis.com/javascript/samples/widget_measurement/

To reproduce:

1) Select the distance tool.

2) Select any units except Miles.

3) Draw and finish a polyline with the measure tool.  The number of vertices is insignificant.  After drawing, the measurement is correct.

4) Change the units to something else.  The value is updated, but incorrect.

If you're using a locally hosted version of the API, here are the instructions that [I believe] fix the problem:

1) open esri/dijit/Measurement.js with Notepad or other text editing program

2) Search (ctrl-f) for the following text (it only occurs once in the file): this.result=this._outputResult

3) Keep the function call, but remove the assignment.  For example, change it to: /*this.result=*/this._outputResult

4) Save the file

0 Kudos
2 Replies
WayneBoras
New Contributor III

Hi Joel,

Thank you for posting this fix. I was having the same problem.

0 Kudos
JoelBennett
MVP Regular Contributor

Just for posterity, this was fixed in 3.13.  ESRI made no mention of it that I know of.

0 Kudos