custom checkbox filters do not appear to work with new template
JackDougherty opened this issue · comments
Hi Derek,
Good to see your new template, but I am unable to make custom checkbox filters work when following your updated directions. I suspect that this may be a bug, so am posting here. But maybe I'm missing something.
Here's sample code of checkbox based on your new template:
https://github.com/JackDougherty/public-toilets-copenhagen2
demo (broken checkbox filters)
http://jackdougherty.github.io/public-toilets-copenhagen2/
draws on this table
https://www.google.com/fusiontables/DataSource?docid=1wGi1FwsQeWNcU30Z1EstCfXWbM2cEie0qK3oalIY#rows:id=1
I tried following your updated directions for checkbox filters. Neither string (type) or numeric (typenum) worked when I pasted them into maps_lib.js around line 155
https://github.com/derekeder/FusionTable-Map-Template/wiki/Filter-examples#checkboxes
See screenshot of error message re: bad request in jquery-1.10.2.min.js
I think it's a bug because the same GFT works fine when filtering through your older (2014) template:
demo
http://jackdougherty.github.io/public-toilets-copenhagen/
code
https://github.com/JackDougherty/public-toilets-copenhagen
thanks
Jack
I'm also getting the same error when attempting to update my older GFT Checkbox example to the new template.
demo
http://jackdougherty.github.io/FusionTable-Map-Checkboxes2/
code
https://github.com/JackDougherty/FusionTable-Map-Checkboxes2/
I haven't had a chance to look through all of your code yet, but note the change from whereClause to self.whereClause in this version. It tripped me up for a minute. Let me know if this helps at all.
Jen - Thanks for the tip. Yes, I saw the self.whereClause as Derek described here:
https://github.com/derekeder/FusionTable-Map-Template/wiki/Filter-examples#checkboxes
and tried inserting both the numeric and string versions of the self.whereClause filter in my code above, but no luck.
@JackDougherty @jengalas thanks for pointing this out! I'll update the wiki accordingly!
@JackDougherty oh I see there's something else going on here. Checking it out ...
Think the problem is glyphicon. I got this in Firebug http://tinemuller.dk/div/template_derek_eder/bootstrap.min.css.jpg when testing http://tinemuller.dk/GFT2/ and have send an e-mail to Derek and also JackDougherty but I can see it next time will be better to post it here.
@JackDougherty it looks like your locationColumn
is set to 'geometry' when your Fusion Table is using 'Latitude'
Here's the response from the API: https://www.googleapis.com/fusiontables/v1/query?sql=SELECT%20Count%28%29%20%20FROM%201wGi1FwsQeWNcU30Z1EstCfXWbM2cEie0qK3oalIY%20%20WHERE%20geometry%20not%20equal%20to%20%27%27%20AND%20%27typenum%27%20IN%20%28-1%2C1%2C2%2C3%29&key=AIzaSyDIevSvpV-ONb4Pf15VUtwyr_zZa7ccwq4
@derekeder - yes, my mistake! Fixed it in both maps. Sorry to trouble you. Will update my code comments to help others avoid making the same error. thanks
all set now in
http://jackdougherty.github.io/public-toilets-copenhagen2/
and
http://jackdougherty.github.io/FusionTable-Map-Checkboxes2/
I have a working (if unorthodox) demo here if it helps at all ...
http://streetrailway-jengalas.rhcloud.com/northern-electric/maps/
@JackDougherty yay! Glad to see its working.
I also just pushed up a change that restores the console error logging when queries fail, so this should be easier to catch and debug next time.
Oh, good to see you have resolved it.
One thing I noticed yesterday is that the "reset" does not seem to reset the checkboxes correctly. I didn't post the issue yet because I don't have a public demo of the problem available yet, but I can see the same behavior in your demos. The initial state has the checkboxes checked, but try unchecking some and then hitting Reset. The results count will go back to the initial value, but the boxes remain unchecked. (I'll open another issue for this if necessary.)
@jengalas Thanks - please do open up a new issue!