Search code examples
javascriptgoogle-mapsgoogle-maps-api-3google-fusion-tables

Query and Update fusion table via HTML form?


I'm pretty new to google maps and fusion tables. I was wondering if it is possible to return queried information from a fusion table and write it into a page using something like innerHTML. Also, I would like to be able to update a fusion table using a standard HTML form. Is this possible and if so can you point me in the right direction? I've been searching around with no results, but it might just be that I don't know how to pose the question. Let me explain as best I can what I'm looking for:

I have a google map with a kml polyline layer. I would like to be able to enter a query into an HTML form (for instance a range of dates, a feature ID, etc.) or click a line feature that has an ID that corresponds to an ID in a fusion table, and run a query that would return the attribute data for the corresponding table entry. Note that the fusion table has no geocoded information, I am just using it as a spreadsheet (I think I understand that fusion tables are easier to query/access than google spreadsheets, but please correct me if I'm wrong).

The form input is pretty self-explanitory - I would just like to be able to enter some info into a form and create a new row in a fusion table.

Thanks in advance for the help/smackdown (whichever it may be)!

Mike


Solution

  • "I want to be able to write the attribute information into the page below my map (using innerHTML)."

    This is definitely possible using the "undocumented" Fusion Table JSNOP API. I've used this approach often. I described it in this answer and posted several examples as well: https://stackoverflow.com/a/9778985/1211981

    As Odi explained, updates/inserts from the browser are more complicated.