I've run up against an issue when generating static maps.
It seems there is a 1000 per 24hr or 50 per minute limit to the amount of static maps a single IP can request.
https://developers.google.com/maps/documentation/staticmaps/#Limits
This seems fairly reasonable for a single user, but it turns out that mobile device carriers route requests through a small number of proxy servers causing quite frequent occurrences of blocking which result in showing a Google maps error icon instead of your map.
There are several discussions on stack overflow about this, with the solution being to use a api key.
Using your own api key the limit is 25 000 Static Maps image requests per day.
Details on creating a key are included in the same document linked above (and linked in the admin form created the attached patch)
https://developers.google.com/maps/documentation/staticmaps/#api_key
I've created a patch that integrates the use of a key for static map generation, and a site variable to store your key, settings page at admin/config/services/googlemaps
Of course if you leave out the key then there is no change in behavior of the module.
This has solved my issues and I can now see my maps on mobile phones consistently.
Here is my patch adding this feature.
Patch applies against 7.x-1.x-dev and 7.x-1.4
Comment | File | Size | Author |
---|---|---|---|
#11 | add-settings-for-using-a-google-api-key-2314121-11.patch | 4.24 KB | derjochenmeyer |
Comments
Comment #1
haleagar CreditAttribution: haleagar commentedComment #3
derjochenmeyer CreditAttribution: derjochenmeyer commentedPlease test in current dev version.
Comment #5
derjochenmeyer CreditAttribution: derjochenmeyer commentedChange wording and fix Undefined index notice
Comment #6
derjochenmeyer CreditAttribution: derjochenmeyer commentedChange module version to dev branch.
Comment #8
derjochenmeyer CreditAttribution: derjochenmeyer commentedCommitted.
Comment #9
derjochenmeyer CreditAttribution: derjochenmeyer commentedComment #11
derjochenmeyer CreditAttribution: derjochenmeyer commentedOk bot, test this.
Comment #12
derjochenmeyer CreditAttribution: derjochenmeyer commentedComment #14
derjochenmeyer CreditAttribution: derjochenmeyer commentedClosed. Patch cannot apply because its already committed.