我想使用Google Map Engine API的batchInsert。我用dojo / request来称呼它。
调用批处理插入的代码如下:
request("https://www.googleapis.com/mapsengine/v1/tables/1453899488279955151311853667273131550346/features/batchInsert",
{
headers : {
"Authorization": 'Bearer '+ token.access_token,
"Access-Control-Allow-Origin" : null,
"X-Requested-With": null,
"Content-Type": "application/json"
},
handleAs : 'json',
method : 'POST',
data :datastring
}
).then(function(data){
console.log("Got data :"+data);
}, function(err){
console.log("Got error :"+err.response.text);
}, function(evt){
console.log("Got Event :"+evt);
});
要求如下
{
"features":[
{"type":"Feature",
"geomerty":
{
"type":"Point",
"coordinates":[-34.678393740116476,150.765380859375]
},
"properties":
{
"gx_id":"2",
"FID":2,
"sapobjectid":"12345sdf",
"sapobjectname":"Test",
"Features":"Point"}
}
]
}
但是我得到的错误是
Got error :{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "A value is required.",
"locationType": "other",
"location": "features[0].geometry"
}
],
"code": 400,
"message": "A value is required."
}
}
请让我知道我想念的东西。
我认为这是一个语法问题:“ geomerty”。
请改用重新尝试该请求"geometry"
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句