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"
Solved! Go to Solution.
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>
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.
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>
Got it to work,
Thank y' all