<?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 Map Units Please? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-units-please/m-p/603967#M56558</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am going to describe functionality I have built into my version of the Esri Flex Viewer to illustrate why I need to get the Map Units (or the toMeterFactor) from the JavaScript API so I can enable the same functionality in a JavaScript Viewer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The programming languages (Flex and JavaScript) are different, but the reason I need the Map Units and the functionality I am implementing are the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. When the user clicks on a feature, I show a popup with several tabs.&amp;nbsp; One of the tabs shows the measurements of the feature area and perimeter for polygons, length for polylines, and coordinates for points.&amp;nbsp; If the feature was a polygon or a polyline, the popup also shows the coordinates of the point clicked.&amp;nbsp; In both cases, the user can change the spatial reference of the coordinates or the units of the length and area units.&amp;nbsp; I call the geometry service to convert the coordinates to a different spatial reference.&amp;nbsp; If the spatial reference is Web Mercator or Geographic, I can calculate the area and length on the client.&amp;nbsp; If the spatial reference is projected, I can also calculate the area and length on the client, but I need the map units or the ratio of the units to meters to do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. We use the same popup (not an Esri popup, but our own Flex popup) in the Identify and the Search Widget results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. We also need the map units to calculate area and length dynamically in the Draw Widget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. We have enhanced the Print Widget to show a graphic on the screen that represents the paper size selected for the print.&amp;nbsp; It lets the user see what will be printed rather than guess what will be printed.&amp;nbsp; In this widget, we have to do an approximate projection of the paper into the map coordinate system.&amp;nbsp; We do this on the client, because the user can drag the paper around the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see all of these widgets in our "last" Flex Viewer here: &lt;/SPAN&gt;&lt;A href="http://gis.hamiltoncounty.in.gov/flexviewer/index.html"&gt;http://gis.hamiltoncounty.in.gov/flexviewer/index.html&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have started porting some of this functionality to a couple of different JavaScript Viewers, my version of the Dave Spriggs Configurable JavaScript Viewer that I got from GitHub (&lt;/SPAN&gt;&lt;A href="http://gis.hamiltoncounty.in.gov/jsViewer3/index.html"&gt;http://gis.hamiltoncounty.in.gov/jsViewer3/index.html&lt;/A&gt;&lt;SPAN&gt;), and the Stem App JavaScript Viewer that is part of WebApp Builder (&lt;/SPAN&gt;&lt;A href="http://gis.hamiltoncounty.in.gov/mapViewer1/index.html#"&gt;http://gis.hamiltoncounty.in.gov/mapViewer1/index.html#&lt;/A&gt;&lt;SPAN&gt;).&amp;nbsp; These implementations are a little rough right now, so be gentle.&amp;nbsp; The Widget is called Print Plus in the JavaScript Viewers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Larrye&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Apr 2014 14:33:08 GMT</pubDate>
    <dc:creator>LarryStout</dc:creator>
    <dc:date>2014-04-11T14:33:08Z</dc:date>
    <item>
      <title>Map Units Please?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-units-please/m-p/603967#M56558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am going to describe functionality I have built into my version of the Esri Flex Viewer to illustrate why I need to get the Map Units (or the toMeterFactor) from the JavaScript API so I can enable the same functionality in a JavaScript Viewer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The programming languages (Flex and JavaScript) are different, but the reason I need the Map Units and the functionality I am implementing are the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. When the user clicks on a feature, I show a popup with several tabs.&amp;nbsp; One of the tabs shows the measurements of the feature area and perimeter for polygons, length for polylines, and coordinates for points.&amp;nbsp; If the feature was a polygon or a polyline, the popup also shows the coordinates of the point clicked.&amp;nbsp; In both cases, the user can change the spatial reference of the coordinates or the units of the length and area units.&amp;nbsp; I call the geometry service to convert the coordinates to a different spatial reference.&amp;nbsp; If the spatial reference is Web Mercator or Geographic, I can calculate the area and length on the client.&amp;nbsp; If the spatial reference is projected, I can also calculate the area and length on the client, but I need the map units or the ratio of the units to meters to do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. We use the same popup (not an Esri popup, but our own Flex popup) in the Identify and the Search Widget results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. We also need the map units to calculate area and length dynamically in the Draw Widget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. We have enhanced the Print Widget to show a graphic on the screen that represents the paper size selected for the print.&amp;nbsp; It lets the user see what will be printed rather than guess what will be printed.&amp;nbsp; In this widget, we have to do an approximate projection of the paper into the map coordinate system.&amp;nbsp; We do this on the client, because the user can drag the paper around the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see all of these widgets in our "last" Flex Viewer here: &lt;/SPAN&gt;&lt;A href="http://gis.hamiltoncounty.in.gov/flexviewer/index.html"&gt;http://gis.hamiltoncounty.in.gov/flexviewer/index.html&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have started porting some of this functionality to a couple of different JavaScript Viewers, my version of the Dave Spriggs Configurable JavaScript Viewer that I got from GitHub (&lt;/SPAN&gt;&lt;A href="http://gis.hamiltoncounty.in.gov/jsViewer3/index.html"&gt;http://gis.hamiltoncounty.in.gov/jsViewer3/index.html&lt;/A&gt;&lt;SPAN&gt;), and the Stem App JavaScript Viewer that is part of WebApp Builder (&lt;/SPAN&gt;&lt;A href="http://gis.hamiltoncounty.in.gov/mapViewer1/index.html#"&gt;http://gis.hamiltoncounty.in.gov/mapViewer1/index.html#&lt;/A&gt;&lt;SPAN&gt;).&amp;nbsp; These implementations are a little rough right now, so be gentle.&amp;nbsp; The Widget is called Print Plus in the JavaScript Viewers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Larrye&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 14:33:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-units-please/m-p/603967#M56558</guid>
      <dc:creator>LarryStout</dc:creator>
      <dc:date>2014-04-11T14:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Map Units Please?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-units-please/m-p/603968#M56559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Larry:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is not an answer to your post, but a question about the viewer you are using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I copied the viewer to my webserver and replaced 2 mapservices with my mapservices.&amp;nbsp; When I try to use the Measurement Tool, the Identify tool gets in the way.&amp;nbsp; Are you experiencing this same phenomenon?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 18:27:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-units-please/m-p/603968#M56559</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-04-11T18:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Map Units Please?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-units-please/m-p/603969#M56560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Larry, have you tried parsing the units from a JSON representation of the map's spatial reference?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;map.spatialReference.toJson()&lt;/SPAN&gt;&lt;SPAN&gt; should give you the JSON representation of the spatial reference. Each spatial reference has a UNIT property according to &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jshelp/pcs.html"&gt;https://developers.arcgis.com/javascript/jshelp/pcs.html&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jshelp/gcs.html"&gt;https://developers.arcgis.com/javascript/jshelp/gcs.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ryan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 19:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-units-please/m-p/603969#M56560</guid>
      <dc:creator>RyanClancy</dc:creator>
      <dc:date>2014-04-11T19:01:18Z</dc:date>
    </item>
  </channel>
</rss>

