<?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 Selecting graphics programmatically in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539774#M50252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I understand this isn't exactly a rare question here, but I still haven't found an ideal solution.&amp;nbsp; What I want to do is have exactly the same behavior when I select a graphic on the map as when I select it from a list outside the map, ie the InfoWindow pops up using the InfoTemplate/attributes of the graphic I've specified and the graphic gets the "selected" icon (the blue square).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It isn't too difficult to hack around this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
//gfx is a graphic that comes from elsewhere...
map.infoWindow.setTitle(gfx.getTitle());
map.infoWindow.setContent(gfx.getContent());
map.infoWindow.show(gfx.geometry);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, this doesn't produce the same behavior as a click.&amp;nbsp; The map's InfoWindow "onShow" event fires but the event has no graphic attached, and if you had a graphic selected already, the blue selected icon on the map stays where it is and doesn't attach to the new graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something I missing, or is the best way to simply stop using InfoTemplates entirely and rely on infoWindow.show?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Nov 2013 13:35:42 GMT</pubDate>
    <dc:creator>AdamReiter</dc:creator>
    <dc:date>2013-11-07T13:35:42Z</dc:date>
    <item>
      <title>Selecting graphics programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539774#M50252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I understand this isn't exactly a rare question here, but I still haven't found an ideal solution.&amp;nbsp; What I want to do is have exactly the same behavior when I select a graphic on the map as when I select it from a list outside the map, ie the InfoWindow pops up using the InfoTemplate/attributes of the graphic I've specified and the graphic gets the "selected" icon (the blue square).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It isn't too difficult to hack around this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
//gfx is a graphic that comes from elsewhere...
map.infoWindow.setTitle(gfx.getTitle());
map.infoWindow.setContent(gfx.getContent());
map.infoWindow.show(gfx.geometry);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, this doesn't produce the same behavior as a click.&amp;nbsp; The map's InfoWindow "onShow" event fires but the event has no graphic attached, and if you had a graphic selected already, the blue selected icon on the map stays where it is and doesn't attach to the new graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something I missing, or is the best way to simply stop using InfoTemplates entirely and rely on infoWindow.show?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 13:35:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539774#M50252</guid>
      <dc:creator>AdamReiter</dc:creator>
      <dc:date>2013-11-07T13:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting graphics programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539775#M50253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure if I'm following your question exactly, but the short answer is you ought to be able to use a mix of infoTemplate and infoWindow.show.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You mention clicking on a list, how are you determining which feature that it goes with, featureLayer.selectFeatures? QueryTask?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I'm selecting from something external to the map, it's almost always a grid.&amp;nbsp; I select the feature from the map based on a queryTask.&amp;nbsp;&amp;nbsp; To see the highlighted symbol, I've been creating a graphic, using the geometry of the results of that query, adding it right before I set the infoWindow content.&amp;nbsp; And at the top of that function I always hide the infoWindow and clear the map graphics, so I don't have the symbol from a previous click.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 15:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539775#M50253</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-11-07T15:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting graphics programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539776#M50254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry I'm not being very clear.&amp;nbsp; I forgot to stress that in this case the Graphic is already on the map, I'm just trying to highlight it.&amp;nbsp; I spent some time trying to figure out how to trick the map into thinking I'd clicked on a graphic and I was hoping there was a more straightforward way to do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm really looking for is something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
map.selectGraphic(gfx); //not a real function
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Where the graphic is already on the map.&amp;nbsp; I can pretend the graphic is selected by repopulating and showing the info window at the Graphic's point, but it seems silly to go through all that when it's such a straightforward thing to want to do.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:24:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539776#M50254</guid>
      <dc:creator>AdamReiter</dc:creator>
      <dc:date>2021-12-11T23:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting graphics programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539777#M50255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That sounds like wishful thinking.&amp;nbsp; To me, graphics are all just something short lived, so I'm not surprised to have to continually recreate and clear them as I go.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 19:39:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539777#M50255</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-11-07T19:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting graphics programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539778#M50256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe there's a better way to accomplish what I'm trying to do then.&amp;nbsp; Here's the basic workflow:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) User uses the DrawTool to query a location on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) Service returns a result list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3.) Graphics are placed on the map in the drawn query area AND items are placed in an HTML list corresponding to the graphics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The user then needs to be able to either select the graphic on the map OR the the item in the list, with the same result: the InfoWindow being opened and the graphic being highlighted.&amp;nbsp; I'm keeping a map of the graphics with keys corresponding to the list items for easy recovery.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's #3 if it helps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//results returned
for (var index in results) {
&amp;nbsp; result = results[index];

&amp;nbsp; attr = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "name": result.name,
&amp;nbsp;&amp;nbsp;&amp;nbsp; "lon": result.longitude,
&amp;nbsp;&amp;nbsp;&amp;nbsp; "lat": result.latitude
&amp;nbsp; };

&amp;nbsp; template = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title: "${name}",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; body: infoWindowMinimizedFragment //HTML fragment
&amp;nbsp; };
&amp;nbsp;&amp;nbsp; 
&amp;nbsp; pt = new Point(attr.lon, attr.lat);
&amp;nbsp; gfx = new Graphic(pt, symbols.resultSy, attr, new InfoTemplate(template.title, template.body));
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; resultsLayer.add(gfx);
&amp;nbsp; graphicsIndex[result.name] = gfx;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, when the use clicks an item in the list:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var gfx = graphicsIndex[event.target.innerHTML];
 
//map.selectGraphic(gfx);&amp;nbsp; wishful thinking

map.infoWindow.setTitle(gfx.getTitle());
map.infoWindow.setContent(gfx.getContent());
map.infoWindow.show(gfx.geometry);
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;With this setup I get the problems stated in the original post: no graphic in the InfoWindow show event and the built-in blue graphic highlight doesn't update (which means I either have to disable it or scrap InfoTemplates entirely).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there's a better, more robust way to do this I'd love to find it.&amp;nbsp; I've run into this problem several times in several different ESRI applications.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:24:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539778#M50256</guid>
      <dc:creator>AdamReiter</dc:creator>
      <dc:date>2021-12-11T23:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting graphics programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539779#M50257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think there's a really elegant way to do it, but you should be able to at least have the graphic appear highlighted on the right feature.&amp;nbsp; There are multiple ways to define infoTemplates, popups etc, so I don't know if the way I go about it fits into what you have done or not.&amp;nbsp; You may have all this established in your code already, but here's how I go about it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I like a large yellow circle with a transparency on it so it stands out.&amp;nbsp; I define my symbol at beginning, along with my popup, which I use in my map definition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 highlightMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Color([255,255,0]), 2),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Color([255,255,0,0.5]));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var popup = new Popup({ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fillSymbol: new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,200,0]), 2), new Color([255,255,0,0.30])) ,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; markerSymbol:&amp;nbsp; highlightMarkerSymbol
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, dojo.create("div")); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
map = new Map("mapDiv", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basemap: "topo",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: [-92.593, 38.5],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoWindow:popup,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sliderPosition: "top-left",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sliderStyle: "large",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 7
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not using a featurelayer, I'm just defining the infoTemplate in the results handler of my Identify Task.&amp;nbsp; Since I'm clicking on the map, and I have my infoWindow defined as popup in my map constructor, this is giving me my highlight symbol automatically without explicitly telling it to 'draw a graphic'.&amp;nbsp; This example looks a little different because I have my Identify set as deferred with 'promise/all' so I had to also manage which layer my identify was coming from&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var formatResults = arrayUtils.map(results, function(result){&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; var feature = result.feature;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var layerName = result.layerName;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.attributes.layerName = result.layerName;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.setInfoTemplate(generateInfoTemplate);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; generateInfoTemplate.setTitle("Layer Information");//don't need a graphic, it's drawing from the infoWindow:popup in the map constructor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return feature;&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;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (formatResults.length === 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.clearFeatures();
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.setFeatures(formatResults);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(idPoint);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; 
{/CODE]

When I'm outside the map, in my grid, the items in that list aren't aware they are associated with a graphic, they're just data.&amp;nbsp;&amp;nbsp; But the data includes the objectID, so I'm running a query to get back to what the corresponding graphic is.&amp;nbsp; This is a function that needs to work from one of two grids I have, so there's extra lines and incoming parameters here:
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; //highlights the feature when the user selects from the grid
 function highlightFeatureFromGrid(event, dGrid, qTask) {
&amp;nbsp;&amp;nbsp; app.map.graphics.clear();
&amp;nbsp;&amp;nbsp; app.map.infoWindow.hide();
&amp;nbsp;&amp;nbsp; var row = dGrid.row(event);
&amp;nbsp;&amp;nbsp; var query = new Query();
&amp;nbsp;&amp;nbsp; var objid = [row.data.objectid];
&amp;nbsp;&amp;nbsp; query.where = "OBJECTID = " + objid; 
&amp;nbsp;&amp;nbsp; query.returnGeometry = true;
&amp;nbsp;&amp;nbsp; query.outFields = ["*"];
&amp;nbsp;&amp;nbsp; query.outSpatialReference = spatialReference;
&amp;nbsp;&amp;nbsp; qTask.execute(query, function (results) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var feature = results.features[0];//should only be on feature by that id in that layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (results.displayFieldName == 'VENDORID'){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.setInfoTemplate(venInfoTemplate);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.setInfoTemplate(offSatInfoTemplate);
&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;&amp;nbsp; app.map.centerAndZoom(feature.geometry, 12);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic = new Graphic(feature.geometry, highlightMarkerSymbol,feature.attributes, feature.infoTemplate);&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;&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; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.graphics.add(graphic);&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.infoWindow.setContent(feature.getContent());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.infoWindow.setTitle(feature.getTitle());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.infoWindow.show(feature.geometry);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
}&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Assuming that gfx in your example is an esri Graphic and not something else, you ought to be able to just construct and draw a new Graphic over the top using the parameters of the existing one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It ain't elegant, but it works.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:24:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selecting-graphics-programmatically/m-p/539779#M50257</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-11T23:24:49Z</dc:date>
    </item>
  </channel>
</rss>

