0

我正在尝试恢复先前设置的卡片的位置,因此我可以用地图和带有 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()。

4

0 回答 0