Thank you, Matt, I may use this to set up my accordion panes when I get to that point.Currently, I think my main issue is figuring out how to call individual layers within my map, which was set up through ArcGIS online. The first three layers in my map are all tiled services, and seem to have easy to understand ID numbers: 1, 2, and 3. I also can get the basemap added to my legend by using the ID 0 (zero). After that, everything I try is coming up as undefined. Any idea why this may be? Are feature services ID numbers set up differently than other services?Please let me know if this should be posted in another forum, or anything.Thanks again,-Arty
var legendDijit = new agsjs.dijit.TOC({//NL: new esri.dijit.Legend({ map: map, layerInfos: [{ layer: map.getLayer(map.layerIds[1]), slider: true }, { layer: map.getLayer(map.layerIds[2]), slider: true }, { layer: map.getLayer(map.layerIds[3]), slider: true }, { layer: map.getLayer(map.layerIds[4]), slider: true }] }, dojo.create('div')); dojo.byId('legendPanel').appendChild(legendDijit.domNode);
//changes to the djC var dojoConfig = { parseOnLoad: true, packages: [{ "name": "agsjs", "location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/xbuild/agsjs' }] }; //add the require statements in the section of the JS script/file dojo.require("dojo.fx"); dojo.require("agsjs.dijit.TOC"); //create code to set up your legenLayerInfos //..this part is up to you on how you do this var layerInfos = []; //TODO: you need to add an array that looks something like this .. note this is only an example of one layerInfo object that the legend expects var layerInfo = { "layer": fcMapLayer.layerObject, "title": mapLayer.title, "defaultSymbol": false }; layerInfos.push(layerInfo); //create the legend object var legendDijit = new agsjs.dijit.TOC({//NL: new esri.dijit.Legend({ map: map, layerInfos: layerInfo }, dojo.create('div'));
Is it possible to make the above legend/TOC work with a map that is using JSAPI 3.3? I have everything else I need working but it uses the JSAPI 3.3. Thanks,Court
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dijit/themes/soria/soria.css"/> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dojox/grid/resources/Grid.css"> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dojox/grid/resources/SoriaGrid.css"> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dojox/layout/resources/FloatingPane.css"/> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dojox/layout/resources/ResizeHandle.css"/> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css" /> <link rel="stylesheet" href="css/defaultStyle.css"/> <script> var dojoConfig = { parseOnLoad: true, packages: [ { "name": "agsjs", "location": location.pathname.replace(/\/[^/]+$/, "")+'/lib/agsjs/Build_2_04' }] }; </script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3"></script>
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.