0

我正在尝试与其他 UpdateMask 一起更新pose.roll 和连接,但只更新航向和俯仰,pose.roll 保持为空。

这是php代码

<?php
$ch_a = curl_init();      
curl_setopt($ch_a, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch_a, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$_SESSION['access_token'], 'Content-Type: application/json'));
curl_setopt($ch_a, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch_a, CURLOPT_URL, 'https://streetviewpublish.googleapis.com/v1/photo/'.$photoId.'?key='.$config['apikey'].'&updateMask=pose.heading,pose.pitch,pose.roll,connections');
curl_setopt($ch_a, CURLOPT_POSTFIELDS, '{"pose":{"heading": 145.9086485977801, "pitch":3.219209274200196, "roll":"0"}}');
$url = curl_exec($ch_a);
curl_close($ch_a);
echo $url;
?>
4

1 回答 1

1

我认为这是一种预期的行为。

我已经使用 Try It! 尝试了这个示例请求!在文档中。

{
  "pose": {
    "roll": 0,
    "latLngPair": {
      "longitude": 118.04944440000001,
      "latitude": 12.5343694
    },
    "heading": 90,
    "pitch": 5.0999984741210938
  }
}

然后我收到了这个 200 回复:

{
  "photoId": {
    "id": "ID"
  },
  "pose": {
    "latLngPair": {
      "latitude": 12.5343694,
      "longitude": 118.04944440000001
    },
    "heading": 90,
    "pitch": 5.0999984741210938
  }
}

如果您更新roll0,则该值将为空。当值为 时roll>0它将出现在响应中。例子:

{
  "photoId": {
    "id": "ID"
  },
  "pose": {
    "latLngPair": {
      "latitude": 12.5343694,
      "longitude": 118.04944440000001
    },
    "heading": 90,
    "pitch": 5.0999984741210938,
    "roll": 5
  }
}
于 2017-07-06T16:14:33.380 回答