<?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: [JS API 4.x] SPA with multiple map configurations in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-x-spa-with-multiple-map-configurations/m-p/719417#M66776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Sebastian,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; It sounds like a bug needs to be reported about the LayerList widgets error. Switching the map is a valid workflow and esri even has a sample for this. So I would say your workflow is fine and there is just a bug you have to work around. You may need to destroy and recreate the LayerList widget each map switch until the bug is fixed.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 May 2018 13:06:38 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2018-05-17T13:06:38Z</dc:date>
    <item>
      <title>[JS API 4.x] SPA with multiple map configurations</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-x-spa-with-multiple-map-configurations/m-p/719416#M66775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are currently developing a GIS-SPA, in which the user should be able to choose between several map configurations, lets call them "map modes". These&amp;nbsp;map modes will&amp;nbsp;present&amp;nbsp;different map layers from different sources, render different tools available etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user should be able to go back and forth between these map modes, keeping&amp;nbsp;the state of some mapView-properties like extent, scale etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our initial idea was to always work with a single instance of the MapView, while having several instances of the Map-class. When the user would switch to a different map&amp;nbsp;mode, we simple&amp;nbsp;replace the instance of the Map with the one corresponding to the current map mode, informing out MapView of this new Map it should be viewing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We also have a single instance of LayerList, connected to our one MapView-instance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Switching "map mode" was working just fine in 4.6, the MapView loaded the new map config and the LayerList was automatically updated. After updating to 4.7, the MapView seems to be loading the new map config correctly, but the LayerList produces a DOM-exception: 'Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, after reading "&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;A Map object should be created prior to a view so it can be passed into the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;map&lt;/CODE&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;property of that view...&lt;/SPAN&gt;" in the API Reference, it got me thinking that maybe we are going about this map mode handling the wrong way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would we perhaps be better off creating a sort of bundle for the Map and MapView, keeping a one-to-one relation for these entities, for each of our map modes? Would this in turn also call for having multiple instances of the LayerList?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 08:19:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-x-spa-with-multiple-map-configurations/m-p/719416#M66775</guid>
      <dc:creator>SebastianKvist</dc:creator>
      <dc:date>2018-05-17T08:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: [JS API 4.x] SPA with multiple map configurations</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-x-spa-with-multiple-map-configurations/m-p/719417#M66776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Sebastian,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; It sounds like a bug needs to be reported about the LayerList widgets error. Switching the map is a valid workflow and esri even has a sample for this. So I would say your workflow is fine and there is just a bug you have to work around. You may need to destroy and recreate the LayerList widget each map switch until the bug is fixed.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 13:06:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-x-spa-with-multiple-map-configurations/m-p/719417#M66776</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-05-17T13:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: [JS API 4.x] SPA with multiple map configurations</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-x-spa-with-multiple-map-configurations/m-p/719418#M66777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer. Yes,&amp;nbsp;I imagined the possibility of it being a bug - however I noticed we actually recreate some widgets when the map changed, which in fact seem to have triggered this error. The error mentioned above would present itself when I recreated the Print widget, rather than the LayerList widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, the key question here was regarding the ability to reuse the MapView instance and then in turn reuse widget instances depending on the same MapView. I feel I have gotten the answer to that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 13:16:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-x-spa-with-multiple-map-configurations/m-p/719418#M66777</guid>
      <dc:creator>SebastianKvist</dc:creator>
      <dc:date>2018-05-17T13:16:43Z</dc:date>
    </item>
  </channel>
</rss>

