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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

haleagar’s picture

Issue summary: View changes

  • derjochenmeyer committed ea03364 on 7.x-1.x
    Issue #2314121 by haleagar: Fixed Static map generation usage limits,...
derjochenmeyer’s picture

Status: Needs review » Fixed

Please test in current dev version.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

derjochenmeyer’s picture

Title: Static map generation usage limits, and api key » Add settings for using a Google API key
Status: Closed (fixed) » Needs review
FileSize
4.24 KB

Change wording and fix Undefined index notice

Notice: Undefined index: api_key in geolocation_googlemaps_field_formatter_view() (line 232 of ./modules/geolocation/modules/geolocation_googlemaps/geolocation_googlemaps.module).
derjochenmeyer’s picture

Version: 7.x-1.4 » 7.x-1.x-dev

Change module version to dev branch.

  • derjochenmeyer committed e76d7ca on 7.x-1.x
    Issue #2314121 by derjochenmeyer, haleagar: Fixed Add settings for using...
derjochenmeyer’s picture

Status: Needs review » Fixed

Committed.

derjochenmeyer’s picture

Status: Fixed » Closed (fixed)

Status: Closed (fixed) » Needs work

The last submitted patch, 5: add-settings-for-using-a-google-api-key-2314121-5.patch, failed testing.

derjochenmeyer’s picture

Ok bot, test this.

derjochenmeyer’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: add-settings-for-using-a-google-api-key-2314121-11.patch, failed testing.

derjochenmeyer’s picture

Status: Needs work » Closed (fixed)

Closed. Patch cannot apply because its already committed.