是什么原因导致maps.googleapis.com/maps/vt返回400错误?

时间:2016-04-28 07:45:06

标签: javascript google-maps google-maps-api-3 google-fusion-tables fusion

我目前正在使用带有Fusion Table Layer的Google Map。通过这张地图,我制作了填充地图的AJAX查询和一个包含结果的列表。

最近,谷歌地图API响应出现了问题,即400"格式错误的请求"错误。在设置过滤器并通过AJAX发送后,在使用新结果集填充地图时偶尔会发生此响应。在查看错误Firefox的调试控制台时,我注意到pb参数可能是问题所在。问题是我不确定这个参数到底有什么错误。

这里出现错误的GET请求:

https://maps.googleapis.com/maps/vt?pb=[...insert_param_code_here...]&callback=_xdc_._n2pwun&token=20077

我将我看到的内容粘贴到下面的pb参数中。这是其中一个无效的'查询已经完成。

"!1m4!1m3!1i13!2i2042!3i3139!1m4!1m3!1i13!2i2043!3i3139!1m4!1m3!1i13!2i2042!3i3140!1m4!1m3!1i13!2i2042!3i3141!1m4!1m3!1i13!2i2043!3i3140!1m4!1m3!1i13!2i2043!3i3141!1m4!1m3!1i13!2i2042!3i3142!1m4!1m3!1i13!2i2042!3i3143!1m4!1m3!1i13!2i2043!3i3142!1m4!1m3!1i13!2i2043!3i3143!1m4!1m3!1i13!2i2044!3i3139!1m4!1m3!1i13!2i2045!3i3139!1m4!1m3!1i13!2i2046!3i3139!1m4!1m3!1i13!2i2044!3i3140!1m4!1m3!1i13!2i2044!3i3141!1m4!1m3!1i13!2i2045!3i3140!1m4!1m3!1i13!2i2045!3i3141!1m4!1m3!1i13!2i2044!3i3142!1m4!1m3!1i13!2i2044!3i3143!1m4!1m3!1i13!2i2045!3i3142!1m4!1m3!1i13!2i2045!3i3143!1m4!1m3!1i13!2i2046!3i3140!1m4!1m3!1i13!2i2046!3i3141!1m4!1m3!1i13!2i2046!3i3142!1m4!1m3!1i13!2i2046!3i3143!2m21!1e2!2sft:tableID!4m2!1ssg!2s%20Cities_With_Charters%20%3D%20'East%20St.%20Louis%20Area'%20AND%20Students_Served%20LIKE%20'%25'%20AND%20School_Type_Dropdown%20IN%20('Charter')%20ORDER%20BY%20School_Name%20ASC!4m2!1ssc!2sSchool_Info_ID%2C%20CPS_ID%2C%20RCDTS%2C%20School_Name%2C%20Street_Address%2C%20City%2C%20State%2C%20Zip%2C%20Phone%2C%20Website%2C%20Lat%2C%20Long%2C%20Year_Opened%2C%20School_Description%2C%20District_Info_ID%2C%20District_Name%2C%20Charter_Renew_YR%2C%20Network_ID%2C%20Network%2C%20Community_Area%2C%20State_Rep_District%2C%20State_Sen_District%2C%20Ward_Remapped%2C%20Grades_Served%2C%20Grades_Capacity%2C%20Serves_ES%2C%20Serves_HS%2C%20Serves_MS%2C%20Serves_Dropouts%2C%20School_Type_Dropdown%2C%20School_Type_Color%2C%20School_Type_Display%2C%20Profile_Type%2C%20SQRP_Rating%2C%20SQRP_Profile%2C%20Cities_With_Charters%2C%20Link_IIRC%2C%20Students_Served!4m2!1ssq!2s'School_Type_Color'%20%3D%20'GREEN'$'School_Type_Color'%20%3D%20'ORANGE'$'School_Type_Color'%20%3D%20'BLUE'$'School_Type_Color'%20%3D%20'MAGENTA'!4m2!1sc!2si:grn_blank$i:orange_blank$i:ltblu_blank$i:purple_blank!4m2!1sy!2s2!4m2!1stmplt!2s2!5i1!3m3!2sen-US!3sUS!5e18!4e3!12m1!5b1"

以下是没有URL编码的查询仅供参考:

SELECT School_Info_ID, CPS_ID, RCDTS, School_Name, Street_Address, City, State, Zip, Phone, Website, Lat, Long, Year_Opened, School_Description, District_Info_ID, District_Name, Charter_Renew_YR, Network_ID, Network, Community_Area, State_Rep_District, State_Sen_District, Ward_Remapped, Grades_Served, Grades_Capacity, Serves_ES, Serves_HS, Serves_MS, Serves_Dropouts, School_Type_Dropdown, School_Type_Color, School_Type_Display, Profile_Type, SQRP_Rating, SQRP_Profile, Cities_With_Charters, Link_IIRC, Students_Served FROM tableID WHERE Cities_With_Charters = 'East St. Louis Area' AND Students_Served LIKE '%' AND School_Type_Dropdown IN ('Charter') ORDER BY School_Name ASC

到目前为止我已采取的步骤来解决这个问题:

  • 确保发送到Fusion Tables的任何查询字符串都已使用URL编码发送。
  • 请务必检查我的引号和引号,并确保在发送的查询中没有任何遗漏。
  • 检查我的Google Map初始参数,以确保我没有输入任何拼写错误或添加任何不存在的参数。

在确保没有发送格式不正确的内容时,是否还有其他预防措施?

2 个答案:

答案 0 :(得分:13)

我通过打开Chrome开发者工具并转到:应用程序&gt;解决了这个问题。 <清除存储>清除网站数据。然后,在开发人员工具仍然打开的情况下,单击并按住浏览器左上角的刷新按钮,直到您看到“#Empty; Empty Cache and Hard Reload”字样。点击它,你就可以了。

答案 1 :(得分:0)

我遇到了同样的问题。当使用融合表图层的地图结果页面上的CSS与地图参数不对齐时,会导致此问题。我修复了CSS,地图开始出现。