我正在尝试恢复之前设置的卡的位置,因此我可以用地图和带有Glass最后位置的路线替换HTML卡。 但当我拿回卡时,它没有位置。该位置设置在卡上,因为我在Glass上测试它没问题。 这是我的PHP代码:
elseif ($user_action['type'] == 'CUSTOM' && $user_action['payload'] == 'show-in-map')
{
$timeline_item_id = $request['itemId'];
$timeline_item = $mirror_service->timeline->get($timeline_item_id);
$patch = new Google_TimelineItem();
$cardFomater = new Card_Formater($patch->getHtml());
$cardLocation = $timeline_item->getLocation();
$patch->setHtml($cardFomater->replaceHtmlWithMap($location->getLatitude(),$location->getLongitude(),
$cardLocation->getLatitude(),$cardLocation->getLongitude()));
$mirror_service->timeline->patch($timeline_item_id, $patch);
}
它说$ cardLocation没有属性getLatitude()。