Select to view content in your preferred language

TOC in 3.12

3362
3
Jump to solution
01-29-2015 09:41 AM
RichardMoussopo
Frequent Contributor

is the TOC not working anymore in 3.12 API?

<script src="http://js.arcgis.com/3.12/"></script>

      <script type="text/javascript">

        var djConfig = {

            parseOnLoad: true,

            packages: [{

                "name": "agsjs",

                "location": "http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs"

            }]

        };

    </script>

it worked for 3.11 and now in 3.12 just getting this error even if I access the file locally. the reference is set to: "agsjs/dijit/TOC"

TOC.PNG

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

This is the code that Nianwei Liu uses on their site with 3.12 API

<script type="text/javascript">
  // helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
  // http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
  var dojoConfig = { 
      paths: {
          //if you want to host on your own server, download and put in folders then use path like: 
          agsjs: location.pathname.replace(/\/[^/]+$/, '') + '/../src/agsjs' 
      }
  };
 </script>

or if you are not hosting it locally then use this:

   <script type="text/javascript">
    // helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
    // http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
    var dojoConfig = {
      paths: {
        //if you want to host on your own server, download and put in folders then use path like:
        agsjs: "http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs"
      }
    };
  </script>

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Richard,

     The TOC dijit does not come from esri and thus the error you are seeing. You are trying to load the toc from http://js.argis.com/3.12/agsjs/dijit/TOC.js and it does not exist at that location as this is a third party dijit.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

This is the code that Nianwei Liu uses on their site with 3.12 API

<script type="text/javascript">
  // helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
  // http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
  var dojoConfig = { 
      paths: {
          //if you want to host on your own server, download and put in folders then use path like: 
          agsjs: location.pathname.replace(/\/[^/]+$/, '') + '/../src/agsjs' 
      }
  };
 </script>

or if you are not hosting it locally then use this:

   <script type="text/javascript">
    // helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
    // http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
    var dojoConfig = {
      paths: {
        //if you want to host on your own server, download and put in folders then use path like:
        agsjs: "http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs"
      }
    };
  </script>
RichardMoussopo
Frequent Contributor

Got it to work,

Thank y' all

0 Kudos