Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resource interpreted as image but transferred as text/html while working with Google Maps

A newbie with google maps, I have recently started reading.

For one of the projects, I had to plot a few points on a map.

I picked up a demo/sample piece from Google's API home for maps, and started adapting it for my requirements. All went well.

However, at one point in time, I decided to insert a button, which needs to be clicked to show the map, else the map is not shown by default.

Still, there is no error on page load, however, as soon as I click the button, I get this message "resource interpreted as image but transferred as text/html"

Tried figuring out if I am setting the content type explicitly somewhere but no, couldn't find anything.

Anybody seen that ? would appreciate help.

like image 379
Raghav Avatar asked Aug 18 '11 18:08

Raghav


2 Answers

If this error is related to a URL which contains "gen204" then just disregard it. This is a known issue with Google Maps on some browsers, but is completely harmless. Visitors to your site should not be impacted unless they have the developer console open, and then all they will see is a log.

like image 62
plexer Avatar answered Oct 23 '22 05:10

plexer


These annoying warnings cluttering your console (and mine) are:

  • Harmless: They're related to performance logging, not maps API functionality.
  • Not your fault: They're Google's fault. (Though it's not entirely clear whether Maps or Chrome should be responsible for fixing the problem.)

According to this post in the Google Maps API forum (emphasis added):

This is a logging beacon. It records the time to load the javascript, tiles and so on. The server responds with HTTP 204 which, being an empty response, should not require a MIME type.

So, the problem isn't how you're using Google Maps, it's how your browser is (mis-)handling HTTP 204 responses from the Maps performance logging code.

There are WebKit and Chrome bugs filed against this issue, but they seem to have gone dormant.

like image 30
medmunds Avatar answered Oct 23 '22 05:10

medmunds