Select to view content in your preferred language

error loading custom modules using CDN

1429
2
Jump to solution
02-24-2016 11:42 AM
PaulSmock
Deactivated User

I have seen a few posts out there for this and I have tried everything that has been posted. I am using ASP.Net MVC 4 and am trying to get a custom module loaded. Each attempt has given me the same error...GET http://js.arcgis.com/3.15/myModules.custommenu.js.

I have a js file called custommenu.js located in /Scripts folder. Here is the code for the page...(all other javascript, JQuery etc are loaded in the layout).

<link rel="stylesheet" href="https://js.arcgis.com/3.15/dijit/themes/claro/claro.css">

<link rel="stylesheet" href="https://js.arcgis.com/3.15/esri/css/esri.css">

<h2>Map</h2>

<script type="text/javascript">

    @*var baseUrl = @Html.ResolveServerUrl("~Scripts");*@

    var dojoConfig = {

        parseOnLoad: true,       

        packages: [{

            "name": "myModules",

            "location": location.pathname.replace(/\/[^/]+$/, '') + '/Scripts'

        }]

    };

</script>

<script src="https://js.arcgis.com/3.15/"></script>

<script type="text/javascript">

    var map;

    require(["esri/map", "dojo/domReady!", "myModules.custommenu"], function (Map) {

        map = new Map("mapDiv", {

            center: [-56.049, 38.485],

            zoom: 3,

            basemap: "streets"

        });

    });

</script>

<div class="claro">

    <div id="mapDiv"></div>

</div>

I am new to arcgis and ESRI and am just trying to get a simple example working and am unable to...

Thanks in advance for any help.

0 Kudos
1 Solution

Accepted Solutions
thejuskambi
Frequent Contributor

Try changing "myModules.custommenu" to "myModules/custommenu"

View solution in original post

2 Replies
thejuskambi
Frequent Contributor

Try changing "myModules.custommenu" to "myModules/custommenu"

PaulSmock
Deactivated User

Thanks....funny how when you are just starting with this stuff, you miss the smallest of details. I have an app developed a few years ago that I am trying to update all of the javascript and take it to MVC and the map is giving me hell. Ugrading arcGIS javascript from 2.8 to 3.15. You'll probably be seeing me quite a bit in here...LOL.

0 Kudos