<?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: Modifications to the Measurement Widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659427#M61569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@dlimos thanks for sharing your approach!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i logged an enhancement a while back requesting that the widget be extended to support output in projected coordinates as well, but haven't seen much customer interest since.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[NIM073060: For location tool in Measurement Widget,&amp;nbsp; include option to toggle between projected coordinates and lat/long.] &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if you are interested in this issue, please feel free to log a tech support call and request to be added to the above NIM.&amp;nbsp; This helps our developers prioritize their work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Aug 2012 15:18:26 GMT</pubDate>
    <dc:creator>JohnGravois</dc:creator>
    <dc:date>2012-08-28T15:18:26Z</dc:date>
    <item>
      <title>Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659421#M61563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Two questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 - how do you change the text style for the units.&amp;nbsp; I have tried several things and can't get it to work correctly.&amp;nbsp; The basic problem is the font for the units is a different size than any of the other text on the form.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2 - is it possible to get projected coordinates from the maps rather than just longitude and latitude?&amp;nbsp; All of our maps are in state plane coordinate systems.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 17:32:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659421#M61563</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2012-08-24T17:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659422#M61564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1. Use the FireBug plugin for Firefox to inspect the element, and use css to override the default style.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. To reproject geometry you'll need to use an ArcGIS Server GeometryServer's Project operation. I don't know if you can do that with the out-of-box measure widget. Sounds like you need to write your own widget to meet your specific needs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 17:47:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659422#M61564</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2012-08-24T17:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659423#M61565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the tip on the CSS - found it and have it working correctly now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, question #2 still puzzles me to no end.&amp;nbsp; I get the coordinates I want from the location tool.&amp;nbsp; I can see them when the onMeasureEvent fires.&amp;nbsp; The widget then converts them to something I don't want.&amp;nbsp; Seems to me the obvious/default choice should be map coordinates.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2012 18:50:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659423#M61565</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2012-08-27T18:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659424#M61566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not going to be able to help on that too much. I've never used the out-of-the-box measure widget. I wrote my own before the api came with one. It's hard to alter the behavior of any dojo based widget without editing the code. The problem with the esri namespace is all js files start with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I've certainly studied a good portion of the esri namespace code to better understand the api, but I've been reluctant to copy their code or edit widgets, except to fix a few minor bugs in real time. Do on to others...right? It's much more satisfying to write your own anyway. I hope you figure it out and if you decide to write your own good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:54:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659424#M61566</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2021-12-12T03:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659425#M61567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can try with&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outSR = new esri.SpatialReference({wkid:102100}); // change with your map spatialReference

dojo.connect(measurement, "onMeasureEnd", function(activeTool,geometry){
 
 
&amp;nbsp; esri.config.defaults.geometryService.project([geometry], outSR, function (projectedPoints) {
&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; var contentPane = dojo.byId("dijit_layout_ContentPane_1");
&amp;nbsp; contentPane.innerHTML = "X: " +&amp;nbsp;&amp;nbsp; projectedPoints[0].x + "&amp;lt;br&amp;gt; Y: " + projectedPoints[0].y
&amp;nbsp;&amp;nbsp; });
 });
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:54:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659425#M61567</guid>
      <dc:creator>DavideLimosani</dc:creator>
      <dc:date>2021-12-12T03:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659426#M61568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@dlimos - thanks for the tip.&amp;nbsp; Did exactly what I needed for a short term fix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@btfou - I think you misunderstood - I'm not wanting to hack/steal their code.&amp;nbsp; I simply want to extend it (fairly common for Silverlight API).&amp;nbsp; I am also not opposed to writing my own - which maybe where I end up - I just need something quick and would prefer to stick with OOTB functionality.&amp;nbsp; I have been down the custom road before and been burned too many times.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to both of you for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2012 15:07:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659426#M61568</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2012-08-28T15:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659427#M61569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@dlimos thanks for sharing your approach!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i logged an enhancement a while back requesting that the widget be extended to support output in projected coordinates as well, but haven't seen much customer interest since.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[NIM073060: For location tool in Measurement Widget,&amp;nbsp; include option to toggle between projected coordinates and lat/long.] &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if you are interested in this issue, please feel free to log a tech support call and request to be added to the above NIM.&amp;nbsp; This helps our developers prioritize their work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2012 15:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659427#M61569</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2012-08-28T15:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659428#M61570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;@btfou - I think you misunderstood - I'm not wanting to hack/steal their code.&amp;nbsp; I simply want to extend it (fairly common for Silverlight API).&amp;nbsp; I am also not opposed to writing my own - which maybe where I end up - I just need something quick and would prefer to stick with OOTB functionality.&amp;nbsp; I have been down the custom road before and been burned too many times.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I wasn't suggesting that you would. And maybe it's perfectly legit to copy an esri widget's code and rewrite as your own. I personally don't see it that way. It seems that my experience has been the opposite of yours in that I've had more success creating my own and getting exactly the functionality and result I want.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2012 15:29:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659428#M61570</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2012-08-28T15:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659429#M61571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Two questions:&lt;BR /&gt;1 - how do you change the text style for the units.&amp;nbsp; I have tried several things and can't get it to work correctly.&amp;nbsp; The basic problem is the font for the units is a different size than any of the other text on the form.&lt;BR /&gt;&lt;BR /&gt;2 - is it possible to get projected coordinates from the maps rather than just longitude and latitude?&amp;nbsp; All of our maps are in state plane coordinate systems.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bryan&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bryan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please take a look at the document of measurement widget: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/measurement.htm" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/measurement.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Modifying the CSS .unitDropDown will change the font size of the unit list. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.unitDropDown{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size:26px ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Connecting to the onMeasureEnd event and replace the output value will overwrite the result. If you want to show the coordinate values under the current map spatial reference, here is the code snippet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dojo.connect(measurement, "onMeasureEnd", function(toolName, geometry){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; measurement.resultValue.domNode.innerHTML = "x: "+ geometry.x + "&amp;lt;br/&amp;gt;y: " + geometry.y;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2012 15:58:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659429#M61571</guid>
      <dc:creator>JianHuang</dc:creator>
      <dc:date>2012-08-28T15:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659430#M61572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@jgravois - thanks for letting me know.&amp;nbsp; I will log it as a request.&amp;nbsp; Seems logical that it should default to the map's coordinate system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Jian - thanks for the snippet it worked like a charm with one simple modification - I added a check for the location tool.&amp;nbsp; For example:&amp;nbsp; if (toolName == "location") { ... }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For anyone else that stumbles upon this here is my final solution (for now) showing both the original results and the XY coordinates from the map:&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; dojo.connect(measurement, "onMeasureEnd", function (toolName, geometry) {
&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 (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 resultValue = measurement.resultValue.domNode.innerHTML;
&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 stateCoords = "XY: " + Math.round(geometry.x).toString() + ", " + Math.round(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; measurement.resultValue.domNode.innerHTML = resultValue + "&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;" + stateCoords;
&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>Sun, 12 Dec 2021 03:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659430#M61572</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2021-12-12T03:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to the Measurement Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659431#M61573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I worked through this issue some time back and it was working fine.&amp;nbsp; Hoewver, i am now working on another site and the same code simply does not work.&amp;nbsp; I can trap the on measure end event.&amp;nbsp; Get the required info and formulate the new result but nothing changes in the measurement tool.&amp;nbsp; Has anyone else see this behavior?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 18:27:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/modifications-to-the-measurement-widget/m-p/659431#M61573</guid>
      <dc:creator>BryanLynn</dc:creator>
      <dc:date>2014-01-31T18:27:49Z</dc:date>
    </item>
  </channel>
</rss>

