A resource that is interpreted as an image but transmitted as text / html while working with Google Maps

New to google maps , I recently started reading.

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

I took a sample demo / sample from the Google Maps API and started adapting it to my requirements. Everything went well.

However, at some point in time, I decided to insert a button that needs to be clicked to display the map, otherwise the map does not appear by default.

However, when loading the page there is no error, however, as soon as I click the button, I get this message "resource , which is interpreted as an image, but transmitted as text / html "

I tried to find out if I was setting the content type explicitly somewhere, but no, I didn’t find anything.

Has anyone seen this? I will be grateful for the help.

+6
source share
3 answers

If this error is related to the url that contains "gen204", just ignore it. This is a known issue with Google Maps in some browsers, but completely harmless. Visitors to your site should not be exposed unless they have an open developer console, and then all they see is a magazine.

+5
source

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

  • Harmless: they are related to performance logging, not map APIs.
  • It’s not your fault: they are a Google mistake. (Although it’s not clear whether Maps or Chrome should be responsible for fixing the problem.)

According to this post in the Google Maps API forum (highlighted by me):

This is a registration beacon. It logs the loading time of javascript, fragments, and so on. The server responds with HTTP 204, which is an empty response, should not require a MIME type .

So the problem is not how you use Google Maps, but how your browser (incorrectly) handles HTTP 204 responses from the Google performance registration code.

There are WebKit and Chrome errors filed against this problem, but they seem to be crazy.

+1
source

I recently encountered the same problem when scrolling through a map - when I scroll through any new map tiles, I saw that "the resource is interpreted as an image, but is transmitted as text / html" in the console. After researching, my map generation code (Mappable fork for silverstripe) generated a marker with a blank icon file. When I fixed this, the card started working normally again.

I also added a second page to the page for testing, this also showed the same gap until I set the icon above.

0
source

Source: https://habr.com/ru/post/895354/


All Articles