<?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: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336548#M31108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/37892"&gt;Jonathan Uihlein&lt;/A&gt; Thanks for your input,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can place the map in any container I wish, but the parent container will always be a part that I don't control.&amp;nbsp; If the parent container is not visible, then any size I provide is ignored, since the map creation process inspects the actual displayed dimensions of the container, and if it is not displayed, the dimensions are 0 or undefined or NaN or something else equally unusable.&lt;/P&gt;&lt;P&gt;I was hoping that the automatic sizing of 400 x 400 could be circumvented or interrupted either by just stopping it from happening or by delaying creation/initialization of the map until it is "safe" to use the provided dimensions.&amp;nbsp; It seems that the only way to do this is with a interval that checks periodically for displayable dimensions or to use the callback that is unavailable to me from the containing application.&lt;/P&gt;&lt;P&gt;What we are doing now is allowing the application to access the resize() and reposition() functions, so that when it knows that the map is displayable, it can call these explicitly.&amp;nbsp; This exposes more of the underlying map API than we would like, but more importantly, at least it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Sep 2014 20:46:14 GMT</pubDate>
    <dc:creator>DavidElies</dc:creator>
    <dc:date>2014-09-18T20:46:14Z</dc:date>
    <item>
      <title>What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336534#M31094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a map that displays in a Bootstrap modal.&amp;nbsp; The map is set to 100% of its container.&amp;nbsp; Since it loads before the modal is made visible, the map assigns its containing div a css width and height of 400px. Since I am creating the map (but NOT the modal), I need to know what event or set of circumstances I need to wait for in order to properly initialize the map.&amp;nbsp; If it is possible to re-initialize or have the map reset its values after an improper initialization I would like to know how to do that, too.&amp;nbsp; To be clear, I cannot use the Bootstrap &lt;SPAN style="font-family: 'courier new', courier;"&gt;shown.bs.modal&lt;/SPAN&gt; event, since the map cannot know about &lt;EM&gt;how&lt;/EM&gt; it is shown (but it can, of course, inspect the DOM, so it might know something about &lt;EM&gt;where&lt;/EM&gt; it is displayed).&amp;nbsp; Any insights at all would be helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 01:13:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336534#M31094</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-09-03T01:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336535#M31095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try setting autoresize property when initializing the map.&amp;nbsp; &lt;A href="https://developers.arcgis.com/javascript/jsapi/map.html#autoresize" title="https://developers.arcgis.com/javascript/jsapi/map.html#autoresize"&gt;map | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 01:51:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336535#M31095</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-09-03T01:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336536#M31096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/55033"&gt;Riyas Deen&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&amp;nbsp; According to the API Reference documentation you mention, autoResize is set to true by default.&amp;nbsp; I tried explicitly setting it as you suggested, but unfortunately, it doesn't change the behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did notice that even when I set the style width and height explicitly, it was replaced upon map creation by the default 400px when the map's container was not visible when the map was created. This is a serious problem, since calling resize() after the fact never actually resizes again, since the width and height of the container have been explicitly set (on the element itself, not using classes, ids or stylesheets) without checking if the size was already set, in fact, overwriting any explicitly set values.&amp;nbsp; Do you know what check for size or visibility the map makes in order to determine whether to set default width and height?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 17:07:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336536#M31096</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-09-03T17:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336537#M31097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at this &lt;A _jive_internal="true" href="https://community.esri.com/message/124243#124243"&gt;post&lt;/A&gt; which resizes the map whenever its div emits a resize event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's how I have it written for AMD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14097663397892651 jive_text_macro" jivemacro_uid="_14097663397892651" modifiedtitle="true"&gt;
&lt;P&gt;map.on("load", function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; registry.byId("divMap").on("resize", function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clearTimeout(resizeTimer);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resizeTimer = setTimeout(function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.resize();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.reposition();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, 500);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;})&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 17:45:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336537#M31097</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-09-03T17:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336538#M31098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the map node is being created in a dijit/layout/* node then you can listen &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;once&lt;/STRONG&gt;&lt;/SPAN&gt; to the 'resize' event so you can call map.reposition() and map.resize().&amp;nbsp; This might not help depending on the css rules so you might have to reset the node size back to 100% and then call reposition and resize.&amp;nbsp; Alternatively you could use dom-geometry.position(...) to get the current node size.&amp;nbsp; However, listening to the 'resize' event won't help if you're creating the map in just a div node as it won't have a resize event.&amp;nbsp; To find the parent dijit you can use registry.getEnclosingWidget(...) and pass in the map.root node.&amp;nbsp; This will traverse up the parent dom nodes until it finds a dijit.&amp;nbsp; Then hopefully it will be a dijit with a 'resize' event you can listen to &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;once&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:18:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336538#M31098</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2014-09-03T18:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336539#M31099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your input &lt;A href="https://community.esri.com/migrated-users/3856"&gt;Ken Buja&lt;/A&gt; and &lt;A href="https://community.esri.com/migrated-users/9440"&gt;John Grayson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're right John, I don't have a resize event to listen to.&amp;nbsp; I'm not controlling the container the other team is using at all.&amp;nbsp; From what they tell me, it is not a resize, but a (Bootstrap custom) show event.&amp;nbsp; I tried exposing the map.resize() event to them, so they could handle when they want the map to be resized, but once the map is sized (correctly or incorrectly), only an actual change in size of the containing div will allow the map.resize() to do anything, since the resize event actually checks for a change.&lt;/P&gt;&lt;P&gt;Maybe I'm looking at this wrong.&amp;nbsp; The way I see it, I either need to control when the map loads (so i need to know without relying on the library used to display the map, when it is safe to load), or have a function that the other team can call which will "reload" the map when, (they should know), it is safe to do so.&amp;nbsp; Please let me know if I'm not seeing something or looking at this completely the wrong way.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 19:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336539#M31099</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-09-03T19:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336540#M31100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct, it seems to me that the simplest solution would be to provide the other team with the function that creates the map, and they can call it when the parent container is ready in the show event.&amp;nbsp; Basically don't create the map until it can be created correctly, especially since the other team won't give you an event to listen to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 20:05:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336540#M31100</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2014-09-03T20:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336541#M31101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might be a solution.&amp;nbsp; We are also making a site with Bootstrap 3 in a MS MVC 5 template with the JS API 3.10.&amp;nbsp; We have jQuery loaded.&amp;nbsp; We also have a modal (our "disclaimer") slide down so the users have to click "Agree" to use the site. We are liking Bootstrap!&amp;nbsp; If I am understanding right, does this sound like your use case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We found this solution gave us a full screen map div. It grabs viewport width and height and sets the map div CSS to this. Plain vanilla JS could do it but jQuery makes it concise.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#disclaimer').modal('show');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resizeDiv();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onresize = function (e) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resizeDiv();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function resizeDiv() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var vpw = $(window).width();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var vph = $(window).height();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#mapDiv').css({&lt;/P&gt;
&lt;P&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;&amp;nbsp; 'height': vph + 'px',&lt;/P&gt;
&lt;P&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;&amp;nbsp; 'width': vpw + 'px'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 20:20:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336541#M31101</guid>
      <dc:creator>KevinMacLeod1</dc:creator>
      <dc:date>2014-09-03T20:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336542#M31102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.1428575515747px;"&gt;This might be a solution.&amp;nbsp; We are also making a site with Bootstrap 3 in a MS MVC 5 template with the JS API 3.10.&amp;nbsp; We have jQuery loaded.&amp;nbsp; We also have a modal (our "disclaimer") slide down so the users have to click "Agree" to use the site. We are liking Bootstrap!&amp;nbsp; If I am understanding right, does this sound like your use case?&lt;/P&gt;&lt;P style="font-size: 13.1428575515747px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.1428575515747px;"&gt;We found this solution gave us a full screen map div. It grabs viewport width and height and sets the map div CSS to this. Plain vanilla JS could do it but jQuery makes it concise.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#disclaimer').modal('show');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resizeDiv();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onresize = function (e) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resizeDiv();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function resizeDiv() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var vpw = $(window).width();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var vph = $(window).height();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#mapDiv').css({&lt;/P&gt;
&lt;P&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;&amp;nbsp; 'height': vph + 'px',&lt;/P&gt;
&lt;P&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;&amp;nbsp; 'width': vpw + 'px'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 20:21:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336542#M31102</guid>
      <dc:creator>KevinMacLeod1</dc:creator>
      <dc:date>2014-09-03T20:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336543#M31103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not that they &lt;EM&gt;won't&lt;/EM&gt; give me an event to listen to, it's that this must work 1-way.&amp;nbsp; The map component must handle its own events and expose what is necessary for the app team to handle everything else.&amp;nbsp; I've had preliminary luck with using reposition instead of resize.&amp;nbsp; If I come up with something that works, I'll post it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 20:24:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336543#M31103</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-09-03T20:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336544#M31104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response &lt;A href="https://community.esri.com/migrated-users/15368"&gt;K M&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is similar to what I wanted to do, but the map itself is in the modal.&amp;nbsp; The modal isn't shown by the time the map is created, so the map can't confirm that it has an actual screen position to draw to, this causes it to have trouble drawing itself, and it automatically resizes itself to 400px x 400px.&amp;nbsp; I'm trying to figure out from the map's point of view when it does have the ability to draw itself, or how the map can be reset (repositioned, resized, redrawn, etc) on demand, when an external library or somesuch requests it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 22:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336544#M31104</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-09-03T22:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336545#M31105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;You need to have dimension of your container div, before initializing the map. If the container div is set to display none by default, you can't get that dimensions. In that case your map will be loaded to default 400X400 px. Try setting your container div display to block before initializing the map and setting it to none again after initializing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer attached sample.&lt;/P&gt;&lt;P&gt;I'm setting a timeout of 3 second before displaying the map, to simulate your show event after the map has been initialized.&lt;/P&gt;&lt;P&gt;If you comment out line 26, &lt;STRONG&gt;domStyle.set(dojo.byId("map"), "display", "block"); &lt;/STRONG&gt;map will be @ 400 X 400 px else it'll be on whole screen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 01:08:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336545#M31105</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-09-04T01:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336546#M31106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your response, &lt;A href="https://community.esri.com/migrated-users/55033"&gt;Riyas Deen&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for clarifying when the problem occurs.&amp;nbsp; I know the problem happens when the div is not displayed at the time that the map is initialized.&amp;nbsp; I am looking for where or how this determination is made by the API so I can figure out how to either delay the map creation or resize/reposition the map once it does have displayable dimensions.&lt;/P&gt;&lt;P&gt;It would be nice if this check (for displayable dimensions) was described explicitly in the API documentation.&amp;nbsp; Also more event triggers during the map creation would make it easier to respond to certain situations.&lt;/P&gt;&lt;P&gt;For now, I will explicitly allow the map consumer to access the resize() and reposition() functions so that the app takes care of these functions, rather than the map.&amp;nbsp; If anyone has any idea how a map that doesn't control its container can still make sure it can be displayed, I would love to hear it.&amp;nbsp; Thanks for all your replies!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 16:31:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336546#M31106</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-09-04T16:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336547#M31107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any reason you can't embed your map inside a DOJO ContentPane (inside a DOJO BorderContainer) and pass the BorderContainer object reference to the other team?&lt;/P&gt;&lt;P&gt;That way, the map always has control over its container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set the BorderContainer to width/height 100%.&lt;/P&gt;&lt;P&gt;Set the region to center for your Content Pane.&lt;/P&gt;&lt;P&gt;Hook up the BorderContainer resize event to your bootstrap.show() event.&lt;/P&gt;&lt;P&gt;Map should resize based on its container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You really need to use events though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 19:42:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336547#M31107</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-09-18T19:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: What specifically do I have to wait for before initializing an esri/map so that it won't assign 400 for the width and height?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336548#M31108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/37892"&gt;Jonathan Uihlein&lt;/A&gt; Thanks for your input,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can place the map in any container I wish, but the parent container will always be a part that I don't control.&amp;nbsp; If the parent container is not visible, then any size I provide is ignored, since the map creation process inspects the actual displayed dimensions of the container, and if it is not displayed, the dimensions are 0 or undefined or NaN or something else equally unusable.&lt;/P&gt;&lt;P&gt;I was hoping that the automatic sizing of 400 x 400 could be circumvented or interrupted either by just stopping it from happening or by delaying creation/initialization of the map until it is "safe" to use the provided dimensions.&amp;nbsp; It seems that the only way to do this is with a interval that checks periodically for displayable dimensions or to use the callback that is unavailable to me from the containing application.&lt;/P&gt;&lt;P&gt;What we are doing now is allowing the application to access the resize() and reposition() functions, so that when it knows that the map is displayable, it can call these explicitly.&amp;nbsp; This exposes more of the underlying map API than we would like, but more importantly, at least it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 20:46:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-specifically-do-i-have-to-wait-for-before/m-p/336548#M31108</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-09-18T20:46:14Z</dc:date>
    </item>
  </channel>
</rss>

