<?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: Cannot add graphic with a reproject in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53136#M4703</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two thoughts: &lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When you create your new SimpleMarkerSymbol pass it parameters for size and color so it will draw on the map [&lt;A href="https://developers.arcgis.com/javascript/jsapi/simplemarkersymbol-amd.html#simplemarkersymbol2" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;new SimpleMarkerSymbol(style, size, color)]&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;I have run into undefined errors when the scope of the function can no longer reach the map. It is possible that 'this.map' is undefined within your callback so the function to 'add' is not available. There are fancy dojo hitch functions to deal with this but for testing to see if that's the issue, you could try to print 'this.map' to the console and see if it is undefined.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2015 17:34:09 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2015-02-11T17:34:09Z</dc:date>
    <item>
      <title>Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53135#M4702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot figure this out.&amp;nbsp; I am trying to add a graphic to the map and zoom to it based on a reproject.&amp;nbsp; My location entry is in lat/long and my map is in state plane.&amp;nbsp; I am passed back the coordinates correctly, but cannot do add or centerat.&amp;nbsp; Says they are undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching a word document with what I am using.&amp;nbsp; I have been trying to figure this out since yesterday.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 16:01:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53135#M4702</guid>
      <dc:creator>MarkYerington</dc:creator>
      <dc:date>2015-02-11T16:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53136#M4703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two thoughts: &lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When you create your new SimpleMarkerSymbol pass it parameters for size and color so it will draw on the map [&lt;A href="https://developers.arcgis.com/javascript/jsapi/simplemarkersymbol-amd.html#simplemarkersymbol2" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;new SimpleMarkerSymbol(style, size, color)]&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;I have run into undefined errors when the scope of the function can no longer reach the map. It is possible that 'this.map' is undefined within your callback so the function to 'add' is not available. There are fancy dojo hitch functions to deal with this but for testing to see if that's the issue, you could try to print 'this.map' to the console and see if it is undefined.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:34:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53136#M4703</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-02-11T17:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53137#M4704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the map, but when it gets to the graphics shows undefined for some reason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53137#M4704</guid>
      <dc:creator>MarkYerington</dc:creator>
      <dc:date>2015-02-11T17:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53138#M4705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's an interesting image you attached...I'm no expert but it looks like the 'map' that is printing is actually the HTML map div element, not the javascript map object. Is it possible that earlier in your code the 'map' variable was overwritten by referencing the div (maybe by using it's id, 'map')?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because it is returning the HTML, the graphics property would definitely be undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:53:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53138#M4705</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-02-11T17:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53139#M4706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try printing just 'this' and see what it is actually referencing, maybe it's the DOM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:54:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53139#M4706</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-02-11T17:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53140#M4707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it is losing the this.map as soon as I get into the project function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gsvc.project([inpoint], outSR, function(projPoints) { &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once I enter this the reference to the map is lost.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53140#M4707</guid>
      <dc:creator>MarkYerington</dc:creator>
      <dc:date>2015-02-11T18:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53141#M4708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great - so the cheat way is to assign this to 'that' right before the function --&amp;gt; var that = this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then inside the function use: that.map.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I can tell, the fancy way is to use lang.hitch from dojo (&lt;A href="http://dojotoolkit.org/reference-guide/1.10/dojo/_base/lang.html" title="http://dojotoolkit.org/reference-guide/1.10/dojo/_base/lang.html"&gt;dojo/_base/lang — The Dojo Toolkit - Reference Guide))&lt;/A&gt; . &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:15:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53141#M4708</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-02-11T18:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add graphic with a reproject</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53142#M4709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Sarah.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:57:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-graphic-with-a-reproject/m-p/53142#M4709</guid>
      <dc:creator>MarkYerington</dc:creator>
      <dc:date>2015-02-11T18:57:21Z</dc:date>
    </item>
  </channel>
</rss>

