Reputation: 1101
I've got a mobile app users can use to create routes. Others can view those routes and I'd like to use google static maps to avoid having to render all those routes in the list of routes, as mobile devices can be low on performance.
Is it allowed to fetch the static maps on the server, cache them and then have the client fetch them from the server?
If not, do I have the client request the static maps directly from Google? If so, how do I protect the api_key and secret from leaking. It has to be included in the app, right?
Upvotes: 1
Views: 467
Reputation: 6714
You can use Map Lite mode for your requirement.
What is Lite Mode ?
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.
Android version
Here is the Github repo link:
https://github.com/androidcodegeeks/android-map_list
iOS Version You can send a request to Static Maps API and load the fetched bitmap accordingly using AFNetworking library within your Application.
Reference Link: https://developers.google.com/maps/documentation/static-maps/
I hope this helps.
Upvotes: 1