<?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 Size in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-size/m-p/333717#M30821</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If there are certain attributes that can be very long, you could do something like this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var template = new esri.InfoTemplate();
template.setContent(getTextContent);

function getTextContent(graphic) {

&amp;nbsp;&amp;nbsp;&amp;nbsp; var attribute1 = graphic.attributes.Attribute1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var attribute2 = graphic.attributes.Attribute2;

&amp;nbsp;&amp;nbsp;&amp;nbsp; if (attribute1.length &amp;gt; 20 || attribute2.length &amp;gt; 20) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.resize(x,y); //Resize the infoWindow
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var content = "&amp;lt;b&amp;gt;Attribute 1&amp;lt;/b&amp;gt;: " + attribute1 + "&amp;lt;br&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp; content += "&amp;lt;b&amp;gt;Attribute 2&amp;lt;/b&amp;gt;: " + attribute2;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return content;
}

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:47:47 GMT</pubDate>
    <dc:creator>ChadWilcomb</dc:creator>
    <dc:date>2021-12-11T15:47:47Z</dc:date>
    <item>
      <title>InfoWindow Size</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-size/m-p/333716#M30820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know you can set the infoWindow size using the map.infoWindow.resize(x,y) command.&amp;nbsp; My question is whether you can dynamically calculate what the size of that window should be based on the content.&amp;nbsp; I have some information windows that contain a lot of content and therefore need to be very large.&amp;nbsp; I have other information windows that contain very little content and therefore don't need to be very large.&amp;nbsp; So programmatically I would like to figure out the size of each information window for each individual point.&amp;nbsp; Can this be done?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 13:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-size/m-p/333716#M30820</guid>
      <dc:creator>BetsySchenck-Gardner</dc:creator>
      <dc:date>2012-03-29T13:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: InfoWindow Size</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-size/m-p/333717#M30821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If there are certain attributes that can be very long, you could do something like this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var template = new esri.InfoTemplate();
template.setContent(getTextContent);

function getTextContent(graphic) {

&amp;nbsp;&amp;nbsp;&amp;nbsp; var attribute1 = graphic.attributes.Attribute1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var attribute2 = graphic.attributes.Attribute2;

&amp;nbsp;&amp;nbsp;&amp;nbsp; if (attribute1.length &amp;gt; 20 || attribute2.length &amp;gt; 20) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.resize(x,y); //Resize the infoWindow
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var content = "&amp;lt;b&amp;gt;Attribute 1&amp;lt;/b&amp;gt;: " + attribute1 + "&amp;lt;br&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp; content += "&amp;lt;b&amp;gt;Attribute 2&amp;lt;/b&amp;gt;: " + attribute2;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return content;
}

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:47:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-size/m-p/333717#M30821</guid>
      <dc:creator>ChadWilcomb</dc:creator>
      <dc:date>2021-12-11T15:47:47Z</dc:date>
    </item>
  </channel>
</rss>

