Skip to content

Commit

Permalink
Generate JSON geometry param name from map SRS (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
fergaldoyle committed Jan 8, 2024
1 parent f42b509 commit 007aae9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/controller/button/DigitizeButtonController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
},
Expand Down

0 comments on commit 007aae9

Please sign in to comment.