AnsweredAssumed Answered

The value of the property 'require' is null

Question asked by David.Kucharski@23 on Mar 7, 2017
Latest reply on Mar 8, 2017 by David.Kucharski@23

I have created a ASP .NET Web Application. I add a new Web Form and put the following code in the aspx page. This is the example in the getting started 2d example on the ESRI web-site. When I run the application I get an error stating 'The value of the property 'require' is null or undefined., not a Function object. Am I doing something wrong or do I need something else. I thought it was a DOM object and having the <script src="https://js.arcgis.com/4.3/"></script> tag would make it accessible. Thanks

 

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Map_JavaScript_1.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Get started with MapView - Create a 2D map</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"dojo/domReady!"
], function (Map, MapView) {
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv", // Reference to the scene div created in step 5
map: map, // Reference to the map object created before the scene
zoom: 4, // Sets the zoom level based on level of detail (LOD)
center: [15, 65] // Sets the center point of view in lon/lat
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>

Outcomes