From 7ca4cdc21e4844996da111b7d11437c978d2b1ce Mon Sep 17 00:00:00 2001 From: DESPRES Damien <ddespres@neogeo.fr> Date: Fri, 24 Sep 2021 11:16:51 +0200 Subject: [PATCH] fix #11736 --- src/views/feature/Feature_edit.vue | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/views/feature/Feature_edit.vue b/src/views/feature/Feature_edit.vue index 93afdda5..900bb1b0 100644 --- a/src/views/feature/Feature_edit.vue +++ b/src/views/feature/Feature_edit.vue @@ -430,12 +430,30 @@ export default { "Content-Type": "multipart/form-data", }, }) - .then(function () { - console.log("SUCCESS!!"); + .then(function (response) { + console.log("SUCCESS!!",response.data); + if(response.data.geom.indexOf('POINT')>=0){ + let regexp=/POINT\s\((.*)\s(.*)\)/; + var arr = regexp.exec(response.data.geom); + + let json={ "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [arr[1], arr[2]] + }, + "properties": { + } + }; + self.updateMap(self.map, json) + self.updateGeomField(json) + // Set Attachment + //self.addAttachment(self.file) + } + }) - .catch(function () { + .catch(function (response) { console.log("FAILURE!!"); - self.erreurUploadMessage = "FAILURE!!"; + self.erreurUploadMessage = response.data.message; }); }, -- GitLab