einatp

Cannot load a sub-module from Esri's dojo resources

Discussion created by einatp on Aug 28, 2011
Latest reply on Aug 30, 2011 by jgrayson-esristaff
Hi,
My web application uses esri.map and esri.tasks.locator.
Whereas esri.map is loaded easily and works fine, the esri.tasks.locator causes an error message: "esri.tasks.Locator is not a constructor" at about 80% of the time.

I have downloaded esri 2.3 API, and I use it simultaneously with dojo 1.3.2. Here is my code:
<%-- Dojo 1.6 definitions --%>
<script type="text/javascript">
 djConfig = {
  jspiHost: "${pageContext.request.serverName}:${pageContext.request.serverPort}/EsriDojo/",
  baseUrl: "/EsriDojo/",
    scopeMap: [
      ["dojo","dojo16"],
      ["dijit","dijit16"],
      ["dojox","dojox16"],
    ],
    modulePaths: {
     "esri": "/EsriDojo/js/esri",         //this works great. I can call and initiate the map
     "esri.tasks" : "/EsriDojo/js/esri/tasks"     //this rarely works
    }
  };
</script>
<%-- Loading dojo 1.6 --%>
<script type="text/javascript" src="/EsriDojo/"></script>
<%-- Setting original dojo definitions back --%>
<script type="text/javascript">
 djConfig = dojo.config;
 dojo.registerModulePath("myCode","MyApp/js/myCode");  //my code. Works well too
</script>


I think the reason for this is a sub-module paths issue on dojo1.6 described here, yet I'm not sure because the suggested work-around doesn't work in my environment.

What do you think? Have you ever encountered such a problem?
I'd appreciate your help on that!

Outcomes