deoserver中PointOutsideEnvelopeException

openlayers 编辑要素并保存至deoserver中PointOutsideEnvelopeException: 1 outside of (-90.0,90)问题:

  • 保存时需要把经纬度给调换下
var feature=e.feature;
    console.log(feature)
    var geometry = feature.getGeometry().clone();
    geometry.applyTransform(function(flatCoordinates, flatCoordinates2, stride) {
      for (var j = 0; j < flatCoordinates.length; j += stride) {
        var y = flatCoordinates[j];
        var x = flatCoordinates[j + 1];
        flatCoordinates[j] = x;
        flatCoordinates[j + 1] = y;
      }
    });
    var newFeature = new Feature();
    newFeature.setId(newId);
    newFeature.setGeometryName('the_geom');
    // newFeature.set('the_geom', null);
    newFeature.set('name', 'test');
    newFeature.set('adcode', 110);
    newFeature.set('childrenNu', 0);
    newFeature.set('level', '');
    newFeature.set('district', '');
    newFeature.set('subFeature', 4);
    // 添加图形
    newFeature.setGeometry(new MultiPolygon([geometry.getCoordinates()]));

推荐阅读更多精彩内容