You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Maps iOS SDK 2.7版GMSReverseGeocoder返回地址缺失问题反馈

Fix for GMSReverseGeocoder Address Lines Missing in Google Maps iOS SDK 2.7

Looks like you're hitting a recent service-side glitch with the Google Maps iOS SDK 2.7's GMSReverseGeocoder—over the last 48 hours, it's returning incomplete address lines for coordinates where it previously worked perfectly. For example:

GMSAddress { coordinate: (37.915000, 23.730000) lines: Alimos, Greece subLocality: Alimos locality: South Athens administrativeArea: Decentralized Administration of Attica country: Greece }

The lines field should normally deliver a fully formatted address, but right now it's only showing the sublocality and country. Here are some practical fixes and workarounds to get you back on track:

  • Roll back to a stable SDK version
    This issue seems specific to v2.7. Try reverting to the previous stable release (like v2.6) to see if the lines field behaves as expected again. If you're using CocoaPods, update your Podfile:

    pod 'GoogleMaps', '~> 2.6'
    

    Then run pod install to apply the change.

  • Manually build the full address
    Since all individual address components (subLocality, locality, administrativeArea, country) are still intact in the GMSAddress object, you can construct your own formatted address instead of relying on the broken lines field. Here's a Swift example:

    func formattedFullAddress(from address: GMSAddress) -> String {
        var components = [String]()
        
        if let subLocality = address.subLocality { components.append(subLocality) }
        if let locality = address.locality { components.append(locality) }
        if let adminArea = address.administrativeArea { components.append(adminArea) }
        if let country = address.country { components.append(country) }
        
        return components.joined(separator: ", ")
    }
    

    This will generate a full address string like "Alimos, South Athens, Decentralized Administration of Attica, Greece"—exactly what the lines field should return.

  • Report the issue to Google
    This is almost certainly a service-side problem (not a bug in the SDK code itself). Submit a detailed report to the Google Maps Platform Issue Tracker including:

    • The exact coordinates (37.915000, 23.730000)
    • SDK version (2.7)
    • Device and iOS version
    • Screenshots or logs of the incomplete GMSAddress response
      The Google team will likely investigate and push a fix on their end quickly.
  • Use the Geocoding API directly
    If you need the formatted address lines immediately, you can bypass the SDK's GMSReverseGeocoder and make a direct HTTP request to the Google Geocoding API. Just ensure you have a valid API key and understand the billing implications. Parse the JSON response to extract the formatted_address field, which will give you the complete address.

内容的提问来源于stack exchange,提问作者Nikos M.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:39:13