iOS Cocoa Pods - 有没有办法只导入 google 地理编码而不导入整个 google 地图库?

iOS Cocoa Pods - is there a way to import only google geocoding without the entire google maps library?

我有一个基于地图的应用程序,除了反向地理编码外,它在任何地方都使用苹果地图,我在其中使用 google 地图地理编码 api。我没有使用任何其他东西。有没有办法只导入这个 pod?对于整个 pod 'GoogleMaps',我的项目现在有 230 mb 的预存档。谢谢

很遗憾,没有办法做到。

Documentation 说:

The Maps SDK for iOS includes a class called the GMSGeocoder class, which includes the reverseGeocodeCoordinate member function which you can use to perform the conversion.

因此,您应该添加整个 pod GoogleMaps,使用 API 键初始化地图并使用地理编码。

您可以尝试 CLGeocoder,但它有一些限制。其中之一:

you should not send more than one geocoding request per minute