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

3

6

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.

Lubumbashi answered 18/8, 2011 at 18:34 Comment(0)
H
5

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.

Hurt answered 21/8, 2011 at 4:32 Comment(4)
Well, it so turned out that the problem was due to having an extra div container on top of the map div. Fixed now. :) thanks for your response.Lubumbashi
This warning is annoying the hell out of me. It's flooding the console, completely burying all my own log messages. Using the Chrome developer tools, is there any way to filter them out or something? I want a workaroundCracker
@Codemonkey You can select "Logs" instead of "All" in Chrome Developer tools to exclude the warnings and errors.Expellant
@BryanDowning Yes I'm currently doing that, but I really dislike not being able to utilize console warnings in my own applicationsCracker
D
1

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.

Debarath answered 31/5, 2012 at 18:27 Comment(0)
K
0

I recently ran into the same problem when scrolling a map - when I scrolled no new map tiles appeared and I saw 'resource interpreted as image but transferred as text/html' in the console. Upon investigation my map generating code (a fork of Mappable for silverstripe) was generating a marker with an empty icon file. When I fixed this, the map started working normally again.

I'd also added a second map to the page for testing purposes, this too showed the same break until I fixed the icon above.

Kathrinekathryn answered 7/6, 2012 at 5:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.