6

I am currently using a Google Map with a Fusion Table Layer. With this map, I make AJAX queries that populate the map and a list with results.

Recently there's been an issue with the Google Map API response coming back as a 400 "Malformed Request" error. This response sporadically happens when the map is populated with a new result set after filters are set and sent via AJAX. When checking out the error Firefox's debugging console, I noticed that the pb parameter may be the issue. The problem is that I'm unsure about what exactly is malformed about this parameter.

Here's the GET request that errors out:

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

I pasted what I see assigned to the pb parameter below. This is what is sent when one of the 'invalid' queries are made.

"!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"

Here is the query without URL encoding just for reference:

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

The steps I've taken so far to fix this:

  • Making sure any query string sent to Fusion Tables has been sent with URL encoding.
  • Made sure to check my quotes and quotation marks and make sure there weren't any stray ones in the query being sent.
  • Checked my Google Map init parameters to make sure I didn't make any typos or add any non-existent parameters.

Are there any other precautions I'm missing in making sure malformed content isn't sent?

  • Where is that GET request documented? – MrUpsidown Apr 28 '16 at 08:02
  • I'm not sure. I've tried searching to see if there's any docs already, and I haven't found anything specific. The only thing I know so far is that it seems to be something sent by Google as a response to requesting a refresh or reload of a map or its layers. –  Apr 28 '16 at 16:20
  • I've ended up contacting Google about this and filing a bug report at the suggestion of their support. I've had some fellow devs look at this, and some said that it may have something to do with the character / query length, others said that there's no real pattern as to when the issue happens, others have had trouble replicating the issue consistently. –  May 04 '16 at 14:43
  • @Kiwithing can I know how did you decode the URL in the first place ? – Ashar Jul 25 '16 at 13:34
  • @Ashar By looking at the request / response headers when the query to Fusion Tables was submitted. I ended up abandoning Google Fusion Tables for this project, unfortunately. –  Jul 25 '16 at 17:30
  • @Kiwithing where did you file the bug report? I'm seeing this problem too. – arxpoetica Aug 04 '17 at 18:26

2 Answers2

13

I solved this by opening Chrome Developer Tools and going to: Application > Clear storage > Clear site data. Then, with Developer Tools still open, click and HOLD the refresh button on the upper left corner of the browser until you see the words "Empty Cache and Hard Reload." Click that, and you're good to go.

arxpoetica
  • 4,841
  • 3
  • 30
  • 35
  • This certainly worked for me when gmaps in the browser would load map tiles, but then after populating other areas of the DOM the map tiles would disappear. Switching to satellite view loaded those tiles, but overlays were missing etc. The full cache clear as documented above worked perfectly and on sign in maps is working again. – alexleonard Aug 17 '17 at 08:44
  • That was exactly my issue and fixed by exactly mentioned here. Thanks! – samxiao Nov 23 '17 at 04:55
0

I encountered the same issue. It is caused when the CSS on the page for the map results with fusion table layers doesnt align with map parameters. I fixed the CSS and the maps began to appear.

tindu edward
  • 299
  • 1
  • 3
  • 17