<?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 'multipleDefine' error when attempting to add ArcGISImageServiceLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/multipledefine-error-when-attempting-to-add/m-p/1065241#M73398</link>
    <description>&lt;P&gt;This error is becoming a major problem and I am completely mystified on what to do about it. I already addressed the issue with the arcgis javascript loading before the JQuery libraries, so I know this is not the issue. The error pops up this time when I try and load a&amp;nbsp;ArcGISImageServiceLayer from a REST service. This should be very simple, I have NOT defined anything twice. The error gives no information, so I narrowed the suspect code down by simply commenting out code until I could be sure of the exact code block that is throwing the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;mo._addBioVolumeLayer = function(year, map) {
    console.log("map ", map);
    let bioLyr = map.getLayer("Bio Volume Fisheries");
    console.log("bioLyr ", bioLyr);
    if (bioLyr) {
        map.removeLayer(bioLyr);
    }
    console.log("adding bio-volume data to map for year ", year);
    let Url = "https://MyDomain...._BioVolume" + year + "/ImageServer";     
    let bioVolume = new ArcGISImageServiceLayer(Url, {
      id: "Bio Volume Fisheries",
      opacity: 0
    }); 
    map.addLayer(bioVolume, 1);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="multipleDefineError.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15213i25378683B9CBA391/image-size/medium?v=v2&amp;amp;px=400" role="button" title="multipleDefineError.png" alt="multipleDefineError.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't know what to look for under 'info' to give me a clue where to look to fix the error. In the code above, if I comment out where I define 'bioVolume' I don't get an error. Also, I am loading a Graphics layer in the same .js file without issue.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jun 2021 18:21:04 GMT</pubDate>
    <dc:creator>FranklinAlexander</dc:creator>
    <dc:date>2021-06-04T18:21:04Z</dc:date>
    <item>
      <title>'multipleDefine' error when attempting to add ArcGISImageServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/multipledefine-error-when-attempting-to-add/m-p/1065241#M73398</link>
      <description>&lt;P&gt;This error is becoming a major problem and I am completely mystified on what to do about it. I already addressed the issue with the arcgis javascript loading before the JQuery libraries, so I know this is not the issue. The error pops up this time when I try and load a&amp;nbsp;ArcGISImageServiceLayer from a REST service. This should be very simple, I have NOT defined anything twice. The error gives no information, so I narrowed the suspect code down by simply commenting out code until I could be sure of the exact code block that is throwing the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;mo._addBioVolumeLayer = function(year, map) {
    console.log("map ", map);
    let bioLyr = map.getLayer("Bio Volume Fisheries");
    console.log("bioLyr ", bioLyr);
    if (bioLyr) {
        map.removeLayer(bioLyr);
    }
    console.log("adding bio-volume data to map for year ", year);
    let Url = "https://MyDomain...._BioVolume" + year + "/ImageServer";     
    let bioVolume = new ArcGISImageServiceLayer(Url, {
      id: "Bio Volume Fisheries",
      opacity: 0
    }); 
    map.addLayer(bioVolume, 1);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="multipleDefineError.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15213i25378683B9CBA391/image-size/medium?v=v2&amp;amp;px=400" role="button" title="multipleDefineError.png" alt="multipleDefineError.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't know what to look for under 'info' to give me a clue where to look to fix the error. In the code above, if I comment out where I define 'bioVolume' I don't get an error. Also, I am loading a Graphics layer in the same .js file without issue.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 18:21:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/multipledefine-error-when-attempting-to-add/m-p/1065241#M73398</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2021-06-04T18:21:04Z</dc:date>
    </item>
  </channel>
</rss>

