내 응용 프로그램에 편집 가능한 기능 레이어가 2 개 있으며 사용자가 편집하려는 기능 레이어에 따라 적절한 속성 관리자를 연결하려고합니다.2 개의 AttributeInspector에 대해 동일한 InfoWindow 사용하기
응용 프로그램을로드 할 때 두 기능 레이어에 대한 속성 검사기를 만든 다음 사용자가 기능 레이어를 편집하려고 할 때 적절한 특성 검사기를지도의 InfoWindow에 연결합니다.
사용자가 다른 기능 레이어를 편집하려고 시도 할 때까지 모든 것이 잘 작동합니다. infowindow에 다른 속성 검사기를 연결하려고하면 빈 화면이 나타납니다.
는 여기에 내가 뭘하는지 대략의 : 사전에
// AttributeEditor1 for FeatureLayer1 in Class1
constructor: function(options) {
this.options = lang.mixin(this.options, options);
this.map = options.map;
this.configureAttributeEditor1();
},
configureAttributeEditor1: function() {
this.attributeEditor1 = new AttributeInspector({
layerInfos: layerInfos
}, domConstruct.create("div"));
// here I add a Save and Delete button and various event handlers
this.attributeEditor1.startup();
},
// I call this when I know that the user wants to edit FeatureLayer 1
attachEditor1: function() {
this.map.infoWindow.setContent(this.attributeEditor1.domNode);
this.map.infoWindow.resize(350, 240);
},
// AttributeEditor2 for FeatureLayer2 in Class2
constructor: function(options) {
this.options = lang.mixin(this.options, options);
this.map = options.map;
this.configureAttributeEditor2();
},
configureAttributeEditor2: function() {
this.attributeEditor2 = new AttributeInspector({
layerInfos: layerInfos
}, domConstruct.create("div"));
// here I add a Save and Delete button and various event handlers
this.attributeEditor2.startup();
},
// I call this when I know that the user wants to edit FeatureLayer 2
attachEditor2: function() {
this.map.infoWindow.setContent(this.attributeEditor2.domNode);
this.map.infoWindow.resize(350, 240);
},
감사합니다.
AttributeEditor1이 작동하고 AttributeEditor2가 작동하지 않는다는 것을 의미합니까? –
AttributeEditor1은 맵의 InfoWindow 내용을 AttributeEditor2로 바꾸기 전까지 작동합니다. 그런 다음 InfoEditor1을 다시 InfoWindow에 추가하려고하면 빈 상태가됩니다. – awm