<?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: Spatial reference issue with 2 layers and setting the map's initial extent. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261046#M24173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am trying to put two layers in the map. One layer is my own data served from our ArcGIS Server instance, the other one is the ESRI world street basemap layer. The two layers overlay on top of each other perfect (i.e. my data appears over the street map exactly where it is supposed to):&lt;BR /&gt;&lt;A href="http://www.northmiamicra.org/testjsapi.html"&gt;http://www.northmiamicra.org/testjsapi.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;However, when I try to set the initial extent of the map to be the initial extent of my own data (North Miami, Florida), it does zoom to the initial extent of my data, but for some reason it overlays it with the World Street Map in Nigeria! Why is this happening?&lt;BR /&gt;&lt;A href="http://www.northmiamicra.org/test2layers.html"&gt;http://www.northmiamicra.org/test2layers.html&lt;BR /&gt;&lt;/A&gt;&lt;BR /&gt;FYI, the code in the second link is virtually identical to the sample code found here:&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_setextent.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_setextent.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The only thing I changed in the sample code was that I removed the geographicToWebMercator function because my data is already in Transverse Mercator.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Transverse Mercator and WebMercator are two different projections. So the initial extent of your data would not be in WebMercator units. You could either change SR of your .mxd data frame to WebMercator, or do somekind of transformation of your initial extent (GeometryService.project, hard code your initial extent in WebMercator units etc).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Oct 2011 18:41:39 GMT</pubDate>
    <dc:creator>HemingZhu</dc:creator>
    <dc:date>2011-10-31T18:41:39Z</dc:date>
    <item>
      <title>Spatial reference issue with 2 layers and setting the map's initial extent.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261045#M24172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to put two layers in the map. One layer is my own data served from our ArcGIS Server instance, the other one is the ESRI world street basemap layer. The two layers overlay on top of each other perfect (i.e. my data appears over the street map exactly where it is supposed to):&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.northmiamicra.org/testjsapi.html"&gt;http://www.northmiamicra.org/testjsapi.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I try to set the initial extent of the map to be the initial extent of my own data (North Miami, Florida), it does zoom to the initial extent of my data, but for some reason it overlays it with the World Street Map in Nigeria! Why is this happening?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.northmiamicra.org/test2layers.html"&gt;http://www.northmiamicra.org/test2layers.html&lt;BR /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;FYI, the code in the second link is virtually identical to the sample code found here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_setextent.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_setextent.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only thing I changed in the sample code was that I removed the geographicToWebMercator function because my data is already in Transverse Mercator.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 17:19:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261045#M24172</guid>
      <dc:creator>GarethMann</dc:creator>
      <dc:date>2011-10-31T17:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference issue with 2 layers and setting the map's initial extent.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261046#M24173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am trying to put two layers in the map. One layer is my own data served from our ArcGIS Server instance, the other one is the ESRI world street basemap layer. The two layers overlay on top of each other perfect (i.e. my data appears over the street map exactly where it is supposed to):&lt;BR /&gt;&lt;A href="http://www.northmiamicra.org/testjsapi.html"&gt;http://www.northmiamicra.org/testjsapi.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;However, when I try to set the initial extent of the map to be the initial extent of my own data (North Miami, Florida), it does zoom to the initial extent of my data, but for some reason it overlays it with the World Street Map in Nigeria! Why is this happening?&lt;BR /&gt;&lt;A href="http://www.northmiamicra.org/test2layers.html"&gt;http://www.northmiamicra.org/test2layers.html&lt;BR /&gt;&lt;/A&gt;&lt;BR /&gt;FYI, the code in the second link is virtually identical to the sample code found here:&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_setextent.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_setextent.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The only thing I changed in the sample code was that I removed the geographicToWebMercator function because my data is already in Transverse Mercator.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Transverse Mercator and WebMercator are two different projections. So the initial extent of your data would not be in WebMercator units. You could either change SR of your .mxd data frame to WebMercator, or do somekind of transformation of your initial extent (GeometryService.project, hard code your initial extent in WebMercator units etc).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 18:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261046#M24173</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-10-31T18:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference issue with 2 layers and setting the map's initial extent.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261047#M24174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply hzhu,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think what you mean is that the reason the two layers do not overlay on top of each other correctly is that they are on different projection systems. (My data is on Transverse Mercator (actually it is UTM, but for some reason ESRI has always called UTM simply Transverse Mercator) and the data in the Service is on "Web Mercator"). But if this is the case then it brings up two questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Why do the two services overlay perfectly fine if I do not specify an extent (as in the first link I showed)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Why do I need to have the two layers on the same projection system? ArcMap will reproject data on the fly if they are on different projection systems. Evidently from the examples I have posted so does ArcGIS Server but it does not work when a new extent is specified?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 19:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261047#M24174</guid>
      <dc:creator>GarethMann</dc:creator>
      <dc:date>2011-10-31T19:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference issue with 2 layers and setting the map's initial extent.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261048#M24175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the reply hzhu,&lt;BR /&gt;&lt;BR /&gt;I think what you mean is that the reason the two layers do not overlay on top of each other correctly is that they are on different projection systems. (My data is on Transverse Mercator (actually it is UTM, but for some reason ESRI has always called UTM simply Transverse Mercator) and the data in the Service is on "Web Mercator"). But if this is the case then it brings up two questions:&lt;BR /&gt;&lt;BR /&gt;1) Why do the two services overlay perfectly fine if I do not specify an extent (as in the first link I showed)?&lt;BR /&gt;&lt;BR /&gt;2) Why do I need to have the two layers on the same projection system? ArcMap will reproject data on the fly if they are on different projection systems. Evidently from the examples I have posted so does ArcGIS Server but it does not work when a new extent is specified?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For your first question: JS API did transformation automatically for you just like arcmap did for layers with different extent. For your second question: You don't need to have your data on the same as ESRI base maps, but if you want to use the initial extent of your data which is not in WebMercator then problem will rise because the extent will have wrong value. That is why i said you could change data frame to WebMercator to get the right extent( write down these numbers, hard code in your app, and then reset your data frame back to your SR -if you like).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 19:30:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-issue-with-2-layers-and-setting/m-p/261048#M24175</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-10-31T19:30:46Z</dc:date>
    </item>
  </channel>
</rss>

