2014-02-08 3 views
2

구글 맵 엔진 API의 batchInsert를 사용하고 싶습니다. dojo/request로 이것을 호출합니다.Google Maps Engine에 대한이 요청에 누락 된 항목은 무엇입니까?

코드는 다음과 일괄 삽입 호출 :

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." 
} 
} 

은 알려 주시기 바랍니다

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"} 
} 
] 
} 

아래하지만

로 오류가 발생하고 내가 실종됐다.

답변

3

나는 구문상의 문제라고 생각한다 : "geomerty".

대신 "geometry"을 사용하여 요청을 다시 시도하십시오.