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.
Solved! Go to Solution.
Try changing "myModules.custommenu" to "myModules/custommenu"
Try changing "myModules.custommenu" to "myModules/custommenu"
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.