<?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.spatialReference has null values for wkid and wkt after upgrading from 1.5 to 2.1 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-spatialreference-has-null-values-for-wkid-and/m-p/454330#M42001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am updating an existing web application from version 1.5 to 2.1 of the ArcGIS JavaScript API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After pointing my page to the version 2.1 API URL I noticed that the Map.spatialReference property is set to an esri.SpatialReference object with null values for both the wkid and wkt properties.&amp;nbsp; As a result, when the Map.onClick event is fired, the mapPoint property does not have a valid spatial reference and attempting to use the mapPoint with the Identify task will fail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using version 1.5, the Map.spatialReference property returned the same spatial reference as the first layer added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Was this change intentional, or is this a bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function doIdentify(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ////// Worked under version 1.5, but not under 2.1 due to mapPoint's spatialReference property being invalid.
&amp;nbsp;&amp;nbsp;&amp;nbsp; ////identifyParams.geometry = evt.mapPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.geometry = new esri.geometry.Point(evt.mapPoint.x, evt.mapPoint.y, bgLayer.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.mapExtent = map.extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // idResults is an out parameter created by the identify task's onComplete event.
&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyTask.execute(identifyParams, function(idResults) { onIdentifyExecutionComplete(idResults, evt); });
}

function map_onLoad(map) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onClick", doIdentify);
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Sep 2010 19:05:57 GMT</pubDate>
    <dc:creator>JeffJacobson</dc:creator>
    <dc:date>2010-09-22T19:05:57Z</dc:date>
    <item>
      <title>Map.spatialReference has null values for wkid and wkt after upgrading from 1.5 to 2.1</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-spatialreference-has-null-values-for-wkid-and/m-p/454330#M42001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am updating an existing web application from version 1.5 to 2.1 of the ArcGIS JavaScript API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After pointing my page to the version 2.1 API URL I noticed that the Map.spatialReference property is set to an esri.SpatialReference object with null values for both the wkid and wkt properties.&amp;nbsp; As a result, when the Map.onClick event is fired, the mapPoint property does not have a valid spatial reference and attempting to use the mapPoint with the Identify task will fail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using version 1.5, the Map.spatialReference property returned the same spatial reference as the first layer added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Was this change intentional, or is this a bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function doIdentify(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ////// Worked under version 1.5, but not under 2.1 due to mapPoint's spatialReference property being invalid.
&amp;nbsp;&amp;nbsp;&amp;nbsp; ////identifyParams.geometry = evt.mapPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.geometry = new esri.geometry.Point(evt.mapPoint.x, evt.mapPoint.y, bgLayer.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.mapExtent = map.extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // idResults is an out parameter created by the identify task's onComplete event.
&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyTask.execute(identifyParams, function(idResults) { onIdentifyExecutionComplete(idResults, evt); });
}

function map_onLoad(map) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onClick", doIdentify);
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 19:05:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-spatialreference-has-null-values-for-wkid-and/m-p/454330#M42001</guid>
      <dc:creator>JeffJacobson</dc:creator>
      <dc:date>2010-09-22T19:05:57Z</dc:date>
    </item>
  </channel>
</rss>

