Openlayers 3 openlayers和geoserver将要素发布到postgis时出错

Openlayers 3 openlayers和geoserver将要素发布到postgis时出错,openlayers-3,Openlayers 3,我在openlayers和geoserver向postgis发布功能时发现一个错误。代码如下所示。错误在于XMLSerializer从变量“节点”转换而来的变量“数据”是错误的,其中X和Y的顺序是相反的,就像“28.795251846313476 116.4409589767456”。所以geoserver拒绝了请求,因为Y的坐标在(-90,90)之外 欢迎来到轴定向麻烦的奇妙世界。幸运的是,GeoServer为[lon,lat]顺序提供了一个替代SRS代码,即“CRS:84”而不是“EPSG:

我在openlayers和geoserver向postgis发布功能时发现一个错误。代码如下所示。错误在于XMLSerializer从变量“节点”转换而来的变量“数据”是错误的,其中X和Y的顺序是相反的,就像“28.795251846313476 116.4409589767456”。所以geoserver拒绝了请求,因为Y的坐标在(-90,90)之外


欢迎来到轴定向麻烦的奇妙世界。幸运的是,GeoServer为[lon,lat]顺序提供了一个替代SRS代码,即“CRS:84”而不是“EPSG:4326”:

var-feature=evt.feature;
var node=format.writeTransaction([feature],null,null{
G建议:{srsName:“CRS:84”},
特写:“ucoc.zhtx.com”,
特征类型:“陆块”
});             
var data=new XMLSerializer().serializeToString(节点);

问题解决了。谢谢你的大力帮助。
var feature = evt.feature;
var node = format.writeTransaction([feature], null, null, {
                gmlOptions: {srsName: "EPSG:4326"},
                featureNS: "ucoc.zhtx.com",
                featureType: "landblock"     
            });             
var data=new XMLSerializer().serializeToString(node);