<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Measurement Dijit show wrong distance on mouse move in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90077#M8186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, I am still confused.&amp;nbsp; Is the final result a geodesic measurement or a planar measurement?&amp;nbsp; If the final result is geodesic why does it change so much once I drop the final point?&amp;nbsp; If the final distance is a planar measurement, why don't we just do a planar measurement from the start?&amp;nbsp; I get the whole the earth isn't flat, spheroid vs ellipsoid vs surficial distance measurement argument. I am just trying to figure out how and why the tool works like it does.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I measure a distance along property lines in ArcMap (approx. 200 ft) there is about 1/100th of a foot difference between the planar distance and the goedesic distance.&amp;nbsp; But with the measure tool in ArcGIS Server JSAPI (and i am not using snapping for this) I get a difference of about 5 feet over the same 200 foot distance until I drop the final point.&amp;nbsp; Once I drop that final point the distance is with a foot of the reading in ArcMap (will within range considering no snapping and the scale range).&amp;nbsp; Again ALL of our maps, in both ArcMap and ArcGIS Server are in the same coordinate system - TN State Plane Coordinate System.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It may seem like I am beating a dead horse but this has come up in court cases and it is hard to defend when you see one measurement as you hover and another when you drop the point.&amp;nbsp; We are required to appear in court several times a year to defend a map that has been used to in a trial - so I kinda need to know how this is working.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Feb 2014 13:13:16 GMT</pubDate>
    <dc:creator>BryanLynn</dc:creator>
    <dc:date>2014-02-05T13:13:16Z</dc:date>
    <item>
      <title>Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90070#M8179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are using the Esri measurement dijit in our site.&amp;nbsp; We have a map that shows 1000' buffers around certain property types.&amp;nbsp; When you use the measure tool it reports an incorrect value while moving the mouse.&amp;nbsp; Once the user double clicks to end the measurement the distance seems correct.&amp;nbsp; Please see the attached images for more details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is causing tremendous confusion amoung our users.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bryan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]31041[/ATTACH] [ATTACH=CONFIG]31042[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 17:29:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90070#M8179</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2014-01-31T17:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90071#M8180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;We are using the Esri measurement dijit in our site.&amp;nbsp; We have a map that shows 1000' buffers around certain property types.&amp;nbsp; When you use the measure tool it reports an incorrect value while moving the mouse.&amp;nbsp; Once the user double clicks to end the measurement the distance seems correct.&amp;nbsp; Please see the attached images for more details.&lt;BR /&gt;&lt;BR /&gt;This is causing tremendous confusion amoung our users.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bryan&lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]31041[/ATTACH] [ATTACH=CONFIG]31042[/ATTACH]&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder if it is not doing the geodesic conversion until the onfinish. that would be unfortunate.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 19:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90071#M8180</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-01-31T19:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90072#M8181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Jian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's the coordinate system of the map?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 19:21:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90072#M8181</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-01-31T19:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90073#M8182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The map is in Tennessee State Plane Coordinates - WKID 2915.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And yes, I think it is doing a geodesic measurement until the finish measurement event is called.&amp;nbsp; At least that is how it appears to me from looking at the JSON request in Fiddler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 12:10:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90073#M8182</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2014-02-04T12:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90074#M8183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Jian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For coordinate systems other than Web Mercator or geographic CS, this is by design, since there is no better way to do so.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Computing geodesic area/length is only possible with Web Mercator or GCS. Under other CSs, it reprojects the corners (xmin, ymin, xmax, ymax) to GCS, and interpolate the mouse position to find the approximate location under GCS in order to make it possible to calculate geodesic area/length. It is simply not possible to reproject the mouse position point while it's moving. After the drawing ends, as you observed, it shows the accurate result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The better way is to write a projection conversion for this specific needs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, your attached image shows 1018feet, instead of 1108.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 18:02:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90074#M8183</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-04T18:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90075#M8184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, so I get why you want to do geodesic measurement in a global application that is tracking goods moving around the globe or across the country.&amp;nbsp; But I just want to measure the distance from here to the grocery store or see how far I ran today.&amp;nbsp; This seems over complicated to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The measure tool should simply use the coordinate system the map is based on.&amp;nbsp; This would also solve anohter problem I have with the location tool.&amp;nbsp; We use state plane coordinates because everything in our system is based on that datum.&amp;nbsp; However, location tool reports lat/lon coordinates - why?.&amp;nbsp; I can convert them but why should I have to do that, the map already knows what those coordinates are.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a real world example.&amp;nbsp; The police arrest someone at the corner of A St and B St for selling illegal substances.&amp;nbsp; They need to know how far it is to the school on A St because within a certain distance the crime carries a different penalty. Click measure length, drop a point at the point of the crime and drag a line to the school property to check the distance.&amp;nbsp; The also notice a park down the street, move the mouse over the park, check the distance. What about the daycare on B St, a quick mouse over gives me an answer.&amp;nbsp; Your way requires me to drop 6 different points - 2 for each measurement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keep the geodesic measurement for scenarios where it makes sense but allow the user to override it when necessary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW - my image acutally says 1,1018 Feet which makes NO sense in any math I have ever seen. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 19:30:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90075#M8184</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2014-02-04T19:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90076#M8185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Jian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just make it clear, measuring using the current map coordinate would not make it more accurate. In most cases, it's worse.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geodesic gives the best result regardless the extent or zoom level. The problem here is the moving mouse cannot call geometry service frequently. For Web Mercator or GCS, which are the most common use cases, it doesn't have to go through geometry service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And you can override the result by calling registry.byNode(measurement.resultValue.domNode).setAttribute("content", measurementvalue);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 19:44:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90076#M8185</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-04T19:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90077#M8186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, I am still confused.&amp;nbsp; Is the final result a geodesic measurement or a planar measurement?&amp;nbsp; If the final result is geodesic why does it change so much once I drop the final point?&amp;nbsp; If the final distance is a planar measurement, why don't we just do a planar measurement from the start?&amp;nbsp; I get the whole the earth isn't flat, spheroid vs ellipsoid vs surficial distance measurement argument. I am just trying to figure out how and why the tool works like it does.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I measure a distance along property lines in ArcMap (approx. 200 ft) there is about 1/100th of a foot difference between the planar distance and the goedesic distance.&amp;nbsp; But with the measure tool in ArcGIS Server JSAPI (and i am not using snapping for this) I get a difference of about 5 feet over the same 200 foot distance until I drop the final point.&amp;nbsp; Once I drop that final point the distance is with a foot of the reading in ArcMap (will within range considering no snapping and the scale range).&amp;nbsp; Again ALL of our maps, in both ArcMap and ArcGIS Server are in the same coordinate system - TN State Plane Coordinate System.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It may seem like I am beating a dead horse but this has come up in court cases and it is hard to defend when you see one measurement as you hover and another when you drop the point.&amp;nbsp; We are required to appear in court several times a year to defend a map that has been used to in a trial - so I kinda need to know how this is working.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 13:13:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90077#M8186</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2014-02-05T13:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90078#M8187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Jian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All results in measurement widget are always geodesic. the moving mouse would have a little off under CSs other than Web Mercator or GCS. The reason is as we discussed, it cannot reproject the moving mouse location on the fly. There are interpolation going on behind the scenes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For your case, the best thing is to disable the results when mouse is moving.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 18:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90078#M8187</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-05T18:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90079#M8188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the info.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2 quick questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) I have looked at the API and don't see an option to turn off the result update while the mouse is moving.&amp;nbsp; Do you have a snippet of code showing how this is done?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) You have helped me with this one in the past from another post.&amp;nbsp; I need to override the results to show State Plane Coordinates with the location tool.&amp;nbsp; I have the following code which worked in the past but now is acting funny.&amp;nbsp; Basically, I see the info flash into the results pane but then the tool collapses back to the normal results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; measurement.on("measure-end", function(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (evt.toolName === "location") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myResult = "TN State Plane Coordinates (XY):&amp;lt;br /&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += Math.round(evt.geometry.x).toString() + ", " + Math.round(evt.geometry.y).toString();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += "&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += "Longitude, Latitude:&amp;lt;br /&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += evt.target.locationX.toFixed(6).toString() + ", " + evt.target.locationY.toFixed(6).toString();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; registry.byNode(measurement.resultValue.domNode).setAttribute("content", myResult);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:26:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90079#M8188</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2021-12-10T23:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90080#M8189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jeff.pace&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For coordinate systems other than Web Mercator or geographic CS, this is by design, since there is no better way to do so.&lt;BR /&gt;Computing geodesic area/length is only possible with Web Mercator or GCS. Under other CSs, it reprojects the corners (xmin, ymin, xmax, ymax) to GCS, and interpolate the mouse position to find the approximate location under GCS in order to make it possible to calculate geodesic area/length. It is simply not possible to reproject the mouse position point while it's moving. After the drawing ends, as you observed, it shows the accurate result.&lt;BR /&gt;The better way is to write a projection conversion for this specific needs.&lt;BR /&gt;BTW, your attached image shows 1018feet, instead of 1108.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is not correct, there is a better way to do it.&amp;nbsp; I compute area and length on the fly in state plane, web mercator, lat long, and national grid simultaneously, all completely in javascript.&amp;nbsp; It is an accurate geodesic length on mousemove&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is not the calculation, it is that the geometry service is too heavy weight and slow to process it in time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Granted, my solution requires a few hundred lines of calculus, and it is completely customized to my coordinate systems, it is written purely in javascript, and it does work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try the measure tools.&amp;nbsp; Can even do area calculations on the fly.&amp;nbsp; I am currently migrating code to AMD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.mymanatee.org/gisapps/mapviewer/index.jsp?widgetOn=Coordinates:Measure"&gt;http://www.mymanatee.org/gisapps/mapviewer/index.jsp?widgetOn=Coordinates:Measure&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the coordinate Tools for mouseover&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 19:28:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90080#M8189</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-05T19:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90081#M8190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good work!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As API designer, we cannot just support those coordinate systems specifically, unless in the future we can move the whole projection engine to JavaScript in order to support thousands of different coordinate systems. That was why I suggested to write a specific projection converter for this task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff, maybe you would like to share your code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 20:02:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90081#M8190</guid>
      <dc:creator>JianHuang</dc:creator>
      <dc:date>2014-02-05T20:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90082#M8191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the info.&lt;BR /&gt;&lt;BR /&gt;2 quick questions:&lt;BR /&gt;1) I have looked at the API and don't see an option to turn off the result update while the mouse is moving.&amp;nbsp; Do you have a snippet of code showing how this is done?&lt;BR /&gt;&lt;BR /&gt;2) You have helped me with this one in the past from another post.&amp;nbsp; I need to override the results to show State Plane Coordinates with the location tool.&amp;nbsp; I have the following code which worked in the past but now is acting funny.&amp;nbsp; Basically, I see the info flash into the results pane but then the tool collapses back to the normal results.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; measurement.on("measure-end", function(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (evt.toolName === "location") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myResult = "TN State Plane Coordinates (XY):&amp;lt;br /&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += Math.round(evt.geometry.x).toString() + ", " + Math.round(evt.geometry.y).toString();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += "&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += "Longitude, Latitude:&amp;lt;br /&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myResult += evt.target.locationX.toFixed(6).toString() + ", " + evt.target.locationY.toFixed(6).toString();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; registry.byNode(measurement.resultValue.domNode).setAttribute("content", myResult);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code should still work. Did you require "dijit/registry"?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90082#M8191</guid>
      <dc:creator>JianHuang</dc:creator>
      <dc:date>2021-12-10T23:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90083#M8192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jeff.pace&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Good work!&lt;BR /&gt;As API designer, we cannot just support those coordinate systems specifically, unless in the future we can move the whole projection engine to JavaScript in order to support thousands of different coordinate systems. That was why I suggested to write a specific projection converter for this task.&lt;BR /&gt;Jeff, maybe you would like to share your code.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would be happy to&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jian - you don't need to support each coordinate system.&amp;nbsp; You just need to variabilize the parameters, and use different equations for each style (Transverse Mercator, Lamberic, etc..). I think the issue is if the calculation is not correct yet (since it hasnt been set to geodesic yet) then it should not been shown on mouse over as it is giving false information.&amp;nbsp; Either show the correct number, or don't show a number, both are acceptable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code (at least for florida, it is not tested in other coordinate systems) for going from State Plane to LatLong (either lambert or transverse mercator) and then to web mercator and back. On mouse over I capture the coordinates in Web Mercator and convert them to state plane.&amp;nbsp; I do all my distance calculations in state plane so they are accurate (geodesic). The actual mathematics are&amp;nbsp; completely borrowed from Dr Bill Hazelton's HP-33S calculator &lt;/SPAN&gt;&lt;A href="http://homepage.mac.com/nwjh/HP-33S/"&gt;http://homepage.mac.com/nwjh/HP-33S/&lt;/A&gt;&lt;SPAN&gt; 10-Feb-10&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 11:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90083#M8192</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-06T11:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90084#M8193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.provide("org.mymanatee.common.latlong");

dojo.require("dojo.string");

org.mymanatee.common.latlong.convertSPtoLL_LLC = function (uX,uY) {
var a = 20925604.48;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //major radius of ellipsoid, map units (NAD 83)
var ec = 0.08181905782;&amp;nbsp;&amp;nbsp;&amp;nbsp; //eccentricity of ellipsoid (NAD 83)
var angRad = 0.01745329252;&amp;nbsp;&amp;nbsp; //number of radians in a degree
var pi4 = Math.PI / 4;&amp;nbsp;&amp;nbsp; //Pi / 4
var p0 = 24.333333 * angRad;&amp;nbsp;&amp;nbsp;&amp;nbsp; //latitude of origin
var p1 = 24.333333 * angRad;&amp;nbsp;&amp;nbsp;&amp;nbsp; //latitude of first standard parallel
var p2 = 31.5 * angRad;&amp;nbsp;&amp;nbsp; //latitude of second standard parallel
var m0 = -82.000000 * angRad;&amp;nbsp;&amp;nbsp; //central meridian
var x0 = 656166.666667;&amp;nbsp;&amp;nbsp; //False easting of central meridian, map units

// Calculate the coordinate system constants.
with (Math) {
var m1 = cos(p1) / sqrt(1 - (pow(ec,2)) * pow(sin(p1),2));
var m2 = cos(p2) / sqrt(1 - (pow(ec,2)) * pow(sin(p2),2));
var t0 = tan(pi4 - (p0 / 2));
var t1 = tan(pi4 - (p1 / 2));
var t2 = tan(pi4 - (p2 / 2));
t0 = t0 / pow(((1 - (ec * (sin(p0)))) / (1 + (ec * (sin(p0))))),ec/2);
t1 = t1 / pow(((1 - (ec * (sin(p1)))) / (1 + (ec * (sin(p1))))),ec/2);
t2 = t2 / pow(((1 - (ec * (sin(p2)))) / (1 + (ec * (sin(p2))))),ec/2);
var n = log(m1 / m2) / log(t1 / t2);
var f = m1 / (n * pow(t1,n));
var rho0 = a * f * pow(t0,n);

// Convert the coordinate to Latitude/Longitude.
// Calculate the Longitude.
var uX = uX - x0;
var pi2 = pi4 * 2;

var rho = sqrt(pow(uX,2) + pow((rho0 - uY),2));
var theta = atan(uX / (rho0 - uY));
var txy = pow((rho / (a * f)),(1 / n));
var lon = (theta / n) + m0;
var uX = uX + x0;

// Estimate the Latitude
var lat0 = pi2 - (2 * atan(txy));

// Substitute the estimate into the iterative calculation that
// converges on the correct Latitude value.
var part1 = (1 - (ec * sin(lat0))) / (1 + (ec * sin(lat0)));
var lat1 = pi2 - (2 * atan(txy * pow(part1,(ec/2))));

while ((abs(lat1 - lat0)) &amp;gt; 0.000000002) {
&amp;nbsp; lat0 = lat1;
&amp;nbsp; part1 = (1 - (ec * sin(lat0))) / (1 + (ec * sin(lat0)));
&amp;nbsp; lat1 = pi2 - (2 * atan(txy * pow(part1,(ec/2))));
&amp;nbsp; }

// Convert from radians to degrees.
var Lat = lat1 / angRad;
var Lon = lon / angRad;

//alert(Lat);
//alert(Lon);

//Round the latitude and longitude
//lat = (CLng(lat * 100000)) / 100000;
//lon = (CLng(lon * 100000)) / 100000;

Lat = Lat.toPrecision(7);
Lon = Lon.toPrecision(8);

return [Lat,Lon];

}
};
//End of Code for converting map units to decimal degrees.


//COnversion to LL from State Plane for Florida West (Transverse mercator, not Lamberic
org.mymanatee.common.latlong.convertSPtoLL_TM = function (uX,uY) {

 var&amp;nbsp;&amp;nbsp;&amp;nbsp; metconv = 1200/3937; //exact survey feet to meters
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; uXm = uX*metconv;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; uYm = uY*metconv;

&amp;nbsp; var&amp;nbsp;&amp;nbsp; a = 6378137.000000000000000000; // semimajor axis from ESRI
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; b =&amp;nbsp; 6356752.314140356100000000; // semiminor axis from ESRI
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; e2 = ((a*a)-(b*b))/(a*a);//ellipsoid
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; p0 = 24.333333;&amp;nbsp;&amp;nbsp;&amp;nbsp; //latitude of origin
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; m0 = -82.000000;&amp;nbsp;&amp;nbsp; //central meridian in degrees
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; x0 = 656166.666667;&amp;nbsp; //False easting of central meridian, map units
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; y0 = 0; //False Northing
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; k0 = 0.999941;&amp;nbsp;&amp;nbsp;&amp;nbsp; //central scale factor k0
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; x0m = x0*metconv;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; y0m = y0*metconv;

 var&amp;nbsp;&amp;nbsp;&amp;nbsp; p0rad = p0*Math.PI/180;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; m0rad = m0*Math.PI/180;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; e = Math.sqrt(e2);


 var&amp;nbsp;&amp;nbsp;&amp;nbsp; b = a * Math.sqrt(1-e2);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; n = (a - b)/(a + b);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; G = a*(1-n)*(1-(n*n))*(1+2.25*(n*n)+225/64*(n*n*n*n))*Math.PI/180;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; A0 = 1-e2/4-3*(e2*e2)/64-5*(e2*e2*e2)/256;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; A2 = 3/8*(e2+(e2*e2)/4+15*(e2*e2*e2)/128);
var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A4 = 15/256*((e2*e2)+0.75*(e2*e2*e2));
var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A6 = 35*(e2*e2*e2)/3072;
var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lat0 = p0rad;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; m0atlat0 = a*(A0*lat0-A2*Math.sin(2*lat0)+A4*Math.sin(4*lat0)-A6*Math.sin(6*lat0))
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; NminusNo = uYm - y0m;

var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m = m0atlat0+NminusNo/k0;
var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s = (m/G)*Math.PI/180;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; fpl1 = (1.5*n-27*(n*n*n)/32)*Math.sin(2*s);
&amp;nbsp; var&amp;nbsp;&amp;nbsp; fpl2 = (21*(n*n)/16-55*(n*n*n*n)/32)*Math.sin(4*s);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; fpl3 = 151*(n*n*n)/96*Math.sin(6*s);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; fpl4 = 1097*(n*n*n*n)/512*Math.sin(8*s);
&amp;nbsp; var&amp;nbsp;&amp;nbsp; footptlat = (s+fpl1+fpl2+fpl3+fpl4);
&amp;nbsp; var&amp;nbsp;&amp;nbsp; rho = a*(1-e2)/Math.pow((1-e2*Math.sin(footptlat)*Math.sin(footptlat)),1.5);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; nu = a/(Math.sqrt(1-e2*Math.sin(footptlat)*Math.sin(footptlat)));
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; psi = nu/rho;
&amp;nbsp; var&amp;nbsp;&amp;nbsp; t = Math.tan(footptlat);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; E = uXm-x0m;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; x = E/k0/nu;

 var&amp;nbsp;&amp;nbsp;&amp;nbsp; lat1 = x*E/2;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; lat2 = (x*x*x)*E/24*(-4*psi*psi+9*psi*(1-t*t)+12*t*t);
&amp;nbsp; var&amp;nbsp;&amp;nbsp; lat3 = (x*x*x*x*x)*E/720*(8*(psi*psi*psi*psi)*(11-24*(t*t))-12*(psi*psi*psi)*(21-71*(t*t))+15*(psi*psi)*(15-98*(t*t)+15*(t*t*t*t))+180*psi*(5*(t*t)-3*(t*t*t*t))+360*(t*t*t*t));
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; lat4 = (x*x*x*x*x*x*x)*E/40320*(1385+3633*(t*t)+4095*(t*t*t*t)+1575*(t*t*t*t*t*t));
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; lat = footptlat-(t/k0/rho)*(lat1-lat2+lat3-lat4);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; latdd = lat*180/Math.PI;

 var&amp;nbsp;&amp;nbsp;&amp;nbsp; w1 = x/Math.cos(footptlat);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; w2 = Math.pow(-1*x,3)/6*(psi+2*t*t)/Math.cos(footptlat);
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; w3 = Math.pow(x,5)/120/Math.cos(footptlat)*(-4*(psi*psi*psi)*(1-6*(t*t))+(psi*psi)*(9-68*(t*t))+72*(psi)*(t*t)+24*(t*t*t*t));
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; w4 = Math.pow(-1*x,7)/5040/Math.cos(footptlat)*(61+662*(t*t)+1320*(t*t*t*t)+720*(t*t*t*t*t*t));
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; w = w1+w2+w3+w4;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; lon = (-1*m0)*Math.PI/180-w;
 var&amp;nbsp;&amp;nbsp;&amp;nbsp; londd = (-1*lon)*180/Math.PI;


//&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(londd);

&amp;nbsp;&amp;nbsp;&amp;nbsp; return [latdd,londd];
&amp;nbsp;&amp;nbsp;&amp;nbsp; };

org.mymanatee.common.latlong.convertLLtoSP_TM = function (lat,lon) {
&amp;nbsp;&amp;nbsp; var metconv = 1200/3937; //exact survey feet to meters

&amp;nbsp;&amp;nbsp; var a = 6378137.000000000000000000; // semimajor axis from ESRI
&amp;nbsp;&amp;nbsp; var b =&amp;nbsp; 6356752.314140356100000000; // semiminor axis from ESRI
&amp;nbsp;&amp;nbsp; var e2 = ((a*a)-(b*b))/(a*a);//ellipsoid
&amp;nbsp;&amp;nbsp; var p0 = 24.333333;&amp;nbsp;&amp;nbsp;&amp;nbsp; //latitude of origin
&amp;nbsp;&amp;nbsp; var m0 = -82.000000;&amp;nbsp;&amp;nbsp; //central meridian in degrees
&amp;nbsp;&amp;nbsp; var x0 = 656166.666667;&amp;nbsp; //False easting of central meridian, map units
&amp;nbsp;&amp;nbsp; var y0 = 0; //False Northing
&amp;nbsp;&amp;nbsp; var k0 = 0.999941;&amp;nbsp;&amp;nbsp;&amp;nbsp; //central scale factor k0
&amp;nbsp;&amp;nbsp; var e = Math.sqrt(e2);
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var lat0rad_lat0=p0*Math.PI/180;
&amp;nbsp;&amp;nbsp; var latrad_lat=lat*Math.PI/180;
&amp;nbsp;&amp;nbsp; var rho_lat=a*(1-e2)/Math.pow((1-e2*Math.sin(latrad_lat)*Math.sin(latrad_lat)),1.5);
 var&amp;nbsp;&amp;nbsp; nu_lat=a/(Math.sqrt(1-e2*Math.sin(latrad_lat)*Math.sin(latrad_lat)));
&amp;nbsp; var&amp;nbsp; omega_lat=((lon)*Math.PI/180)-((m0)*Math.PI/180); //provide negative lon so no negative multiplier
 var&amp;nbsp;&amp;nbsp; psi_lat=nu_lat/rho_lat;
&amp;nbsp; var&amp;nbsp; t_lat=Math.tan(latrad_lat);
&amp;nbsp; var&amp;nbsp; a0_lat=1-e2/4-3*e2*e2/64-5*e2*e2*e2/256;
&amp;nbsp; var&amp;nbsp; a2_lat=3/8*(e2+e2*e2/4+15*e2*e2*e2/128);
&amp;nbsp; var&amp;nbsp; a4_lat=15/256*(e2*e2+0.75*e2*e2*e2);
&amp;nbsp; var&amp;nbsp; a6_lat=35*e2*e2*e2/3072;
&amp;nbsp; var&amp;nbsp; mlat_lat=a*(a0_lat*latrad_lat-a2_lat*Math.sin(2*latrad_lat)+a4_lat*Math.sin(4*latrad_lat)-a6_lat*Math.sin(6*latrad_lat));
&amp;nbsp; var&amp;nbsp; mlat_lat0=a*(a0_lat*lat0rad_lat0-a2_lat*Math.sin(2*lat0rad_lat0)+a4_lat*Math.sin(4*lat0rad_lat0)-a6_lat*Math.sin(6*lat0rad_lat0));
 var&amp;nbsp;&amp;nbsp; e1_lat=nu_lat*omega_lat*Math.cos(latrad_lat);
 var&amp;nbsp;&amp;nbsp; e2_lat=nu_lat*omega_lat*omega_lat*omega_lat/6*Math.cos(latrad_lat)*Math.cos(latrad_lat)*Math.cos(latrad_lat)*(psi_lat-t_lat*t_lat);
 var&amp;nbsp;&amp;nbsp; e3_lat=nu_lat*Math.pow(omega_lat,5)/120*Math.pow(Math.cos(latrad_lat),5)*(4*psi_lat*psi_lat*psi_lat*(1-6*t_lat*t_lat)+psi_lat*psi_lat*(1+8*t_lat*t_lat)-psi_lat*2*t_lat*t_lat+Math.pow(t_lat,4));
&amp;nbsp; var&amp;nbsp; e4_lat=nu_lat*Math.pow(omega_lat,7)/5040*Math.pow(Math.cos(latrad_lat),7)*(61-479*t_lat*t_lat+179*Math.pow(t_lat,4)-Math.pow(t_lat,6));
 var&amp;nbsp;&amp;nbsp; e_lat=k0*(e1_lat+e2_lat+e3_lat+e4_lat);
 var&amp;nbsp;&amp;nbsp; n1_lat=(omega_lat*omega_lat)/2*Math.cos(latrad_lat);
 var&amp;nbsp;&amp;nbsp; n1_lat0=n1_lat*nu_lat*Math.sin(latrad_lat);
 var&amp;nbsp;&amp;nbsp; n2_lat=(Math.pow(omega_lat,4)/24)*(Math.pow(Math.cos(latrad_lat),3))*(4*psi_lat*psi_lat+psi_lat-t_lat*t_lat);
 var&amp;nbsp;&amp;nbsp; n2_lat0=n2_lat*nu_lat*Math.sin(latrad_lat);
 var&amp;nbsp;&amp;nbsp; n3_lat=(Math.pow(omega_lat,6)/720)*(Math.pow(Math.cos(latrad_lat),5))*(8*Math.pow(psi_lat,4)*(11-24*t_lat*t_lat)-28*Math.pow(psi_lat,3)*(1-6*t_lat*t_lat)+psi_lat*psi_lat*(1-32*t_lat*t_lat)-2*psi_lat*t_lat*t_lat+Math.pow(t_lat,4));
&amp;nbsp; var&amp;nbsp; n3_lat0=n3_lat*nu_lat*Math.sin(latrad_lat);
 var&amp;nbsp;&amp;nbsp; n4_lat=(Math.pow(omega_lat,8)/40320)*(Math.pow(Math.cos(latrad_lat),7))*(1385-3111*t_lat*t_lat+543*Math.pow(t_lat,4)-Math.pow(t_lat,6));
 var&amp;nbsp;&amp;nbsp; n4_lat0=n4_lat*nu_lat*Math.sin(latrad_lat);
 var&amp;nbsp;&amp;nbsp; n_lat=k0*(mlat_lat+nu_lat*Math.sin(latrad_lat)*(n1_lat+n2_lat+n3_lat+n4_lat));
 var&amp;nbsp;&amp;nbsp; n_lat0=k0*mlat_lat0;
 var&amp;nbsp;&amp;nbsp; no=n_lat-n_lat0;
&amp;nbsp; var&amp;nbsp; x=e_lat+x0*metconv;
 var&amp;nbsp;&amp;nbsp; y=(n_lat-n_lat0)+y0*metconv;
//&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(n_lat);
//&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("x="+x+"y="+y);
&amp;nbsp; //&amp;nbsp; alert("a0="+a0_lat+"a2="+a2_lat+"a4="+a4_lat+"a6="+a6_lat);
 var&amp;nbsp;&amp;nbsp; xft=x/metconv;
 var&amp;nbsp;&amp;nbsp; yft=y/metconv;
 //&amp;nbsp;&amp;nbsp; alert("x="+xft+"y="+yft);
&amp;nbsp; return [xft,yft];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; org.mymanatee.common.latlong.convertWebMercAuxtoLL = function (uX,uY) {
&amp;nbsp; //code completely borrowed from http://www.frosties.com/index.php?option=com_mojo&amp;amp;Itemid=45&amp;amp;p=7
&amp;nbsp;&amp;nbsp; // lat and long backwards on link for some reason
&amp;nbsp;&amp;nbsp; //alert("IN CONVERSION");
&amp;nbsp; var x = uX;
&amp;nbsp;&amp;nbsp; // alert("IN CONVERSION2");
&amp;nbsp; var&amp;nbsp; y = uY;
&amp;nbsp;&amp;nbsp; 
 var num3 = x / 6378137.0;
 var num4 = num3 * 57.295779513082323;
 //alert("IN CONVERSION3");
 var num5 = Math.floor(((num4 + 180.0) / 360.0));
 var num6 = num4 - (num5 * 360.0);
 //alert("IN CONVERSION4");
var&amp;nbsp; num7 = 1.5707963267948966 - (2.0 * Math.atan(Math.exp((-1.0 * y) / 6378137.0)));
var lon&amp;nbsp; = num6;
var lat = num7*57.295779513082323;



&amp;nbsp;&amp;nbsp; // alert([lat,lon]);


&amp;nbsp;&amp;nbsp;&amp;nbsp; return [lat,lon];
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; org.mymanatee.common.latlong.convertLLtoWebMercAux = function (lat,lon) {

var num = lon * 0.017453292519943295;
var x = 6378137.0 * num;
var a = lat * 0.017453292519943295;

var mercatorX = x;
var mercatorY = 3189068.5*Math.log((1.0 + Math.sin(a))/(1.0 - Math.sin(a)));


&amp;nbsp;&amp;nbsp;&amp;nbsp; return [mercatorX,mercatorY];
&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90084#M8193</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2021-12-10T23:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90085#M8194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jeff.pace&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had to remove some comments to fit under 10k character cap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the measurement dijit (too big to post code)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/MeasureWidget.js"&gt;www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/MeasureWidget.js&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and the Coordinate Dijit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/CoordinateWidget.js"&gt;http://www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/CoordinateWidget.js&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 11:34:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90085#M8194</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-06T11:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90086#M8195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: BLynn&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The code should still work. Did you require "dijit/registry"?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did.&amp;nbsp; Here is a link to a page with the measure tool running if you want to take a look.&amp;nbsp; Nothing fancy just a map and the measurement tool.&amp;nbsp; You will see the blink the reformatted results then quickly return to it's normal state.&amp;nbsp; I think it is something simple I just can't put my finger on it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.kgis.org/kgismaps/measurement.html"&gt;http://www.kgis.org/kgismaps/measurement.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:24:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90086#M8195</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-07T12:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90087#M8196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I had to remove some comments to fit under 10k character cap&lt;BR /&gt;Here is the measurement dijit (too big to post code)&lt;BR /&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/MeasureWidget.js"&gt;www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/MeasureWidget.js&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and the Coordinate Dijit&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/CoordinateWidget.js"&gt;http://www.mymanatee.org/gisapps/mapviewer/js/org/mymanatee/widgets/CoordinateWidget.js&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the input and code samples!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Man, that's some heavy math for 8:00 a.m. with no coffee &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90087#M8196</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2014-02-07T12:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Dijit show wrong distance on mouse move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90088#M8197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jeff.pace&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a physical oceanography background that required calc 5.&amp;nbsp; And mom dad and sis are all math teachers. That said, it was still heavy math, even with coffee.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 15:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-dijit-show-wrong-distance-on-mouse/m-p/90088#M8197</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-07T15:43:07Z</dc:date>
    </item>
  </channel>
</rss>

