<?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 ArcGIS Javascript API 4.27 and D3.js loading gives an error of multipleDefine in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-27-and-d3-js-loading-gives/m-p/1325495#M82146</link>
    <description>&lt;P&gt;I have created following sample where I am loading ArcGIS Javascript API 4.27 and D3.js (ver 7) using the Script tag.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/b2810s/pen/NWebbze" target="_blank"&gt;https://codepen.io/b2810s/pen/NWebbze&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This gives an error on the console related to multipleDefine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how to avoid the conflict of the class names between the libraries?&lt;/P&gt;&lt;P&gt;If I change the order of loading where D3.js is loaded first and then ArcGIS Javascript API 4.27.,The map is loaded successfully in that case. However, I believe it may fail in some other part of the code with D3.js.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is a best practice to write this code so it doesn't create any conflict with ArcGIS Javascript API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2023 16:59:45 GMT</pubDate>
    <dc:creator>BhavinSanghani</dc:creator>
    <dc:date>2023-09-05T16:59:45Z</dc:date>
    <item>
      <title>ArcGIS Javascript API 4.27 and D3.js loading gives an error of multipleDefine</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-27-and-d3-js-loading-gives/m-p/1325495#M82146</link>
      <description>&lt;P&gt;I have created following sample where I am loading ArcGIS Javascript API 4.27 and D3.js (ver 7) using the Script tag.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/b2810s/pen/NWebbze" target="_blank"&gt;https://codepen.io/b2810s/pen/NWebbze&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This gives an error on the console related to multipleDefine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how to avoid the conflict of the class names between the libraries?&lt;/P&gt;&lt;P&gt;If I change the order of loading where D3.js is loaded first and then ArcGIS Javascript API 4.27.,The map is loaded successfully in that case. However, I believe it may fail in some other part of the code with D3.js.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is a best practice to write this code so it doesn't create any conflict with ArcGIS Javascript API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 16:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-27-and-d3-js-loading-gives/m-p/1325495#M82146</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2023-09-05T16:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Javascript API 4.27 and D3.js loading gives an error of multipleDefine</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-27-and-d3-js-loading-gives/m-p/1325521#M82147</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Explicitly defining the paths to the esri modules prior to loading the frameworks appears to alleviate the problem.&amp;nbsp; You can do this via the global "esriConfig" property as shown below (lines 17-29, particularly line 26).&amp;nbsp; It has the same properties as &lt;A href="https://dojotoolkit.org/documentation/tutorials/1.10/dojo_config/" target="_self"&gt;dojoConfig&lt;/A&gt;...and you can even rename "esriConfig" to "dojoConfig" if you so desire; it works the same.&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
    &amp;lt;title&amp;gt;Load a basic WebMap | Sample | ArcGIS Maps SDK for JavaScript 4.26&amp;lt;/title&amp;gt;
    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }
    &amp;lt;/style&amp;gt;
    &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.27/esri/themes/light/main.css" /&amp;gt;
    &amp;lt;script type="text/javascript"&amp;gt;
      window.esriConfig = {
        async: true,
        cacheBust: "0.0.0",
        has: {},
        isDebug: true,
        locale: "en-us",
        parseOnLoad: false,
        packages: [
          {name:"esri", location:"https://js.arcgis.com/4.27/esri"}
        ]
      };
    &amp;lt;/script&amp;gt;
    &amp;lt;script src="https://cdn.jsdelivr.net/npm/d3@7"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.27/"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
      require(["esri/views/MapView", "esri/Map", "esri/request"], function (MapView, Map, esriRequest, MapImageLayer) {
        const mapService = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommunityAddressing/MapServer";
        const options = {query: {f:'json'}, responseType: 'json'};

        let mapView = null, map = null;

        esriRequest(mapService, options).then(loadMap, function(errors) {
          console.log(errors);
        });

        function loadMap(mapServiceResponse) {
          map = new Map({basemap: 'streets-vector'});

          mapView = new MapView({
            map: map,
            container: "viewDiv",
            zoom: 10,
            center: [-100, 35]
          });
        }
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 17:46:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-27-and-d3-js-loading-gives/m-p/1325521#M82147</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-09-05T17:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Javascript API 4.27 and D3.js loading gives an error of multipleDefine</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-27-and-d3-js-loading-gives/m-p/1325524#M82148</link>
      <description>&lt;P&gt;Cancel that...it actually doesn't help.&amp;nbsp; I thought it was working with the order of the script tags reversed, but I was wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 17:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-27-and-d3-js-loading-gives/m-p/1325524#M82148</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-09-05T17:47:38Z</dc:date>
    </item>
  </channel>
</rss>

