(500) Google Fusion Table REST API 更新样式 ID 时出现后端错误

(500) Backend Error on update style id by Google Fusion Table REST API

我正在通过 REST 更新 Fusiontable 样式 api。

但是我收到 (500) 后端错误 消息的错误。 同时我在 fusiontable insert/update 行中通过 REST api.

获得了成功消息

我怎样才能debug/resolve这个问题。

这是我的代码:

$columnName = self::getStyleColumnPrefix($style_id);
$strokeOpacity = '1';
$fillOpacity = '1';
$kind = 'fusiontables#fromColumn';
$tableId = $this->table;
$styleId = $style_id;

$fillColorStyler = new \Google_Service_Fusiontables_StyleFunction();
$fillColorStyler->setColumnName($columnName);
$fillColorStyler->setKind($kind);

$polygonOptions = new \Google_Service_Fusiontables_PolygonStyle();
$polygonOptions->setFillColorStyler($fillColorStyler);
$polygonOptions->setStrokeOpacity($strokeOpacity);
$polygonOptions->setFillOpacity($fillOpacity);

$postBody = new \Google_Service_Fusiontables_StyleSetting();
$postBody->setPolygonOptions($polygonOptions);

// $this->service = new \Google_Service_Fusiontables_Style_Resource();
$results = $this->service->style->update($tableId, $styleId, $postBody);

最后一行出错

$results = $this->service->style->update($tableId, $styleId, $postBody);

堆栈跟踪

File:
D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Http\REST.php:110
Message:
Error calling PUT https://www.googleapis.com/fusiontables/v2/tables/1ycoFAd3BrVZ248zXausz4kKe66Jj3fZDeKvxlBMy/styles/1: (500) Backend Error
Stack trace:
@0 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Http\REST.php(62): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request), Object(Google_Client))
@1 [internal function]: Google_Http_REST::doExecute(Object(Google_Client), Object(Google_Http_Request))
@2 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Task\Runner.php(174): call_user_func_array(Array, Array)
@3 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Http\REST.php(46): Google_Task_Runner->run()
@4 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Client.php(590): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
@5 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Service\Resource.php(237): Google_Client->execute(Object(Google_Http_Request))
@6 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Service\Fusiontables.php(904): Google_Service_Resource->call('update', Array, 'Google_Service_...')
@7 D:\xampp2\htdocs\itp-benchmarking\branches\development\module\BenchMarking\src\BenchMarking\Model\FusionTableModel.php(494): Google_Service_Fusiontables_Style_Resource->update('1ycoFAd3BrVZ248...', 1, Object(Google_Service_Fusiontables_StyleSetting))
@8 D:\xampp2\htdocs\itp-benchmarking\branches\development\module\BenchMarking\src\BenchMarking\Controller\FusionTableController.php(268): BenchMarking\Model\FusionTableModel->setStyleIdOfMeasure(1)

我正在使用 google-api-php-客户端 (v1.1)。

您似乎无法同时设置 colorStyler 其他属性,例如 strokeOpacity。当我删除后者时,我不再收到错误。

目前没有记录在案,API 错误响应在这件事上应该更清楚...