TOC widget  with Arcgis api for javascript

264
2
04-06-2014 11:12 PM
GauriDeshmukh
New Contributor III
I downloaded the TOC widget from here
when I open toc.html from examples folder i dont see any map or TOC widget.

I need to know that what is the correct path or location for agsjs folder in

dojoConfig{
"location": location.pathname.replace(/\/[^/]+$/, "")+'build/agsjs'      ????
  }
Please tell me the correct method where to keep the agsjs folder and which agsjs folder should i use(from src or build)

getting an error like
NS_ERROR_DOM_BAD_URI: Access to restricted URI denied
or
NetworkError: 404 Not Found
0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
Where you have the "agsjs" directory versus the html file?

For example, I have this setup

[ATTACH=CONFIG]32869[/ATTACH]

and in the html file I'm running (TOC_hide_node.html), I set the path to the TOC like this

    <script>
        var dojoConfig = {
            packages: [
                {
                    name: "agsjs",
                    location: location.pathname.replace(/\/[^/]+$/, "") + '../../agsjs'
                }]
        };
    </script>
0 Kudos
GauriDeshmukh
New Contributor III
I placed the complete folder on my local webserver and used the path for agsjs folder in pathname.
Now its working but is this a correct way for using toc.
I wanted to keep this folder in my project folder.
0 Kudos