<?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 widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105382#M9691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to display distance in the center of the edge? I am able to get distance using geometry service as you suggested before. But not sure how to position TextSymbol on the edge so, it doesn't overlap on line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jul 2014 15:52:27 GMT</pubDate>
    <dc:creator>BhavinSanghani</dc:creator>
    <dc:date>2014-07-16T15:52:27Z</dc:date>
    <item>
      <title>Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105374#M9683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I checked measurement widget on following url. But it removes drawing on the map when you take measurement again. I want to retain the measurements on the map. Also, I want to show distance on each edge of the line drawn on the map. How can that be achieved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_measurement" title="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_measurement"&gt;http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_measurement&lt;/A&gt;‌&lt;A href="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_measurement" title="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_measurement"&gt;http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_measurement&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 13:49:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105374#M9683</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-07-09T13:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105375#M9684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Measurement widget is designed to clear the previous measurement when a tool is selected to make a new measurement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, we can work around this by doing the following:&lt;/P&gt;&lt;P&gt;1) Listen to 'measure-end' event from the Measurement widget&lt;/P&gt;&lt;P&gt;2) Get and store the geometry from the event object&lt;/P&gt;&lt;P&gt;3) Create a graphic from the event geometry&lt;/P&gt;&lt;P&gt;4) Add that graphic to a separate graphics layer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Showing distance on each edge of the line drawn on the map is a bit trickier.&lt;/P&gt;&lt;P&gt;Instead of using the Measurement widget, I think it would be easier to use the Draw widget.&lt;/P&gt;&lt;P&gt;Under the hood, the Measurement widget functions similarly to the Draw widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short, using events, you'd want to take the geometry of a particular line, use a task to measure it, then update your label layer with the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/draw-amd.html" title="https://developers.arcgis.com/javascript/jsapi/draw-amd.html"&gt;draw-amd | API Reference | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/graphics_add.html" title="https://developers.arcgis.com/javascript/jssamples/graphics_add.html"&gt;Add graphics to a map | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 20:43:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105375#M9684</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-07-09T20:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105376#M9685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, that sounds good! Only I didn't understand following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;"In short, using events, you'd want to take the geometry of a particular line, &lt;STRONG&gt;use a task to measure it, then update your label layer with the result.&lt;/STRONG&gt;"&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 20:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105376#M9685</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-07-09T20:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105377#M9686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to help! Forget what I said about using a label layer... it is much easier to stick with Text Symbols.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Use a task to measure the line (distance)&lt;/P&gt;&lt;P&gt;&lt;SPAN class="str"&gt;"esri/tasks/DistanceParameters"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/distanceparameters-amd.html" title="https://developers.arcgis.com/javascript/jsapi/distanceparameters-amd.html"&gt;distanceparameters-amd | API Reference | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Create a text symbol to show that distance&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;"esri&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;symbol&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;TextSymbol&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tutorial: &lt;A href="https://developers.arcgis.com/javascript/jssamples/util_distance.html" title="https://developers.arcgis.com/javascript/jssamples/util_distance.html"&gt;Use geometry service to measure distances | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Example: &lt;A href="http://developers.arcgis.com/javascript/samples/util_distance/" title="http://developers.arcgis.com/javascript/samples/util_distance/"&gt;Measure Distances&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTEs&lt;/P&gt;&lt;P&gt;- The above sample is very similar to what you want to accomplish.&lt;/P&gt;&lt;P&gt;- The above sample does not use the draw toolbar, but can easily be fitted to do so&lt;/P&gt;&lt;P&gt;- The above sample is in legacy DOJO syntax (non-AMD)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 21:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105377#M9686</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-07-09T21:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105378#M9687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, will give a try as per suggestions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing - I want to show distance on the edge as line is drawn on the map. Similar to how it's done in Measurement widget for Distance tool. How that can be done? It doesn't seem that the widget code is firing request to geometry service on mouse move event.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 12:44:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105378#M9687</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-07-10T12:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105379#M9688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great question!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The distance tool is using the &lt;SPAN class="str"&gt;&lt;/SPAN&gt;GeodesicUtils module (&lt;SPAN class="str"&gt;"esri/geometry/geodesicUtils").&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For distance (polylines), it uses the following method:&amp;nbsp; &lt;SPAN class="str"&gt;geodesicUtils.geodesicLengths();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="str"&gt;For area, (polygons), it uses the following method: &lt;SPAN class="str"&gt;geodesicUtils.&lt;/SPAN&gt;geodesicAreas();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/esri.geometry.geodesicutils-amd.html" title="https://developers.arcgis.com/javascript/jsapi/esri.geometry.geodesicutils-amd.html"&gt;esri | API Reference | &lt;SPAN class="str"&gt;geodesicUtils&lt;/SPAN&gt; | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/esri.geometry.geodesicutils-amd.html#geodesiclengths" title="https://developers.arcgis.com/javascript/jsapi/esri.geometry.geodesicutils-amd.html#geodesiclengths"&gt;esri | API Reference | &lt;SPAN class="str"&gt;geodesicUtils.geodesicLengths | &lt;/SPAN&gt;ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will only use an external GeometryService if the map's spatial reference is something other than webmercator (102100) or geographic (4326).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 16:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105379#M9688</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-07-10T16:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105380#M9689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why this geoDesicUtil is limited to &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;webmercator/&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;geographic&lt;/SPAN&gt;? Is that something the accurate measurement comes only with geometry service when spatial reference is other than &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;webmercator/&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;geographic? Is there any formula to calculate measurement without firing request to geometry service? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 17:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105380#M9689</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-07-10T17:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105381#M9690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;The Measurement widget provides tools for calculating the current location (Get Location) and measuring distance (Measure Distance) and area (Measure Area). If the map's coordinate system is not Web Mercator or geographic or if complex polygons are drawn the measure widget will need to use the geometry service to project or simplify geometries. Use esri.config.defaults to specify the geometry service for your application.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;It is recommended that you create a geometry service for use within your applications. View the &lt;A href="http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000027000000.htm"&gt; Geometry Services&lt;/A&gt; help topic in the Server Resource Center for details on creating and publishing a geometry service. ESRI hosts a geometry service on &lt;A href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"&gt;sampleserver3&lt;/A&gt; to support samples published in the Resource Center. You are welcome to use this service for development and testing purposes. ESRI also hosts a geometry service on &lt;A href="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"&gt;tasks.arcgisonline.com&lt;/A&gt;; this service can be used for production applications however, we do not guarantee that the service will be available 24/7. &lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From: &lt;A href="https://developers.arcgis.com/javascript/jsapi/measurement.html" title="https://developers.arcgis.com/javascript/jsapi/measurement.html"&gt;measurement | API Reference | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Is there any formula to calculate measurement without firing request to geometry service? &lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends on what unit of measurement you are using and what the coordinate system of your map is. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 18:13:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105381#M9690</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-07-10T18:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105382#M9691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to display distance in the center of the edge? I am able to get distance using geometry service as you suggested before. But not sure how to position TextSymbol on the edge so, it doesn't overlap on line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 15:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget/m-p/105382#M9691</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-07-16T15:52:27Z</dc:date>
    </item>
  </channel>
</rss>

