GeoExt 1.1에서 OL 2.11을 사용하고 있습니다. 이 GeoExt 예제를 테스트하고 수정 한 후 : http://geoext.org/lib/GeoExt/widgets/form/FormPanel.html, 나는 새로운 프로토콜을 파괴하고 읽는 데 문제가있었습니다. 방화 광에서 "TypeError : this.options가 null HTTP.js (180 행)"가됩니다. 180 번 줄에서 이해할 수있는 것은 새로운 프로토콜의 새로운 옵션이 없다는 것입니다. 이것이 문제인지 해결할 수 있을지는 확실하지 않습니다. 내가 제거 할 경우OpenLayers.Protocol.HTTP에서 "TypeError : this.options is null"
buttons: [{
text: 'Search',
handler: function() {
comboLayer = Ext.getCmp('idcombo').getValue();
keyword = Ext.getCmp('idtextfield').getRawValue();
protocol.destroy();
protocol = new OpenLayers.Protocol.HTTP({
url: '/fs/' + comboLayer + '?format=GeoJSON&comments__ilike=' + keyword + '&queryable=comments',
format: new OpenLayers.Format.GeoJSON({
ignoreExtraDims: true,
'internalProjection': new OpenLayers.Projection('EPSG:900913'),
'externalProjection': new OpenLayers.Projection('EPSG:4326')
})
});
protocol.read();
formPanel.search();
}
}]
"프로토콜 : 이것은 새로운 프로토콜이 생성 된은 FormPanel의 끝 부분에있는 코드가
protocol = new OpenLayers.Protocol.HTTP({
url: '/fs/',
format: new OpenLayers.Format.GeoJSON({
ignoreExtraDims: true,
'internalProjection': new OpenLayers.Projection('EPSG:900913'),
'externalProjection': new OpenLayers.Projection('EPSG:4326')
})
});
입니다 : 이것은합니다 (은 FormPanel 외부에서 만든) 원래 프로토콜입니다 .destroy(); ", 원래의 프로토콜과 새로운 프로토콜이 모두 전송되지만, 항상 원래의 프로토콜이 새로운 프로토콜로 전송됩니다. 요청이 AJAX이기 때문에 발생합니다. 원본 이후에 새로운 것을 보낼 수 있습니까?
내가 미리 감사를이에 대한 몇 가지 지원을 감사하겠습니다,