我是web端 iclient for openlayers ,
在地图上进行draw绘面, 然后保存为 polygon 的feature一个矢量元素,
然后 将该矢量元素调用 EditFeaturesParameters 方法 获取到 数据集修改添加所需要的 参数类,
在调用 editFeatures 该方法 进行保存, 这个方法就一直报错, 不是404 就是 500 的 ,不知道是什么问题,
下面是我的代码,求大佬看看哪有问题了
//进行绘画的代码
draw = new ol.interaction.Draw({
source: addPointsSource,
type: 'Polygon',
snapTolerance: 20,
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#00FECD',
width: 3,
}),
fill: new ol.style.Fill({
color: 'rgba(0, 290, 195, 0.8)'
})
})
});
map.addInteraction(draw);
draw.on('drawend', function (e) {
let range = e.target.sketchCoords_[0]; //图形范围
let geomOne = new ol.geom.Polygon([range])
pointFeature = new ol.Feature({
geometry: geomOne,
});
addPointsSource.addFeature(pointFeature);
})
// 进行提交
function commitMark() {
clearInteraction();
var addFeatureParams = new SuperMap.EditFeaturesParameters({
features: pointFeature,
dataSourceName: "build",
dataSetName: "build",
editType: "add",
returnContent: true
});
console.log(addFeatureParams);
editFeaturesService.editFeatures(addFeatureParams, function (serviceResult) {
console.log(serviceResult);
});
}
求大佬解救一下孩子