AnsweredAssumed Answered

Using AMD, connect throws an error.

Question asked by nobleach on Apr 23, 2013
Latest reply on Jun 25, 2013 by kenbuja
I'm attempting to connect to the map's onLoad event:

var map;       require(["esri/map", "esri/SpatialReference", "esri/geometry/Extent", "dojo/_base/connect", "app/populate", "dojo/ready"],         function(Map, SpatialReference, Extent, connect, populate, ready) {           ready(function() {             var initialExtent = new Extent({               xmax: -11241653.995873693,               xmin: -13198441.919973679,               ymax: 5178320.359930991,               ymin: 4453085.835561435,               "spatialReference": {                 "wkid": 102100               }});              map = new Map("mapDiv", {               extent: initialExtent,               basemap: "streets"             });              connect(map, "onLoad", function() {               populate.addPoints();             });           });        });   }


No matter what, I keep getting a JS error:

Uncaught TypeError: Object is not a function. 


I've tried replacing the call to populate.addPoints() with a simple console.log, and still, it errors on "connect". That's a pretty basic Dojo thing, so I'm confused about where the problem is. The examples page shows something nearly identical.

Outcomes