点数据集服务 新建属性信息 ,传参数就报错 求帮忙!!!
var featureService = L.supermap.featureService(url);
//alert("featureService:"+featureService);
//制作feature
var geometry = new SuperMap.Geometry.Point(longitude,latitude);
var style = {
strokeColor:"#339933",
strokeOpacity:1,
strokeWidth:3,
pointRadius:6
};
var attr = {
// fieldNames: ['BH','MC','X','Y'],
// fieldValues: ['111111',namea,longitude,latitude],
fieldNames: ['MC'],
fieldValues: ['aa'],
geometry:geometry
};
alert("longitude:"+longitude+"----latitude:"+latitude);
var pointFeature = new SuperMap.Feature.Vector(geometry,attr,style);
//设置地物编辑字段参数
var addFeatureParams = new SuperMap.EditFeaturesParameters({
dataSourceName: "sqlsource",
dataSetName: "LDG_PT",
features: [attr],
editType: SuperMap.REST.EditType.ADD,
returnContent: true
});
//使用地物编辑服务向服务端发送请求并获取数据
featureService.editFeatures(addFeatureParams, function (serviceResult) {
// 获取返回数据
debugger;
var result = serviceResult.result;
alert("serviceResult:"+result);
});