<?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: Basic Viewer - Implement Show x,y coordinates sample in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206529#M19178</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you post the code you've tried to implement?&amp;nbsp; It's going to be difficult to help without seeing what you've got so far.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Mar 2013 12:38:46 GMT</pubDate>
    <dc:creator>BrettGreenfield__DNR_</dc:creator>
    <dc:date>2013-03-26T12:38:46Z</dc:date>
    <item>
      <title>Basic Viewer - Implement Show x,y coordinates sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206528#M19177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been trying to implement some of the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/"&gt;javascript api samples&lt;/A&gt;&lt;SPAN&gt; in the &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=f232cac140a8495f9990cc9d2bb66dd9"&gt;Basic Viewer Template&lt;/A&gt;&lt;SPAN&gt; without much success.&amp;nbsp; I figured I'd start small and try adding &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_xycoords.html"&gt;"show x, y coordinates"&lt;/A&gt;&lt;SPAN&gt; as it only has a couple functions.&amp;nbsp; I can not get this wired up properly.&amp;nbsp; The only thing I can figure is I don't have the event listeners in the correct place.&amp;nbsp; Does anyone have a working example of this, or could anyone explain wiring this up properly in the basic viewer in a "to dummies" fashion?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 12:29:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206528#M19177</guid>
      <dc:creator>NewUser</dc:creator>
      <dc:date>2013-03-26T12:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Viewer - Implement Show x,y coordinates sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206529#M19178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you post the code you've tried to implement?&amp;nbsp; It's going to be difficult to help without seeing what you've got so far.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 12:38:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206529#M19178</guid>
      <dc:creator>BrettGreenfield__DNR_</dc:creator>
      <dc:date>2013-03-26T12:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Viewer - Implement Show x,y coordinates sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206530#M19179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've added the showCoordinates function to layout.js, put the &amp;lt;span&amp;gt; tag in the map div of the index.html and put the listeners (onMouseMove &amp;amp; onMouseDrag) in the createMap function in this section of layout.js: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if (map.loaded) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initUI(response);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onLoad", function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //after map loads, connect to listen to mouse move &amp;amp; drag events
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onMouseMove", showCoordinates);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onMouseDrag", showCoordinates);
&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; initUI(response);
&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>Sat, 11 Dec 2021 10:12:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206530#M19179</guid>
      <dc:creator>NewUser</dc:creator>
      <dc:date>2021-12-11T10:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Viewer - Implement Show x,y coordinates sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206531#M19180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i don't understand the exact code logic enough to explain why what you already tried doesn't work, but for code that needs the map to be loaded, I've always had good luck placing it right inside the initUI() function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function initUI(response) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(response.map, "onClick", showCoordinates);
...

function showCoordinates(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(mp.x.toFixed(3) + ", " + mp.y.toFixed(3));
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:12:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206531#M19180</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2021-12-11T10:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Viewer - Implement Show x,y coordinates sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206532#M19181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I ended up getting it working by placing the event listening piece of code at the end of the createMap() function.&amp;nbsp; Seems to work fine.&amp;nbsp; I could not get it to work in initUI().&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 16:28:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basic-viewer-implement-show-x-y-coordinates-sample/m-p/206532#M19181</guid>
      <dc:creator>NewUser</dc:creator>
      <dc:date>2013-03-28T16:28:29Z</dc:date>
    </item>
  </channel>
</rss>

