0

我試圖使用街景發佈API在現有照片上發佈photo.pose.level。街景視圖發佈api pose.level不會保存

當我發佈GPS,HEADING和LEVEL數據時,前兩個(GPS + HEADING)存儲在街景照片上,但LEVEL數據丟失並且不會保存(服務器響應正常)。

這裏是我的POST代碼爲標題和GPS的作品,我無法揣摩出我錯了,或者如果我失去了一些東西..我想我已經爲documentation

描述所做的一切
$data['pose']['latLngPair']['latitude']=$lat+0; 
    $data['pose']['latLngPair']['longitude']=$lon+0; 
    $data['pose']['heading']=$heading+0; 
    $data['pose']['level']['number']=$level+0; 
    $data['pose']['level']['name']='L'.($level+0).''; 
    $data_string = json_encode($data); 

    $ch = curl_init('https://streetviewpublish.googleapis.com/v1/photo/'.$photo_id.'?key='.$_GOOGLE_API['api_key'].'&updateMask=pose.latLngPair,pose.heading,pose.level');                  
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");                  
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                  
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(                   
     'authorization: Bearer '.$_GOOGLE_API['access_token'], 
     'Content-Type: application/json',                     
     'Content-Length: ' . strlen($data_string))                  
    );                                                         
    $json_response=curl_exec($ch); 
    curl_close ($ch); 
+0

嘗試使用API​​ Explorer與[**'photo.get' **](https://developers.google.com/streetview/publish/reference/rest/v1/photo/get)測試照片函數,看看它是否被正確更新。在檢查它是否正確更新時,是否使用了[**'photos.list()**](https://developers.google.com/streetview/publish/reference/rest/v1/photos/list)? –

+0

我已經使用[**'photos.batchGet()**](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchGet)和[**'照片。獲取'**](https://developers.google.com/streetview/publish/reference/rest/v1/photo/get),並能夠看到我早些時候宣佈的pose.level(15分鐘前)。 –

回答

0

看起來不錯。你等多久了?有時,數據在getPhoto請求中顯示之前需要24小時。

+0

大約一個半小時前,我在相同的POST中發送了標題和級別信息。標題出來幾秒鐘後更新,但級別仍然不存在或更新。我正在測試很多照片。我會再等一會兒 – recursio

+0

接近20小時,沒有測試照片的更新。 – recursio