不更新 MKMapView 中的当前位置

发布于 2024-10-06 03:57:30 字数 104 浏览 1 评论 0原文

我正在使用 CLLocationManager 更新当前位置,但有时当前位置会丢失。我不知道为什么当前位置正在丢失。

请帮助我摆脱这个困境。

谢谢你, 马丹·莫汉

I am using CLLocationManager to update the current location but some times the current location is lost. I don't know why the current location is losing.

Please help me out of this.

Thank you,
Madan Mohan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

本宫微胖 2024-10-13 03:57:30

位置可能因多种原因而丢失:

  • 设备不再能够合理开放地访问天空,因此 GPS 卫星信息不可用。

  • 没有足够的蜂窝塔可用于执行三角测量。

  • Wi-Fi 接入点不在已知接入点数据库中。

  • 用户切换到飞行模式。

还有更多。位置感知应用程序必须假设它们随时会丢失地理位置信息。它通常会在片刻之后回来。

The location can become lost for a wide variety of reasons:

  • The device no longer has reasonably open access to the sky so GPS satellite information is unavailable.

  • There aren't enough cell towers available to perform triangulation.

  • The wifi access point isn't in the database of known access points.

  • The user switched to Airplane Mode.

And many more. Location-aware applications have to assume they'll lose geolocation information at any time. It often comes back moments later.

笑红尘 2024-10-13 03:57:30

如果您没有收到有关您所在位置的任何更新,则可能会调用该代表

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error 
{
switch([error code])
{
   case kCLErrorLocationUnknown: 
   //The location manager was unable to obtain a location value right now

   case kCLErrorDenied: 
   //Access to the location service was denied by the user

   case kCLErrorNetwork: 
   //The network was unavailable or a network error occurred.

   case kCLErrorHeadingFailure:
   // The heading could not be determined.
 }

。您可以找出问题所在。

If you didnt get any update on your location then this delegate might be called

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error 
{
switch([error code])
{
   case kCLErrorLocationUnknown: 
   //The location manager was unable to obtain a location value right now

   case kCLErrorDenied: 
   //Access to the location service was denied by the user

   case kCLErrorNetwork: 
   //The network was unavailable or a network error occurred.

   case kCLErrorHeadingFailure:
   // The heading could not be determined.
 }

You can find out whats the problem is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文