<?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: infoWindow on a GraphicsLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251525#M23299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks. That eliminated the error, but the infoWindow is still blank. It's not a deal breaker. I think I can work around it, but was hoping it would be simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll keep cracking at it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Oct 2010 17:19:17 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2010-10-04T17:19:17Z</dc:date>
    <item>
      <title>infoWindow on a GraphicsLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251523#M23297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been spending some time with the JavaScript API, but I'm a little stumped on this one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Most of the samples I have seen simply use the map.graphics GraphicsLayer to hold graphics. In my case, I have added a new GraphicsLayer so that I can hold persistent graphics on the map. I use map.graphics to hold Geocode Results or temporary graphics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am trying to do is display the infoWindow for the GraphicsLayer I added to the map, but it's not working as I expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On page load, after populating my GraphicsLayer, I add it to the map with a defined InfoTemplate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;gLayer = new esri.layers.GraphicsLayer();
gLayer.id = "features";
var graphic = new esri.Graphic(new esri.geometry.Polygon(geometry), symbol, attributes, infoTemplate);
gLayer.add(graphic);
map.addLayer(gLayer);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;During it's use, someone can search for an address and I add that result to map.graphics. Then try to display the infoWindow after it has zoomed in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var pointMeters = esri.geometry.geographicToWebMercator(geocodeResults[0].location);
map.setExtent(esri.geometry.geographicToWebMercator(geocodeResults[0].bestView));
var onMapZoomHandle = dojo.connect(map, "onZoomEnd", function() {
 dojo.disconnect(onMapZoomHandle);
 console.log("add result zoomed");
 var point = esri.geometry.toScreenPoint(map.extent, map.width, map.height, pointMeters);
 map.infoWindow.show(point, map.getInfoWindowAnchor(point)); // throws error
 //map.getLayer("features").infoWindow.show(point, map.getInfoWindowAnchor(point));
 // tried having layer show directly, long shot, but no go
});&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This throws an error and a blank infoWindow&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;exception in animation handler for: onEnd
TypeError: pt is null
[Break on this error] if(!dojo._hasResource["dijit._base.man...h","tr","xx","zh","zh-cn","zh-tw"]);\r\n
arcgis?v=2.1 (line 48&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can click anywhere else on the added GraphicsLayer and get the predefined InfoWindow just fine. Does that InfoWindow display on the map.click() or the graphicsLayer.click()? If so, is there a way I can throw that event after the zoom to mimic the behavior?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 13:25:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251523#M23297</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2010-10-01T13:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: infoWindow on a GraphicsLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251524#M23298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since you are using map.setExtent, try replacing onZoomEnd with onExtentChange to ensure that the event fires when the extent change is complete. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 

var extentHandler = dojo.connect(map, 'onExtentChange', function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.disconnect(extentHandler); ..........&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:28:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251524#M23298</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-11T12:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: infoWindow on a GraphicsLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251525#M23299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks. That eliminated the error, but the infoWindow is still blank. It's not a deal breaker. I think I can work around it, but was hoping it would be simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll keep cracking at it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 17:19:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251525#M23299</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2010-10-04T17:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: infoWindow on a GraphicsLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251526#M23300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I read your initial post I missed the bit about the info template not displaying. In order to display the graphic's attributes in the info window you'll need to populate the maps info window with the graphics content. Here's a link to a sample in the help that shows this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/query_showinfowindow.html"&gt;http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/query_showinfowindow.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 18:35:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251526#M23300</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2010-10-04T18:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: infoWindow on a GraphicsLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251527#M23301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks. After some head scratching and looking over API docs, I figured it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// will find if the x/y point for an address is inside of a graphic on my GraphicsLayer
var onMapExtentChangeHandle = dojo.connect(map, "onExtentChange", function() {
 dojo.disconnect(onMapExtentChangeHandle);
 console.log("address result zoomed");
 var point = geometry.toScreenGeometry(map.extent, map.width, map.height, pointMeters);
 for (var i in gLayer.graphics) {
&amp;nbsp; var g = gLayer.graphics&lt;I&gt;;
&amp;nbsp; if (g.geometry.contains(pointMeters)) {
&amp;nbsp;&amp;nbsp; var info = map.infoWindow;
&amp;nbsp;&amp;nbsp; info.setTitle(g.getTitle());
&amp;nbsp;&amp;nbsp; info.setContent(g.getContent());
&amp;nbsp;&amp;nbsp; info.show(point, map.getInfoWindowAnchor(point));
&amp;nbsp; }
 }
});&lt;/I&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:28:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-on-a-graphicslayer/m-p/251527#M23301</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-11T12:28:55Z</dc:date>
    </item>
  </channel>
</rss>

