<?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: Lat Lon points in js api v2.0 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163643#M15186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you use wkid 102100, and read points from the map, you will get values for x and y in a cartesian reference rather than geographic coordinates, and as noted the Javascript ESRI API provides convenience methods to convert to and from.&amp;nbsp; So far so good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the calcs within the API seem to actually use the wrong WKID.&amp;nbsp; WKID 102100 is supposed to incorporate eccentricity, as opposed to the "old" WKID 102113, the spherical version.&amp;nbsp; According to the article "Migrating map tiling schemes" on the ESRI Resource Center, ArcGIS online services are now hosted in 102100 because it's "better".&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;True enough, but when I test the actual conversions performed by the Javascript API, in fact they seem to still be using the spherical equations.&amp;nbsp; This does not make a huge difference but it's enough to notice, and enough to throw your calcs out of whack when you're trying to debug.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the two spatial references to my converter utility so you can test this and other calcs out.&amp;nbsp; See &lt;/SPAN&gt;&lt;A href="http://ersquared.org:8080/marconitest/map/convert.jsp"&gt;http://ersquared.org:8080/marconitest/map/convert.jsp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the left side, put in lat and long (remember longitude is negative in the US), choosing WGS84 as the datum.&amp;nbsp; On the right side, for destination coordinates, choose Web Mercator.&amp;nbsp; But then try the calc using WGS84 as the datum, and then the WGS84 spherical (as used in WDID 102113).&amp;nbsp; You will see that the spherical numbers are an exact match with the ESRI Javascript libraries, while the ellipsoidal version differs slightly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I entered the various WKID parameters and did calcs, etc. in the hope that my problems had to do with wkid.&amp;nbsp; But they turned out to be far larger, so large that finetuning WKID is somewhat like arranging deck chairs on the Titanic, as long as fundamental browser problems exist.&amp;nbsp; As things stand now, I still can't place markers in the correct spot with Firefox.&amp;nbsp; I'm curious if you're using MSIE only, and that's why you can even notice other more subtle problems.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jul 2010 20:10:11 GMT</pubDate>
    <dc:creator>XavierIrias</dc:creator>
    <dc:date>2010-07-22T20:10:11Z</dc:date>
    <item>
      <title>Lat Lon points in js api v2.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163640#M15183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am upgrading an existing app that uses the JS api from v=1.4 to v=2.0. The new maps work good, when setting the extents it works great, but when I try to add a new marker, the marker appears in the west coast of Africa instead than on the specified Lat/Lon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not that experienced with Geographical Information Systems so when I tried to search what I should do, I found threads related to the WKID that since this v2.0 uses 102100 I should use I different coordinate system instead of the degree based one, and that I should utilize webMercator utilities to translate the point. Unfortunately I have note been able to make sense of all this. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a nutshell when using v1.4 I was able to create a point with like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var point = new esri.geometry.Point(lon, lat);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the API reference under the geometry -&amp;gt; point section, it illustrates that one way I can add a point is like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.geometry.Point(-118.15, 33.80, new esri.SpatialReference({ wkid: 4326 }))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I just replaced the X and Y values with my lat and lon variables but when adding a graphics with that point, it is not placed anywhere near the desired place. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jul 2010 17:35:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163640#M15183</guid>
      <dc:creator>jorgelagos</dc:creator>
      <dc:date>2010-07-21T17:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lat Lon points in js api v2.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163641#M15184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use esri.geometry.geographicToWebMercator() to convert your geometry from decimal degrees to meters so that it can be plotted on a basemap that uses the web mercator projection (wkid 102100, among others). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#geographicToWebMercator" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#geographicToWebMercator&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code would be something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;esri.geometry.geographicToWebMercator(
&amp;nbsp; new esri.geometry.Point(-118.15, 33.80, new esri.SpatialReference({ wkid: 4326 }))
);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:34:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163641#M15184</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-11T08:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lat Lon points in js api v2.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163642#M15185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That did it for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Very Much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 14:15:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163642#M15185</guid>
      <dc:creator>jorgelagos</dc:creator>
      <dc:date>2010-07-22T14:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lat Lon points in js api v2.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163643#M15186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you use wkid 102100, and read points from the map, you will get values for x and y in a cartesian reference rather than geographic coordinates, and as noted the Javascript ESRI API provides convenience methods to convert to and from.&amp;nbsp; So far so good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the calcs within the API seem to actually use the wrong WKID.&amp;nbsp; WKID 102100 is supposed to incorporate eccentricity, as opposed to the "old" WKID 102113, the spherical version.&amp;nbsp; According to the article "Migrating map tiling schemes" on the ESRI Resource Center, ArcGIS online services are now hosted in 102100 because it's "better".&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;True enough, but when I test the actual conversions performed by the Javascript API, in fact they seem to still be using the spherical equations.&amp;nbsp; This does not make a huge difference but it's enough to notice, and enough to throw your calcs out of whack when you're trying to debug.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the two spatial references to my converter utility so you can test this and other calcs out.&amp;nbsp; See &lt;/SPAN&gt;&lt;A href="http://ersquared.org:8080/marconitest/map/convert.jsp"&gt;http://ersquared.org:8080/marconitest/map/convert.jsp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the left side, put in lat and long (remember longitude is negative in the US), choosing WGS84 as the datum.&amp;nbsp; On the right side, for destination coordinates, choose Web Mercator.&amp;nbsp; But then try the calc using WGS84 as the datum, and then the WGS84 spherical (as used in WDID 102113).&amp;nbsp; You will see that the spherical numbers are an exact match with the ESRI Javascript libraries, while the ellipsoidal version differs slightly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I entered the various WKID parameters and did calcs, etc. in the hope that my problems had to do with wkid.&amp;nbsp; But they turned out to be far larger, so large that finetuning WKID is somewhat like arranging deck chairs on the Titanic, as long as fundamental browser problems exist.&amp;nbsp; As things stand now, I still can't place markers in the correct spot with Firefox.&amp;nbsp; I'm curious if you're using MSIE only, and that's why you can even notice other more subtle problems.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 20:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lat-lon-points-in-js-api-v2-0/m-p/163643#M15186</guid>
      <dc:creator>XavierIrias</dc:creator>
      <dc:date>2010-07-22T20:10:11Z</dc:date>
    </item>
  </channel>
</rss>

