【问题标题】:how can i integrate google map in my iphone app [closed]我如何在我的 iPhone 应用程序中集成谷歌地图 [关闭]
【发布时间】:2012-12-15 17:25:50
【问题描述】:

您好,我在 iphone 中集成谷歌地图时遇到问题。当我在 iphone 模拟器上运行应用程序时,它运行良好,没有任何错误,当它加载到 iphone 屏幕上时,我只能看到红点而不是整个地图 https://developers.google.com/maps/documentation/ios/start 我已经提供了谷歌分配给我的 api 密钥,但是当应用程序在 iphone 中加载时,这个 nslog 会不断生成

2012-12-31 20:36:17.132 google map[848:12e03] provideAPIKey: should be called at most once
2012-12-31 20:36:17.747 google map[848:12e03] GMSZoomTableQuadTree lacks root zoom table for tile type (mapType: 10)
2012-12-31 20:36:19.062 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:36:19.196 google map[848:14603] Google Maps SDK for iOS version: 1.0.1.1154
2012-12-31 20:36:19.244 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:36:25.618 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:36:33.793 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:36:39.026 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:36:40.885 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:36:45.096 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:36:53.275 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:00.036 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:00.335 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:04.719 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:12.941 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:25.739 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:26.057 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:32.466 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:40.932 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:56.592 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:37:57.050 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:38:02.515 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:38:10.864 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:38:33.764 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:38:34.018 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:38:38.405 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:38:46.651 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:39:19.375 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:39:19.625 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:39:23.874 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:39:32.150 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:40:18.172 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:40:18.427 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:40:22.677 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:40:31.162 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:41:42.868 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:41:43.128 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:41:48.785 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:41:57.027 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:43:43.507 google map[848:12e03] ClientParametersRequest failed, 3 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:43:43.879 google map[848:12e03] ClientParametersRequest failed, 2 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:43:48.065 google map[848:12e03] ClientParametersRequest failed, 1 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"
2012-12-31 20:43:56.264 google map[848:12e03] ClientParametersRequest failed, 0 attempts remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"

所以请告诉我我需要做什么,因为我浪费了 6 到 7 个小时,我的老板对我很生气,请帮助我

【问题讨论】:

  • 当然看起来它没有使用(正确的)密钥,如果没有看到代码就很难分辨。
  • GMSCamera 相机 = GMSCameraMake(-33.8683, 151.2086, 6); mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; mapView_.myLocationEnabled = YES; mapView_.frame = CGRectMake(0, 0, 200, 300); self.view = mapView_; GMSMarkerOptions *options = [[GMSMarkerOptions alloc] init]; options.position = CLLocationCoordinate2DMake(-33.8683, 151.2086); options.title = @"悉尼"; options.sn-p = @"澳大利亚"; [mapView_addMarkerWithOptions:options];
  • 这是密钥 [GMSServices provideAPIKey:@"AIzaSyBb2eaMUPD7J5Bc9eCEtJQcptCGbU4JqYg"];

标签: iphone objective-c ios


【解决方案1】:

Getting Started page 说:

如果您看到标记,但看不到地图,请确认您 已提供您的 API 密钥。

您真的申请了Google Maps SDK for iOS吗?您真的在 Google API 控制台的 服务 页面上看到 Google Maps SDK for iOS 吗? (在我的 API 项目中,我看不到它。)

您可能正在使用 Google Maps API v3 的 API 密钥,这是您想要做的错误服务。

Google 似乎还没有为 iOS 服务发送很多 API 密钥。你所能做的就是申请服务,等待谷歌的答复。

【讨论】:

  • 是的,我也看不到
  • 那你可能要申请the correct key了。
  • 我已经填写了此表格并使用 google 邮件 ID 进行了注册,但无法查看适用于 ios 的 goog maps sdk
  • @adnan 您收到来自 Google 的带有密钥的邮件了吗?如果是这样,它应该可以工作,如果你从控制台下载它,它可能是该服务的错误密钥。
  • 关于 ios API 密钥的任何更新?这里什么都没有。
猜你喜欢
  • 1970-01-01
  • 2010-12-12
  • 2015-04-05
  • 1970-01-01
  • 2014-12-21
  • 2018-11-16
  • 1970-01-01
  • 2016-09-20
  • 2011-12-23
相关资源
最近更新 更多