<?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: basemap or featurelayer which one sets projection in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246084#M22782</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In method 2 you are setting the extent, you are not setting the spatial reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would try alerting (map.spatialReference.wkid) and my guess is it will be wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.spatialReference = = new esri.SpatialReference({wkid:102100});&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prior to your map.setExtent line&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jul 2012 19:00:54 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2012-07-05T19:00:54Z</dc:date>
    <item>
      <title>basemap or featurelayer which one sets projection</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246081#M22779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been playing around with trying to load data from a config.txt file &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the Basemap Gallery for my background maps and I am also loading several dynamic map service layers.&amp;nbsp; It seemed as though the projection was being set from the first feature layer loaded and not the first basemap loaded.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, upon investigation it seems as though I am getting different projections based upon the method used to set the map extent.&amp;nbsp; Can someone explain to me what the difference is between the two methods below because when I use Method 1 everything lines up properly, but, when I use Method 2 my Basemaps are fine, but my dynamic feature layers are over in Africa... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Method 1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All of the below is in my default.html file&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var initExtent = new esri.geometry.Extent({"xmin":-9654356.83267948,"ymin":3553252.14612359,"xmax":-9631845.86180353,"ymax":3569377.06341259,"spatialReference":{"wkid":102100}});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map = new esri.Map("map", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; extent: initExtent,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; slider: true,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lods: lods,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoWindow: popup&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Method 2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is config.txt&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'DefaultExtent' : "-9654356.83267948, 3553252.14612359, -9631845.86180353, 3569377.06341259"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is in my default.html file&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var mapExtent = responseObject.DefaultExtent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var mapExtent2 = mapExtent.split(',');&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map = new esri.Map("map", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; slider: true,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lods: lods,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoWindow: popup&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.setExtent(new esri.geometry.Extent(parseFloat(mapExtent2[0]), parseFloat(mapExtent2[1]), parseFloat(mapExtent2[2]), parseFloat(mapExtent2[3]),&amp;nbsp; new esri.SpatialReference({ wkid: 102100 })));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luci&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 12:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246081#M22779</guid>
      <dc:creator>LuciHawkins</dc:creator>
      <dc:date>2012-07-03T12:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: basemap or featurelayer which one sets projection</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246082#M22780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Its set by the first layer added (even if you dont explicitly call it, i.e. basemap gallery).&amp;nbsp; I would hate to think my app was "picking" for me, and would try to find a way to explicitly set it .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 16:46:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246082#M22780</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2012-07-03T16:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: basemap or featurelayer which one sets projection</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246083#M22781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay.&amp;nbsp; What is the difference between the above 2 methods?&amp;nbsp; In the first, everything is fine.&amp;nbsp; The dynamic layers (wkid 2238) seem to be reprojecting on the fly just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the second method, my dynamic layers do not project on the fly and are in Africa instead of Florida.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luci&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2012 18:47:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246083#M22781</guid>
      <dc:creator>LuciHawkins</dc:creator>
      <dc:date>2012-07-05T18:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: basemap or featurelayer which one sets projection</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246084#M22782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In method 2 you are setting the extent, you are not setting the spatial reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would try alerting (map.spatialReference.wkid) and my guess is it will be wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.spatialReference = = new esri.SpatialReference({wkid:102100});&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prior to your map.setExtent line&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2012 19:00:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-or-featurelayer-which-one-sets-projection/m-p/246084#M22782</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2012-07-05T19:00:54Z</dc:date>
    </item>
  </channel>
</rss>

