Creating a sidebar that references Google Fusion Table - google-fusion-tables

I am trying to create a sidebar to go along with the google map visualization I've created with fusion tables. I found this page fusion table with sidebar with an updated SQL query statement. I've tried implementing a similar statement and I am unable to view the map. What am I doing wrong? Here is my code with the SQL statement:
https://gist.github.com/anonymous/0a9214027de977e40ed04b9db17cc7f7

I don't have the expertise or time to correct all the JavaScript at moment, but I can see a few issues I noticed that could be causing you issues.
You don't have an API call included in the query, which
can be found/created at
https://console.cloud.google.com/apis/library.
You're not querying the correct column for your location (col4, not col2). It starts at 0; so col0, col1, ...
You need to create a map and then load the Fusion Table layer over it.
There's possibly a few more issues I didn't immediately see. An alternative to trying to fix this custom code is to use the "Searchable Map Template" by Derek Elder. It uses Bootstrap for CSS, you plug in your API key, Google Fusion Tables ID, and the location column. It allows for filters to be input, like your Genre drop-down menu. It's free, fairly well documented, and has a support group to help with any questions or issues.
Maybe that's what you need if you just want a quicker fix. I realize I didn't exactly answer your question, but if you could upvote the answer if it was a least somewhat useful, I'd appreciate it.

Related

Looking to add a dynamically adding rows table with multiple fixed columns which can fill value's to Google form and bring response to Google Sheets

I'm trying to create a table with editable cells in a google form that lets people enter their response. It would have multiple fixed columns and dynamically adding rows for more response.
Sample image of the desired table in google form for response
I am naive about building google forms and running scripts/codes on forms. A detailed explanation of steps will be of good help.
Thanking in advance to wonderful people who do such fabulous work
At the moment it is not possible to insert tables in Google Forms, not even via Apps Script, but since you are interested in learning about Forms and Scripts I would recommend you start with this quickstart about managing Form responses.
If you explain perhaps with more detail what your goal by inserting the table is, maybe there is a way with the available options in forms to achieve it.

Search term in Google Drive to filter for Fusion Tables

It used to be possible to filter for fusion tables using a type: query. But now there appears to be no string to put after type: in the drive.google.com search field to filter out the fusion tables.
Does anyone know of an answer or workaround for this?
We do use the Fusion table API, and I know how to list tables that way. But if the tables are effectively hidden in the human UI, it becomes very hard to find and share them by hand rather than programmatically.
You can add app:"Google Fusion Tables" to the Drive search bar. Unfortunately this was removed from the UI, but the keyword still works.
In the Google Drive search box, try the following:
type:table

Need Google App Script to Generate Fusion Table Views

Is it possible to use Google App Script to create fusion table views (from an existing FT) and, optionally with filter settings? I need to enumerate the columns of the FT (which I know how to do) and create different views and ideally, I need to get their URLs too. I have not seen any documentation or examples that discuss this.
OK, I found the docs that show how to do this. See: https://developers.google.com/fusiontables/docs/v2/sql-reference#createView

linking fusion tables visualizations, offering search over fusiontables

So I've got a couple of different fusiontable visualizations in a google site:
https://sites.google.com/site/hlsbeta123123123123/
I am wondering if there is a way to link them so that when a pin in the map is selected the corresponding card is shown in the other iframe?
What I'd really like to be able to do is offer people a search over the fusion table via the google site, so that when somebody searched in the site search, they'd get back a list of hits in the map and cards, and have them all linked up together ... Any simple way to do this over paired visualizations or would this have to be custom site built on the fusiontables API?
I know fusion tables wizard:
http://fusion-tables-api-samples.googlecode.com/svn/trunk/FusionTablesLayerWizard/src/index.html
can provide something like this for a single visualization, but am unclear about linking multiple visualizations - maybe that's just completely impractical ...
Many thanks in advance
Cheers> SAM
p.s. Here's a current screenshot in case it the site changes :-)
It's possible, but instead of the iframe-map you must create the map on your own to be able to modify the default behaviour(opening of the infoWindow on click and load the filtered card instead).
It's not much difficult, the most of the src you will get with map->publish->get HTML and javascript
All you have to do is:
supress the infoWindows(set the suppressInfoWindows-option of the layer to true)
observe the click-event of the layer and load the card based on a unique col(Charity Number appears to be unique)
google.maps.event.addListener(layerl0, 'click',function(e){
document.getElementById('cards')//iframe-element
.src='https://www.google.com/fusiontables/embedviz?viz=CARD&q=select+*+from+1ZnLJPfdXgiD49s3JO9Vyhf0VPGgBnzs-985jT3s+where+col1+%3D+'+e.row['Charity Number'].value+'&tmplt=4&cpr=1';
});
Demo: http://jsfiddle.net/doktormolle/YVnus/
But actually showing the cards in an iframe forces a redundant request, instead you may fetch the contents of the infoWindow and insert them directly into the page.

Leaving out blank fields in fusion info windows

I've mapped a number of addresses with various fields of data in my table. How can I show a field for which I have data for one address but make sure it does not show in the info window for the addresses that have no such data?
For example, some of my addresses are properties that have been demolished. My table includes that info and the cost of the demolition. Is there something I can write in the code to make the "Cost of demolition" field show in the windows for the addresses that have a value for that field, and not show in those that do not?
My apologies for such a basic question. I'm a journalist just learning his way around this stuff. I found one other question about displaying photos that seemed somewhat related but I wasn't sure that answered my question.
Thanks for the help.
The only way to do this using a little programming using the Fusion Tables Layer in the Google Maps API. It is not possible using the Fusion Tables UI alone. An example of how to change info window content based on data in the table is available here:
https://developers.google.com/fusiontables/docs/samples/change_infowindow_content

Resources