Search code examples
google-mapshttp-status-code-400

Why do I get an error 400 when switching my google maps to Satellite mode?


When displaying a Google Map with Maps JavaScript API v3 activated, the default "Map" view works well, but the "Satellite" view does not : The image tiles read "Sorry, we have no imagery here".

I have two versions of the map : The public version works well either in Map mode or Satellite mode. The private version, that requires login and allows for editing the custom stuff loaded onto the map, is the one that says "no imagery here" but only in Satellite mode.

When in private mode for editing, here is an example of working Map view : Private mode "map view"

Here is an example of broken Satellite view : Private mode "satellite view"

When looking at the Javascript console, here is what I find : GET https://khms1.googleapis.com/kh => Error 400 Bad Request But the request is sent by Google's own js code.

Error 400

My web app has been working fine for years until I noticed this.


Solution

  • In case you are using a prototype js library, check in your developer console if you are receiving an error from Array.from function, if so, fix this bug in the overrided function or just comment it (at least to test it).