I have been struggling to get the static image to show. Several times I have had it working only to have it disappear again. Today I inspected the broken image icon with Google Chrome and I think I might have found the problem. Chrome says that the server (their server) is forbidding the image.

Here's what Chrome said, "Failed to load resource: the server responded with a status of 403 (Forbidden)".

The weird part is that the map image shows up fine on the actual Location Map page. Only the static image is broken.

I just installed the newest build today after uninstalling the module, flushing the caches twice, and deleting the Location Map folder via FTP.

Does anyone have any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rupertj’s picture

Assigned: Unassigned » rupertj

I get the same, although only on some requests. If I hit refresh it displays after a while and then seems to stay there. I'm wondering if this is something on Google's end - IE the image comes back as a 403 if it can't generate fast enough, and then once they've generated it, it'll display ok from then on. I'll have a look at if there's a more reliable way of generating that map.

rupertj’s picture

Actually, what I posted before isn't right. What's happening is this:

1) Try to display map in site - get 403.
2) Go to map image URL directly in browser to see what's going on - map displays.
3) Map displays correctly in site from then on (cached in browser?).
4) Change the map location, and the cycle continues...

ericjan’s picture

Same here. Firebug is telling me: "NetworkError: 403 Forbidden - http://maps.google.com/staticmap?......". Where the image should be, only a link is shown: Location map. In Chrome I see a clickable image placeholder instead of a link.

rupertj’s picture

The static maps API docs make the request to a different URL, with an additional sensor param. Give the attached patch a try - It works for me, but I'd like to make sure this isn't some fluke :)

rupertj’s picture

Assigned: rupertj » Unassigned
Status: Active » Needs review
Danny Englander’s picture

I've tested this patch and it worked to solve my issue, the map is now displaying properly.

dukem’s picture

Worked for me too.

rupertj’s picture

Status: Needs review » Closed (fixed)

I've made 2.1 & 1.3 releases, which both contain this fix. Thanks all!

StaticBelow’s picture

This fixed it. Thank you Rupertj.

Vacilando’s picture

Version: 7.x-2.0 » 7.x-2.1

I still frequently see the infamous error page instead of a static image, even in 7.x-2.1 and in latest dev :-(

rupertj’s picture

Version: 7.x-2.1 » 7.x-2.0

If you want help, you should open a new issue. This one's been closed for ages, and your problem's unlikely to be the same as the one in this issue.

  • Commit bfcec0c on master, 7.x-2.x, 8.x-2.x by rupertj:
    Issue #1489042 by rupertj, highrockmedia: Fixed the static image block
    
    
rmfranciacastillo’s picture

Issue summary: View changes

I've had this same error with Drupal 8.2.4. All I did was redo my cache with "drush cr".

Solved it. :)