ArcGIS Maps SDK for JavaScript Sample Code Facing Issue

248
2
05-30-2023 03:03 AM
sajalpal
New Contributor

We are trying to implement the map in our application(Asp.net core 5) with your latest JS library ("https://js.arcgis.com/4.26/"). But every time we are facing an issue with this library getting the below errors.
1. (index):31 Error: multipleDefine
2. Uncaught TypeError: KMLLayer is not a constructor

For Reference, we are using the code from the below sandbox
SANDBOX LINK: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=layers-kml

ESRI_Screenshot 2023-05-30 153125.png

0 Kudos
2 Replies
GavinBoyd
New Contributor II

Hi @sajalpal did you find a solution to this. I am facing the same issue with a Asp.net core project. My ArcGIS code works with sdk 4.15 but as soon as i reference any sdk above 4.15 it returns the ...not a constructor error. It is as if it does not read the require tags

0 Kudos
GavinBoyd
New Contributor II

@sajalpal In case you haven't already found a solution:

I had a hunch that this had something to do with my page/view references conflicting js. By doing the following, sdk 4.27 is now working.

The way I got around was to comment out this section of the shared Asp.net Core App _layout.cshtml view

<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)

As it appears to conflict with any arcgis sdk of higher than 4.15. My app is now displaying sdk 4.27 without the 'not a constructor' error

0 Kudos