我有一个用户可以用来创建路线的移动应用程序。其他人可以查看这些路线,我想使用谷歌静态 map 来避免必须在路线列表中呈现所有这些路线,因为移动设备的性能可能很低。
是否允许在服务器上获取静态 map ,缓存它们,然后让客户端从服务器获取它们?
如果没有,我是否让客户直接从 Google 请求静态 map ?如果是这样,我如何保护 api_key 和 secret 不被泄露。它必须包含在应用程序中,对吗?
最佳答案
您可以根据需要使用 Map Lite 模式。
什么是精简模式?
A lite mode map is a bitmap image of a map at a specified location and zoom level. Lite mode supports all of the map types (normal, hybrid, satellite, terrain) and a subset of the functionality supplied by the full API. Lite mode is useful when you want to provide a number of maps in a stream, or a map that is too small to support meaningful interaction.
安卓版
这是 Github repo 链接:
https://github.com/androidcodegeeks/android-map_list
iOS 版本 您可以向静态 map API 发送请求,并在您的应用程序中使用 AFNetworking 库相应地加载获取的位图。
引用链接: https://developers.google.com/maps/documentation/static-maps/
希望对您有所帮助。
关于android - 缓存静态 map 服务器端以用于移动应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42951419/