ok i think you are skipping alot of stepsyou need to download the agsjs packagein your project you should have (at least) the agsjs folderthe TOC.js filethe css/TOC.cssthe templates/tocNode.html and templates/tocNode_files/${_blankGif}plus you need to add the agsjs to the packages of your dojoConfig
did you download and add the TOC.js folder and files to your project?
you have extra /section tags(line 327)
actually you (at a minimum) have the same problem as the person above yourequire([ "esri/map", "esri/config", "esri/dijit/HomeButton", "esri/dijit/BasemapGallery", "esri/arcgis/utils", "esri/dijit/Scalebar", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/tasks/Geoprocessor", "esri/tasks/FeatureSet", "esri/toolbars/draw", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/renderers/ClassBreaksRenderer", "esri/graphic", "dojo/_base/Color", "agsjs/dijit/TOC", "dojo/dom", "dojo/dom-style", "dojo/query", "dojo/parser", "dojo/on", "dojo/_base/connect", "dijit/registry", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "dijit/TitlePane", "dijit/form/CheckBox", "dijit/form/ComboBox", "dojo/parser", "dijit/Toolbar", "dijit/form/DropDownButton", "dijit/form/TextBox", "dojo/domReady!" ], function( Map, esriConfig, HomeButton, BasemapGallery, arcgisUtils, Scalebar, ArcGISDynamicMapServiceLayer, Legend, Geoprocessor, FeatureSet, Draw, SimpleFillSymbol, SimpleLineSymbol, Graphic, Color, ClassBreaksRenderer, TOC, dom, domStyle, query, parser, connect, on, registry ) {These are out of sync with each other. they have to match PERFECTLY, in order.SO you added the "Legend" to the function, but not to the require.So Geoprocessor is being aliased "Legend". FeatureSet is now "Geoprocessor" etc....
require([ "esri/map", "esri/config", "esri/dijit/HomeButton", "esri/dijit/BasemapGallery", "esri/arcgis/utils", "esri/dijit/Scalebar", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/tasks/Geoprocessor", "esri/tasks/FeatureSet", "esri/toolbars/draw", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/renderers/ClassBreaksRenderer", "esri/graphic", "dojo/_base/Color", "agsjs/dijit/TOC", "dojo/dom", "dojo/dom-style", "dojo/query", "dojo/parser", "dojo/on", "dojo/_base/connect", "dijit/registry", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "dijit/TitlePane", "dijit/form/CheckBox", "dijit/form/ComboBox", "dojo/parser", "dijit/Toolbar", "dijit/form/DropDownButton", "dijit/form/TextBox", "dojo/domReady!" ], function( Map, esriConfig, HomeButton, BasemapGallery, arcgisUtils, Scalebar, ArcGISDynamicMapServiceLayer, Legend, Geoprocessor, FeatureSet, Draw, SimpleFillSymbol, SimpleLineSymbol, Graphic, Color, ClassBreaksRenderer, TOC, dom, domStyle, query, parser, connect, on, registry ) {
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.