AnsweredAssumed Answered

Problem with a agsjs TOC

Question asked by meyvn77 on May 21, 2013
Latest reply on Jun 25, 2013 by semcopa
This is a great widget but for some reason I am having issues getting it to display the symbols and (+/-) buttons.

When I firebug the error for symbols it says to:
Please verify the Service URL specified is correct :- http://servername:6080/arcgis/services/Parcels/MapServer
What's odd is that I never specified
       http://servername:6080/arcgis/services/Parcels/MapServer
The code for that layer is:
    
 var Parcels_Layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://servername:6080/arcgis/rest/services/Parcels/MapServer", {         id: 'Parcels_Layer'     });

The "/rest/" seems to be getting lost somehow and it can not find it.

I have no idea about the (+/-) buttons not showing up.

Here is my code... Any help would be great because I would love to use this in my applications...

<link rel="stylesheet" type="text/css" href="CSS/Style.css">      <link rel="stylesheet" type="text/css" href="CSS/Imported_CSS.css">      <link rel="stylesheet" type="text/css" href="agsjs/css/TOC.css"/>  <script type="text/javascript">      var dojoConfig = {         parseOnLoad: true,         packages: [           { "name": "esriTemplate", "location": location.pathname.replace(/\/[^/]+$/, '') },          {//name: "agsjs",               //"location": location.pathname.replace(/\/[^/]+$/,'')+'/agsjs'               "name": "agsjs",               "location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/xbuild/agsjs'           }         ]     };     </script>               <script type="text/javascript" src="//serverapi.arcgisonline.com/jsapi/arcgis/3.1"></script>




///I Get an error here Error: Tried to register widget with id==tocDiv3 but that id is already registered
The container:
      <div id ="LeftPane" dojotype="dijit.layout.ContentPane" region="left" style=" width:250px">            <div id ="tocDiv3" >            </div>      </div>


JS file:
   var Parcels_Layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://servername:6080/arcgis/rest/services/Parcels/MapServer", {         id: 'Parcels_Layer'     });         var Base_Layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://servername:6080/arcgis/rest/services/Basedata/MapServer", {         id: 'Base_Layer'     });    ///I Get an error here Error: Tried to register widget with id==tocDiv3 but that id is already registered ///This was supposed to get rid of this error but it does not?   var TOCDiv = dijit.byId('tocDiv3');     if (TOCDiv) {         TOCDiv.destroyRecursive(true);     }     dojo.connect(map, 'onLayersAddResult', function (results) {         var toc = new agsjs.dijit.TOC({             map: map,             style: "inline",             layerInfos: [{layer: Parcels_Layer,                 title: "Parcels",                 slider: true                 },                 {                     layer: Base_Layer,                     title: "Basemap Layers",                     slider: true                                                }                                 ]         }, 'tocDiv3');         toc.startup();     });

Outcomes