Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UF - Change getFeature GET request to POST #452

Merged
merged 4 commits into from
Apr 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions addons/cadastrapp/js/selectFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,21 +277,21 @@ GEOR.Addons.Cadastre.searchUFbyParcelle= function(idParcelle, geometry){

var filterUF = '<Filter xmlns:gml="http://www.opengis.net/gml"><Contains><PropertyName>' + GEOR.Addons.Cadastre.UF.WFSLayerSetting.geometryField + '</PropertyName><gml:' + typeGeom + '>' + polygoneElements + '<gml:coordinates>' + coords + '</gml:coordinates>' + endPolygoneElements + '</gml:' + typeGeom + '></Contains></Filter>';

var postData =
'<wfs:GetFeature service="' + GEOR.Addons.Cadastre.UF.WFSLayerSetting.service + '" version="' + GEOR.Addons.Cadastre.UF.WFSLayerSetting.version + '" outputFormat="' + GEOR.Addons.Cadastre.UF.WFSLayerSetting.outputFormat + '" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">' +
'<wfs:Query typeName="' + GEOR.Addons.Cadastre.UF.WFSLayerSetting.typename + '">' +
filterUF +
'</wfs:Query>' +
'</wfs:GetFeature>';

Ext.Ajax.request({
async : false,
url : GEOR.Addons.Cadastre.UF.WFSLayerSetting.wfsUrl,
method : 'GET',
method : 'POST',
headers : {
'Content-Type' : 'application/json'
},
params : {
"request" : GEOR.Addons.Cadastre.UF.WFSLayerSetting.request,
"version" : GEOR.Addons.Cadastre.UF.WFSLayerSetting.version,
"service" : GEOR.Addons.Cadastre.UF.WFSLayerSetting.service,
"typename" : GEOR.Addons.Cadastre.UF.WFSLayerSetting.typename,
"outputFormat" : GEOR.Addons.Cadastre.UF.WFSLayerSetting.outputFormat,
"filter" : filterUF
},
params : postData,
success : function(response) {
var geojson_format = new OpenLayers.Format.GeoJSON();
var result = geojson_format.read(response.responseText);
Expand All @@ -310,7 +310,7 @@ GEOR.Addons.Cadastre.searchUFbyParcelle= function(idParcelle, geometry){
// set selected style on feature to keep style in new windows
feature.style=GEOR.Addons.Cadastre.WFSLayer.styleMap.styles.select.defaultStyle;
// Add new feature
GEOR.Addons.Cadastre.WFSLayer.addFeatures(feature);
GEOR.Addons.Cadastre.WFSLayer.addFeatures(feature);
GEOR.Addons.Cadastre.changeStateFeature(feature,index,GEOR.Addons.Cadastre.selection.state.selected);
GEOR.Addons.Cadastre.zoomOnFeatures(GEOR.Addons.Cadastre.UF.features);
}
Expand Down