Google MAP的GMSPlacePickerViewController:在iOS中没有显示像android这样的确认框

时间:2018-01-30 04:41:48

标签: ios google-maps google-places-api

我已在我的某个屏幕中实施了Google的GMSPlacePickerViewController。

现在问题出现在Android中,他们正在显示包含所选位置和位置图像的确认框,如下所示

enter image description here

在iOS中,他们并没有要求相同,在iOS中我使用了以下代码,

// The code snippet below shows how to create and display a GMSPlacePickerViewController.
@IBAction func pickPlace(_ sender: UIButton) {
  let config = GMSPlacePickerConfig(viewport: nil)
  let placePicker = GMSPlacePickerViewController(config: config)

  present(placePicker, animated: true, completion: nil)
}

// To receive the results from the place picker 'self' will need to conform to
// GMSPlacePickerViewControllerDelegate and implement this code.
func placePicker(_ viewController: GMSPlacePickerViewController, didPick place: GMSPlace) {
  // Dismiss the place picker, as it cannot dismiss itself.
  viewController.dismiss(animated: true, completion: nil)

  print("Place name \(place.name)")
  print("Place address \(place.formattedAddress)")
  print("Place attributions \(place.attributions)")
}

func placePickerDidCancel(_ viewController: GMSPlacePickerViewController) {
  // Dismiss the place picker, as it cannot dismiss itself.
  viewController.dismiss(animated: true, completion: nil)

  print("No place selected")
}

我在上面的代码中遗漏了什么吗?

0 个答案:

没有答案