在街景发布 API 中更新滚动和连接的正确 JSON 参数是什么
What would be the correct JSON argument to update roll and connections in street view publish API
我正在尝试与其他 UpdateMasks 一起更新 pose.roll 和连接,但仅更新航向和俯仰,pose.roll 保持为 NULL。
这是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;
?>
我认为这是预期的行为。
我已经使用 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
}
}
如果您将 roll
更新为 0
,则该值将为空。当roll
的值为>0
时,它会出现在响应中。示例:
{
"photoId": {
"id": "ID"
},
"pose": {
"latLngPair": {
"latitude": 12.5343694,
"longitude": 118.04944440000001
},
"heading": 90,
"pitch": 5.0999984741210938,
"roll": 5
}
}
我正在尝试与其他 UpdateMasks 一起更新 pose.roll 和连接,但仅更新航向和俯仰,pose.roll 保持为 NULL。
这是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;
?>
我认为这是预期的行为。
我已经使用 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
}
}
如果您将 roll
更新为 0
,则该值将为空。当roll
的值为>0
时,它会出现在响应中。示例:
{
"photoId": {
"id": "ID"
},
"pose": {
"latLngPair": {
"latitude": 12.5343694,
"longitude": 118.04944440000001
},
"heading": 90,
"pitch": 5.0999984741210938,
"roll": 5
}
}