From 007aae911196c0b42bd5ddd7b9c3aba69cef5a14 Mon Sep 17 00:00:00 2001 From: fergaldoyle Date: Mon, 8 Jan 2024 06:58:30 +0000 Subject: [PATCH] Generate JSON geometry param name from map SRS (#676) --- app/controller/button/DigitizeButtonController.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controller/button/DigitizeButtonController.js b/app/controller/button/DigitizeButtonController.js index b070548e..2b28ce40 100644 --- a/app/controller/button/DigitizeButtonController.js +++ b/app/controller/button/DigitizeButtonController.js @@ -814,13 +814,14 @@ Ext.define('CpsiMapview.controller.button.DigitizeButtonController', { */ getNetByPolygon: function (feat) { var me = this; + var srs = me.map.getView().getProjection().getCode(); var format = new ol.format.GeoJSON({ - dataProjection: me.map.getView().getProjection().getCode() + dataProjection: srs }); var geoJson = format.writeFeature(feat); - var jsonParams = { - geometry3857: Ext.JSON.decode(geoJson).geometry - }; + var jsonParams = {}; + var geometryParamName = 'geometry' + srs.replace('EPSG:', ''); + jsonParams[geometryParamName] = Ext.JSON.decode(geoJson).geometry; return me.doAjaxRequest(jsonParams) .then(me.parseNetsolverResponse.bind(me)); },