var accordion = dijit.byId("myAccordionContainer"); dojo.connect(accordion, "selectChild", function(childPane) { if(childPane.id === "paneEditor"){ if(!editorWidget){ var featureLayerInfos = dojo.map(results, function(result) { return {'featureLayer':result.layer}; }); var layers = dojo.map(results,function(result) { return result.layer; }); var settings = { map: map, geometryService: new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer"), layerInfos:featureLayerInfos }; var params = {settings: settings}; editorWidget = new esri.dijit.editing.Editor(params,'editorDiv'); editorWidget.startup(); } } });
Rob,It looks like the accordion pane you want to display the editor on is not visible when the application first loads. In cases like this you can create the editor widget the first time you show the editor panel, here's a snippet that shows this: var accordion = dijit.byId("myAccordionContainer"); dojo.connect(accordion, "selectChild", function(childPane) { if(childPane.id === "paneEditor"){ if(!editorWidget){ var featureLayerInfos = dojo.map(results, function(result) { return {'featureLayer':result.layer}; }); var layers = dojo.map(results,function(result) { return result.layer; }); var settings = { map: map, geometryService: new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer"), layerInfos:featureLayerInfos }; var params = {settings: settings}; editorWidget = new esri.dijit.editing.Editor(params,'editorDiv'); editorWidget.startup(); } } });
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.