<?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: how remove new Graphic() a map? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345624#M31891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fabien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you would need to get the scope of the dojoArray function to the same scope as the _myVar_ is in so to do that you need a lang.hitch on the dojoArray function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;var _myVar_ = "my point name";&lt;/SPAN&gt;
on(dojo.byId("deleteBtn"), "click", lang.hitch(this,function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojoArray.some(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.graphics.graphics, lang.hitch(this, function(gra){&lt;/SPAN&gt;
&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/SPAN&gt;(gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes &lt;/SPAN&gt;&amp;amp;&amp;amp; gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes&lt;/SPAN&gt;.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;Nombre &lt;/SPAN&gt;=== &lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;_myVar_ &lt;/SPAN&gt;){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;.graphics.&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #7a7a43;"&gt;remove&lt;/SPAN&gt;(gra);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;/SPAN&gt;
}));&lt;/PRE&gt;&lt;P style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;Or using my recommend dojo version of code from your previous post &lt;A href="https://community.esri.com/thread/175508" target="_blank"&gt;set PictureMarkerSymbol to map&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on(dojo.byId("deleteBtn"), "click", lang.hitch(this,function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;var selected = registry.byId('choferSelect').get('value');&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojoArray.some(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.graphics.graphics, lang.hitch(this, function(gra){&lt;/SPAN&gt;
&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/SPAN&gt;(gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes &lt;/SPAN&gt;&amp;amp;&amp;amp; gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes&lt;/SPAN&gt;.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;Nombre &lt;/SPAN&gt;=== &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;choferes[selected - &lt;/SPAN&gt;&lt;SPAN class="number" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: green;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;].nombre&lt;/SPAN&gt;){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;.graphics.&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #7a7a43;"&gt;remove&lt;/SPAN&gt;(gra);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;/SPAN&gt;
}));&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:16:47 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-11T16:16:47Z</dc:date>
    <item>
      <title>how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345617#M31884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello, this is how I add a dynamic new Graphic() to my map, by clicking a button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;idButtonDojo &lt;/SPAN&gt;= &lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;var &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;newButton &lt;/SPAN&gt;= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'ButtonNodeAddMark_'&lt;/SPAN&gt;+&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;idButtonDojo&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;// &amp;lt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;&amp;gt; It is a variable data&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;$&lt;/SPAN&gt;( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"#"&lt;/SPAN&gt;+&lt;SPAN style="color: #458383;"&gt;newButton &lt;/SPAN&gt;).&lt;SPAN style="color: #7a7a43;"&gt;on&lt;/SPAN&gt;( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"click"&lt;/SPAN&gt;, {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;y &lt;/SPAN&gt;: &amp;lt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;x &lt;/SPAN&gt;: &amp;lt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; nombre : &amp;lt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; direccion : &amp;lt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; telefono : &amp;lt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;color &lt;/SPAN&gt;: &amp;lt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}, &lt;SPAN style="font-style: italic;"&gt;addDinamicMark &lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;function &lt;SPAN style="font-style: italic;"&gt;addDinamicMark&lt;/SPAN&gt;(event) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;var &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;mapPnt &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Point(event.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;y&lt;/SPAN&gt;,event.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;x&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;SpatialReference({&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;wkid&lt;/SPAN&gt;:&lt;SPAN style="color: #0000ff;"&gt;4326&lt;/SPAN&gt;}));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;_width&lt;/SPAN&gt;=&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;_height&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;50&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-style: italic;"&gt;setMark&lt;/SPAN&gt;(webMercatorUtils.geographicToWebMercator(&lt;SPAN style="color: #458383;"&gt;mapPnt&lt;/SPAN&gt;),event.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;nombre&lt;/SPAN&gt;,event.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;direccion&lt;/SPAN&gt;,event.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;telefono&lt;/SPAN&gt;,event.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;data&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;color&lt;/SPAN&gt;,&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;_width&lt;/SPAN&gt;,&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;_height&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;function &lt;SPAN style="font-style: italic;"&gt;setMark&lt;/SPAN&gt;(pnt,nombre,direccion,telefono,color,_width,_height) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;var &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;Symbol &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;PictureMarkerSymbol(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fstatic.arcgis.com%2Fimages%2FSymbols%2FShapes%2F" rel="nofollow" target="_blank"&gt;https://static.arcgis.com/images/Symbols/Shapes/&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;+color+&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Pin1LargeB.png"&lt;/SPAN&gt;,_width,_height);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;var &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;Template &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;InfoTemplate(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"${Nombre}"&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"&amp;lt;i&amp;gt;&amp;lt;font color='grey'&amp;gt;Dirección:&amp;lt;/font&amp;gt;&amp;lt;/i&amp;gt; ${Direccion}&amp;lt;br /&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;\n\&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp; &amp;lt;i&amp;gt;&amp;lt;font color='grey'&amp;gt;Telefono:&amp;lt;/font&amp;gt;&amp;lt;/i&amp;gt; ${Contacto}&amp;lt;br /&amp;gt;"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;var &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;mark &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Graphic(&lt;/P&gt;&lt;P&gt;&amp;nbsp; pnt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #458383;"&gt;Symbol&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Nombre"&lt;/SPAN&gt;: nombre,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Direccion"&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"&amp;lt;br/&amp;gt;"&lt;/SPAN&gt;+direccion,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Contacto"&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"&amp;lt;br/&amp;gt;"&lt;/SPAN&gt;+telefono&lt;/P&gt;&lt;P&gt;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #458383;"&gt;Template&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #458383;"&gt;map&lt;/SPAN&gt;.graphics.&lt;SPAN style="color: #7a7a43;"&gt;add&lt;/SPAN&gt;(&lt;SPAN style="color: #458383;"&gt;mark&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #458383;"&gt;map&lt;/SPAN&gt;.infoWindow.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resize&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;270&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;350&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to remove this same NEW GRAPHIC() the map with another button, how I can do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2016 17:04:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345617#M31884</guid>
      <dc:creator>CloudingSoft</dc:creator>
      <dc:date>2016-04-17T17:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345618#M31885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out the remove graphic method from the GraphicsLayer class:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/graphicslayer-amd.html#remove" title="https://developers.arcgis.com/javascript/jsapi/graphicslayer-amd.html#remove"&gt;GraphicsLayer | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2016 19:30:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345618#M31885</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2016-04-17T19:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345619#M31886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok but can not find a simple example to apply in my code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2016 20:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345619#M31886</guid>
      <dc:creator>CloudingSoft</dc:creator>
      <dc:date>2016-04-17T20:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345620#M31887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fabien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This is how you do that.&lt;/P&gt;&lt;P&gt;require "dojo/_base/array", dojoArray&lt;/P&gt;&lt;P&gt;on(dojo.byId("deleteBtn"), "click", lang.hitch(this,function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojoArray.some(&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #458383;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;.graphics.graphics, function(gra, index){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(gra.attribbutes.nombre === 'what ever'){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.remove(gra);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2016 20:27:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345620#M31887</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-17T20:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345621#M31888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;applying this code gives me this error:&lt;/P&gt;&lt;P&gt;"Uncaught ReferenceError: lang is not defined"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2016 20:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345621#M31888</guid>
      <dc:creator>CloudingSoft</dc:creator>
      <dc:date>2016-04-17T20:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345622#M31889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;That means you need the dojo/lang require&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2016 21:14:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345622#M31889</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-17T21:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345623#M31890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ok, and as would pass a parameter to compare the gran.attributes.Nombre?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;var _myVar_ = "my point name";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;on(dojo.byId("deleteBtn"), "click", lang.hitch(this,function(){&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojoArray.some(&lt;SPAN style="font-weight: inherit; font-style: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;.graphics.graphics, function(gra, index){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(gra.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;attributes &lt;/SPAN&gt;&amp;amp;&amp;amp; gra.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;attributes&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;Nombre &lt;/SPAN&gt;=== &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;_myVar_ &lt;/SPAN&gt;){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #458383;"&gt;map&lt;/SPAN&gt;.graphics.&lt;SPAN style="color: #7a7a43;"&gt;remove&lt;/SPAN&gt;(gra);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;}));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2016 22:04:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345623#M31890</guid>
      <dc:creator>CloudingSoft</dc:creator>
      <dc:date>2016-04-17T22:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345624#M31891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fabien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you would need to get the scope of the dojoArray function to the same scope as the _myVar_ is in so to do that you need a lang.hitch on the dojoArray function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;var _myVar_ = "my point name";&lt;/SPAN&gt;
on(dojo.byId("deleteBtn"), "click", lang.hitch(this,function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojoArray.some(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.graphics.graphics, lang.hitch(this, function(gra){&lt;/SPAN&gt;
&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/SPAN&gt;(gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes &lt;/SPAN&gt;&amp;amp;&amp;amp; gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes&lt;/SPAN&gt;.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;Nombre &lt;/SPAN&gt;=== &lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;_myVar_ &lt;/SPAN&gt;){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;.graphics.&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #7a7a43;"&gt;remove&lt;/SPAN&gt;(gra);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;/SPAN&gt;
}));&lt;/PRE&gt;&lt;P style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;Or using my recommend dojo version of code from your previous post &lt;A href="https://community.esri.com/thread/175508" target="_blank"&gt;set PictureMarkerSymbol to map&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on(dojo.byId("deleteBtn"), "click", lang.hitch(this,function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;var selected = registry.byId('choferSelect').get('value');&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojoArray.some(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.graphics.graphics, lang.hitch(this, function(gra){&lt;/SPAN&gt;
&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/SPAN&gt;(gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes &lt;/SPAN&gt;&amp;amp;&amp;amp; gra.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;attributes&lt;/SPAN&gt;.&lt;SPAN style="font-weight: bold; font-style: inherit; font-family: inherit; color: #660e7a;"&gt;Nombre &lt;/SPAN&gt;=== &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;choferes[selected - &lt;/SPAN&gt;&lt;SPAN class="number" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: green;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;].nombre&lt;/SPAN&gt;){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #458383;"&gt;map&lt;/SPAN&gt;.graphics.&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #7a7a43;"&gt;remove&lt;/SPAN&gt;(gra);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;/SPAN&gt;
}));&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:16:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345624#M31891</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T16:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345625#M31892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;good, but not in all cases use the tag &amp;lt;select&amp;gt;.&lt;/P&gt;&lt;P&gt;thanks for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Apr 2016 16:36:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345625#M31892</guid>
      <dc:creator>CloudingSoft</dc:creator>
      <dc:date>2016-04-23T16:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: how remove new Graphic() a map?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345626#M31893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fabien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; OK, Don't forget to mark your questions as answered by clicking on the "Correct Answer" link on the reply that answered your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Apr 2016 17:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-remove-new-graphic-a-map/m-p/345626#M31893</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-23T17:21:54Z</dc:date>
    </item>
  </channel>
</rss>

