Recently, my embedded google map in my website is suddenly not working any more. While debugging using dev tool, I’ve spotted a failed request: https://maps.googleapis.com/$rpc/google.internal.maps.mapsjs.v1.MapsJsInternalService/GetViewportInfo returns 400 – bad request with response:
[
3,
"Invalid value at 'language' (TYPE_STRING), 0nInvalid value at 'map_type' (type.googleapis.com/maps_api.TileSpec.MapType), "m@695000000"nInvalid value at 'layer_spec' (TYPE_STRING), 0",
[
[
"type.googleapis.com/google.rpc.BadRequest",
[
[
[
"language",
"Invalid value at 'language' (TYPE_STRING), 0"
],
[
"map_type",
"Invalid value at 'map_type' (type.googleapis.com/maps_api.TileSpec.MapType), "m@695000000""
],
[
"layer_spec",
"Invalid value at 'layer_spec' (TYPE_STRING), 0"
]
]
]
]
]
]
The payload of this request is:
[[[55.68561981379856,9.502417928834426],[55.73059308949228,9.609773490167822]],14,"en-US",0,"m@695000000",0,0,2]
I also checked another site using the same map component but it’s working fine. What I found is the payload is different:
[[[-0.038623809489420104,-0.054073333285188145],[0.038623809489420104,0.054073333285188145]],14,null,"en-US",0,"m@695000000",0,0,null,null,null,1,"https://example.com/",1,null,null,"7294073E-C299-4A00-8BDA-A36E267315E7"]
I’ve thought that it might be there is mismatch in the google map api javascript version between 2 sites but I can confirm it’s the same version: ‘3.57.3a’ (window.google.maps.version)
Asking here so hopefully someone have a clue and solution for fixing this…
Expecting the payload should be the same for 2 sites using the same map component
Kyle Hoang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.