Solved! Go to Solution.
var queryTask; function init() { //build query queryTask = new esri.tasks.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"); //dojo.connect(queryTask, "onComplete", showResults);
var queryTask; queryTask = new esri.tasks.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"); function init() { //build query dojo.connect(queryTask, "onComplete", showResults);
Basically, do not reference anything in the esri namespace until all modules are loaded. Which means waiting dojo.addOnLoad or dojo.ready to fire.
<script type="text/javascript" src="js/heatlayer.js"></script>
dojo.declare("HeatmapLayer", [esri.layers.DynamicMapServiceLayer], {
How would we handle this in the case of a custom module which internally references the esri namespace?
It looks like scopemap won't work anymore, but according to Dojo docs you should be able to load custom namespaces for different dojo libraries to work with packages you define. Granted, I have not tried this, but could be worth investigating if you need to maintain some legacy compatibility.
http://dojotoolkit.org/reference-guide/1.7/loader/amd.html#relocating-module-namespaces