<?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 appearing in incorrect location in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27271#M2354</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had similar issues to this one.&amp;nbsp; What I would try is to call the resize method and the reposition method AFTER the changes to the map window have been made. The trick is to let the map know it has been moved or resized after the moving and resizing have been done.&amp;nbsp; You could even put a delay on the calls by 500ms to insure that the map div is resized and moved before the methods are called.&amp;nbsp; Something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14134833279401143" jivemacro_uid="_14134833279401143" modifiedtitle="true"&gt;
&lt;P&gt;setTimeout(function(){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.reposition();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.resize();&lt;/P&gt;
&lt;P&gt;}, 500);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Isaiah Aguilera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Oct 2014 18:17:44 GMT</pubDate>
    <dc:creator>IsaiahAguilera</dc:creator>
    <dc:date>2014-10-16T18:17:44Z</dc:date>
    <item>
      <title>infoWindow appearing in incorrect location</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27270#M2353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a frustrating problem with my infoWindow using ArcGIS API for JS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;The scenario is this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have 4 buttons, each one of them loads a map (a different one for each button) and each map has one layer associated. So I have four buttons that creates 4 different maps and each map has a layer (layers are also different from each other). I'm also implementing infoWindows, so every time I click the map, it brings up an infoWindow with some information about the layers that were clicked upon. The &lt;STRONG&gt;first&lt;/STRONG&gt; time I click any button, the map loads just fine, with the proper size (width=100% y height=100%) and the infoWindow shows up in the right place, where I clicked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;The problem is this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As I mentioned above, it works everything just the first time I click a button. If I want to see another map, I should click another button and here is where the problem is. When I click another button, this creates a new map and the corresponding layer is added &lt;EM&gt;BUT&lt;/EM&gt;... When the map loads, the size of the map is 400px X 400px and when I click the map, the infoWindow pops up (seemingly randomly) in a incorrect location. I've read countless forum posts on this issue, which telling me to use map.resize(). I either am not understanding where exactly to use these functions, or they're simply not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: On a browser if I load a &lt;SPAN style="text-decoration: underline;"&gt;second &lt;/SPAN&gt;map (i.e., after loading the first one) , this is, as described above, the infoWindow pops up in bad location, but if I change the size of the browser, the map starts to show the infoWindow just in the right place, where I clicked. Aalthough the size of the map remains unchanged (400x400).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been dealing with this problem over a week now. I'm frustrated and I don't know what else I can do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every help, every light is welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 15:25:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27270#M2353</guid>
      <dc:creator>Ana_Velasquez</dc:creator>
      <dc:date>2014-10-16T15:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: infoWindow appearing in incorrect location</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27271#M2354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had similar issues to this one.&amp;nbsp; What I would try is to call the resize method and the reposition method AFTER the changes to the map window have been made. The trick is to let the map know it has been moved or resized after the moving and resizing have been done.&amp;nbsp; You could even put a delay on the calls by 500ms to insure that the map div is resized and moved before the methods are called.&amp;nbsp; Something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14134833279401143" jivemacro_uid="_14134833279401143" modifiedtitle="true"&gt;
&lt;P&gt;setTimeout(function(){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.reposition();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.resize();&lt;/P&gt;
&lt;P&gt;}, 500);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Isaiah Aguilera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 18:17:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27271#M2354</guid>
      <dc:creator>IsaiahAguilera</dc:creator>
      <dc:date>2014-10-16T18:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: infoWindow appearing in incorrect location</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27272#M2355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Hi &lt;A href="https://community.esri.com/migrated-users/16444"&gt;Isaiah Aguilera&lt;/A&gt;&amp;nbsp; &lt;/SPAN&gt;Thanks a lot!! This just solve my life. I combined what you suggest me with another piece of code that I already had.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll leave it here in case someone else is having my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14135530200674282 jive_text_macro" jivemacro_uid="_14135530200674282" modifiedtitle="true"&gt;
&lt;P&gt;LayerPR.setDisableClientCaching(true);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if (layerPR.disableClientCaching) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; aspect.after(layerPR, "onUpdateEnd", function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setInterval(function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapPR.reposition();&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapPR.resize();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, 500); &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Muchas gracias, de verdad!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:40:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27272#M2355</guid>
      <dc:creator>Ana_Velasquez</dc:creator>
      <dc:date>2014-10-17T13:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: infoWindow appearing in incorrect location</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27273#M2356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ana,&lt;/P&gt;&lt;P&gt;I'm sorry I want able to get back to you sooner! I'm glad everything worked out for you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Isaiah Aguilera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 22:51:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infowindow-appearing-in-incorrect-location/m-p/27273#M2356</guid>
      <dc:creator>IsaiahAguilera</dc:creator>
      <dc:date>2014-10-17T22:51:19Z</dc:date>
    </item>
  </channel>
</rss>

