AnsweredAssumed Answered

ArcGIS API for JavaScript tutorial "Use an ArcGIS.com webmap" application not working

Question asked by learebs72 on Nov 26, 2017
Latest reply on Nov 27, 2017 by learebs72

I'm new to JavaScript and I'm in the process of doing the ArcGIS API for JavaScript tutorial for "Use an ArcGIS.com webmap."  I've followed the tutorial step by step and for some reason I cannot get the application to run at the midway point or at the end.  The tutorial is somewhat vague for someone new like me.  I'm not sure where my error is in the script.  I've used both the test web map provided and my own web map, neither working.  Any assistance would be greatly appreciated!

 

Below is the website link for the tutorial:

Build a web map using ArcGIS.com | Guide | ArcGIS API for JavaScript 3.22 

 

Below is the JavaScript:

 

<!DOCTYPE html>
<html>
<head>
<title>Create a Web Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.22/esri/css/esri.css">
<style>
  html,body,#mapDiv,.map.container{
    padding:0;
    margin:0;
    height:100%;
  }
  #legendDiv{
  background-color: #fff;
  position: absolute !important;
  z-index: 99;
  top:10px;
  right:20px;
}
</style>

<script>var dojoConfig = { parseOnLoad:true };</script>
<script src="https://js.arcgis.com/3.22compact/"></script>
<script>
  var map;
  require([
    "esri/map",
    "esri/arcgis/utils",
    "esri/dijit/Legend"
    "dojo/domReady!"], function(Map, argisUtils, Legend){
  arcgisUtils.createMap("84a3d030b39c4e58aaa68ee9044849f5", "mapDiv").then(function (response) {
      map = response.map;
     
      var legend = new Legend({
        map: map,
        layerInfos:(arcgisUtils.getLegendLayers(response))
        }, "legendDiv");
       
        legend.startup();
    });
</script>
</head>

<body>
  <div id="mapDiv"></div>
  <div id="legendDiv"></div>
</body>
</html>

Outcomes