Select to view content in your preferred language

Map does not display

843
2
Jump to solution
01-30-2014 05:42 AM
ShaningYu
Honored Contributor
When I switch JS API from 2.x to 3.8, the map does not display.  I checked the dojo.require items one by one and observed that
if    dojo.require("agsjs.dijit.TOC");   is added, the map panel becomes blank.
Through Fiddler2, the message obtained is  404 for Host: js.arcgis.com  URL: /3.8/js/dojo/arcgis/digit/TOC.js.
I checked http://js.arcgis.com/3.8/js does not exist.  How can TOC component be loaded in API 3.8?  Is it included already in V3.8?  Thanks.
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
The TOC widget is a separate tool. Take a look at the example page here (or here, if you like legacy mode) to see how to use it. You're going to need to include this

    <script type="text/javascript">         var djConfig = {             parseOnLoad: true,             packages: [{                 "name": "agsjs",                 //"location": location.pathname.replace(/\/[^/]+$/, "") + '/agsjs'                 "location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs' // for xdomain load             }]         };     </script>

View solution in original post

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
The TOC widget is a separate tool. Take a look at the example page here (or here, if you like legacy mode) to see how to use it. You're going to need to include this

    <script type="text/javascript">         var djConfig = {             parseOnLoad: true,             packages: [{                 "name": "agsjs",                 //"location": location.pathname.replace(/\/[^/]+$/, "") + '/agsjs'                 "location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs' // for xdomain load             }]         };     </script>
0 Kudos
ShaningYu
Honored Contributor
Ken:  Thanks for you to provide wonderful code source.  Referring to source code, I revised my script.  In works in general.  But it also generates another problem: the zoom-in / zoom-out tool on the top-left of the panel becomes disabled.  I will open another thread in minutes.  Hopefully, you can help also.
0 Kudos