<?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 constructor failing to set WKID in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-constructor-failing-to-set-wkid/m-p/359638#M33338</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I use the following map constructor to build my map I get an error. The error says: &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 32149)&lt;/SPAN&gt;&lt;SPAN&gt;. I'm using the 3.3 version and I don't get why this is failing. What am I doing wrong here? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;map = new esri.Map("map", { &amp;nbsp; autoResize: true, &amp;nbsp; center: [79375.16, 52916.77], &amp;nbsp; extent: new esri.geometry.Extent({ &amp;nbsp;&amp;nbsp;&amp;nbsp; xmin: 528102.74,&amp;nbsp;&amp;nbsp; ymin: 109727.35,&amp;nbsp;&amp;nbsp; xmax: 607477.90,&amp;nbsp;&amp;nbsp; ymax: 162644.12,&amp;nbsp;&amp;nbsp; spatialReference: new esri.SpatialReference({wkid:32149})}), &amp;nbsp; minZoom: 3, &amp;nbsp; zoom: 4 });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Mar 2013 21:02:09 GMT</pubDate>
    <dc:creator>DuncanNisbett</dc:creator>
    <dc:date>2013-03-18T21:02:09Z</dc:date>
    <item>
      <title>Map constructor failing to set WKID</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-constructor-failing-to-set-wkid/m-p/359638#M33338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I use the following map constructor to build my map I get an error. The error says: &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 32149)&lt;/SPAN&gt;&lt;SPAN&gt;. I'm using the 3.3 version and I don't get why this is failing. What am I doing wrong here? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;map = new esri.Map("map", { &amp;nbsp; autoResize: true, &amp;nbsp; center: [79375.16, 52916.77], &amp;nbsp; extent: new esri.geometry.Extent({ &amp;nbsp;&amp;nbsp;&amp;nbsp; xmin: 528102.74,&amp;nbsp;&amp;nbsp; ymin: 109727.35,&amp;nbsp;&amp;nbsp; xmax: 607477.90,&amp;nbsp;&amp;nbsp; ymax: 162644.12,&amp;nbsp;&amp;nbsp; spatialReference: new esri.SpatialReference({wkid:32149})}), &amp;nbsp; minZoom: 3, &amp;nbsp; zoom: 4 });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 21:02:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-constructor-failing-to-set-wkid/m-p/359638#M33338</guid>
      <dc:creator>DuncanNisbett</dc:creator>
      <dc:date>2013-03-18T21:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Map constructor failing to set WKID</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-constructor-failing-to-set-wkid/m-p/359639#M33339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the new options to specify a center and zoom level in the map constructor are meant to replace the old technique of supplying the extent itself.&amp;nbsp; right now you are setting both.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;additionally, the coordinates passed to "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/map.html#Map/MapConst" rel="nofollow" target="_blank"&gt;center&lt;/A&gt;&lt;SPAN&gt;" are assumed to be either web mercator or latitude and longitude unless you actually define a new point geometry object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i didnt test this, but it should look something like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;map = new esri.Map("map", { &amp;nbsp; autoResize: true, &amp;nbsp; //center: [79375.16, 52916.77], &amp;nbsp; center: new esri.geometry.Point([79375.16,52916.77],new esri.SpatialReference({ wkid:32149 }));, &amp;nbsp; //extent: new esri.geometry.Extent({ &amp;nbsp;&amp;nbsp;&amp;nbsp; xmin: 528102.74,&amp;nbsp;&amp;nbsp; ymin: 109727.35,&amp;nbsp;&amp;nbsp; xmax: 607477.90,&amp;nbsp;&amp;nbsp; ymax: 162644.12,&amp;nbsp;&amp;nbsp; spatialReference: new esri.SpatialReference({wkid:32149})}), &amp;nbsp; minZoom: 3, &amp;nbsp; zoom: 4 });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 18:29:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-constructor-failing-to-set-wkid/m-p/359639#M33339</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-03-19T18:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Map constructor failing to set WKID</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-constructor-failing-to-set-wkid/m-p/359640#M33340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fantastic, that was the answer. I needed to pass a geometry point with the correct wkid and that fixed it. I of course also had my x,y coordinates reversed and the wrong values, but that's just semantics. Here's the updated code that worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;map = new esri.Map("map", {
 autoResize: true,
 center: new esri.geometry.Point([567790.32,136185.91], new esri.SpatialReference({ wkid:32149 })),
 minZoom: 3,
 zoom: 4
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:47:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-constructor-failing-to-set-wkid/m-p/359640#M33340</guid>
      <dc:creator>DuncanNisbett</dc:creator>
      <dc:date>2021-12-11T16:47:05Z</dc:date>
    </item>
  </channel>
</rss>

