Select to view content in your preferred language

multipleDefine error - related to BasemapGallery?

903
1
04-17-2014 01:51 PM
DorothyMortenson
Deactivated User
I have been trying to track down a "multipleDefine" error.

In Chrome, I get this message:
[ATTACH=CONFIG]33181[/ATTACH]


in IE, I get this message:
[ATTACH=CONFIG]33182[/ATTACH]

So it would appear there is something to do with the BasemapGallery  or something to do with the script I'm loading for esri.  But who knows.

The scripts I have loaded in my html are as follows (added at the end of the html):

</div>  <!-- End Bottom Panel -->
</body>
</html>

<!-- JAVASCRIPTS ============================================================= -->

<script type="text/javascript" src="https://js.arcgis.com/3.8/"></script> 

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>

<script type="text/javascript" src="js/lib/modernizr.custom.js" defer></script> 
<script type="text/javascript" src="js/lib/numeral.min.js" defer></script> 

<script type="text/javascript" src="elements/search_wr.js"></script>
<script type="text/javascript" src="elements/search_latlong.js"></script>
<script type="text/javascript" src="elements/search_trsqq.js"></script>
<script type="text/javascript" src="elements/clear.js"></script>
<script type="text/javascript" src="elements/print.js"></script>

<script type="text/javascript" src="js/map_content.js"></script>
<script type="text/javascript" src="js/identify_by_json.js"></script>
<script type="text/javascript" src="js/identify_taxlot.js"></script>

<script type="text/javascript" src="js/search_wr_trs_ll.js"></script> 
<script type="text/javascript" src="js/wr_time_slider_direct.js"></script>
<script type="text/javascript" src="js/wm_themeon.js"></script>


As you can see, this application has a lot going on and there are several .js files.
But only one uses the basemapGallery.

Other than the one place in the require statement, this is how the basemapGallery is called:

 // Basemap Gallery

var basemapGallery = new BasemapGallery({
        showArcGISBasemaps: true,
        map: map
   }, "basemapGallery");
   basemapGallery.startup();



On top of this issue, I am having the issue of the basemap not always displaying. If I refresh my application several times in a row, about every 5th one will stop drawing the basemap - it'll just be white. But if I zoom a little, the basemap shows up.  Maybe it's related, maybe not. 

Any ideas?
Thank you.

Dorothy
0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: dmortenson

Well I found the issue.

I was using numeral.js

For some reason, it didn't like that library with the others I was using.  I use using numeral.js to put commas in long numbers.

I was able to replace this with .toLocaleString()
very simple.

But trying to debug this was a wild goose chase. My strategy to solve it was to take out libraries one at a time to see which one had the issue.

Dorothy
0 Kudos