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
"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.
There are several possible solutions to your use case. I suppose you want to a JavaScript-only solution which runs in the browser with no server side code.
To display data from a Fusion Table on Google Maps you should use the FusionTablesLayer, which makes this task really easy and straightforward. There are good examples from Google, e.g. how to change a query using a form or create custom InfoWindows (which would be the preferred way to show data corresponding to what is clicked on the map). If you don't want to care about authentication, just make your tables public, then it should be easy to adapt the examples to your tables.
Another thing is to write data to Fusion Tables: it's not that easy, because here you must care about authentication, see the OAuth guide for detailed information. But at the moment it is not possible to write data directly from the browser to the Fusion Table. But there is hope: With the new Trusted Tester API you can actually do it, but you have to join this group before you can start.
If you can't / don't want to use the new API, consider the server-side approach that I explained here using a script to relay your requests.
Related
I have an apparel list in Google Sheets with the following columns:
This is only a little part of it. It actually has over 9K items. So here's the thing, I have to manually search each of those legacy numbers on a HTML list provided by the client, which looks like this:
As you can see on the last column, there are some texts like "Completed", "Customer Review", etc. Those values have to be parsed on the google sheet "Status" column. After reviewing some orders and copying those values, the sheet looks like this:
Now, imagine doing this process individually with 9K+ orders, it's a pain in the ass. So I thought there could be a way to automatize this, maybe parsing the values from the HTML through some Javascript to a CSV or anything similar. I've been doing some research but haven't found anything. I'm not asking you to do the job for me. I'm looking for a hint to start this correctly, as it would make a lot easier and faster the work.
Note: this "automatization" isn't a task or job requested to me, I'm a designer (with some programming background) and I have to do the manual process with a deadline, so I thought I could try and speed up this.
Thanks in advance.
I would try using IMPORTHTML so you can add the data from the HTML list on a different tab in Google sheets and then perform an INDEX MATCH or an ArrayFormula to get the data that you need.
There are many ways to compare the data that you need using different formulas, if you can create a demo sheet we could help you finding a formula that could perform the query of the data that you need. As a friendly reminder always try to include a minimal example that reproduces the issue. That way we can provide better insights about what you want to achieve.
this community has been really helpful so far!
Does anyone know if there is a possibility of getting the region outline from Google Maps and getting an array of elements within that area? For example, if I type "Brooklyn", I would like to get an array of the properties advertised in my website. I can't find documentation on the API docs...
Thanks,
Eric
This is not possible in mysql.
You need to store that data in some graph database like neo4j. Mysql is not meant to store such points / graph data. You can only store tabular data in mysql.
I am wondering and sadly I don't know where else to ask the question.
I want to make a interactive chart using the top 5 downloaded movies.
And the current box office top 5. How i'm going to make this interactive is beyond me yet.
What I would like to know first is, if there is any way to manipulate or change the given chart from Mojo.
Right now I use:
http://boxofficemojo.com/about/data.htm
With the code given by Mojo:
<script type="text/javascript" language="javascript" src="http://www.boxofficemojo.com/data/js/wknd5.php?h=myclass1&r=myclass2"></script>
This just shows me the top 5 (see example at the previously provided URL).
Is there any way that I can use that chart and make a, pie chart or any other chart or graph out of it?
And if this is possible will it still update with money and new movies every time the site does, like the given chart with the javascript code does right now?
Hopefully someone can help me or maybe has a different way of making a chart/graph out of this data (the box office top 5).
So to be more clear. I would like to create my own chart/graph with the box office top 5 data. And I would also like it to be "live" and update itself when ever the top 5 changes or the numbers change.
There for it doesn't seem like the best idea to create my own Json with data since it won't update when the data updates without me making changes into the Json file.
The interactive part doesn't matter yet.
You want to create a chart with live data.
First thing is getting the data.
The script you are including basically creates the chart for you. So you don't have direct access to the data itself, so it would be a little tricky to use that.
You should google around for a,preferrably REST API, that provides you with data on-demand.
1. Find a suitable REST API and perform calls to fetch data
You perform HTTP requests to the API and it provides data - so on page-load for example you will request data from this API. So each time a user loads your website a call is made and it fetches the most recent data on movies.
2. Parse the data, perform calculations and built your own custom JSON
Then you need to parse that data - Take from this raw feed the data you actually need - perform calculations if needed(from what I take from your question, it's gonna be simple elementary school maths), then build you own custom JSON data structure that can be used to display the data.
3. Visualize the JSON
Include a JS library that renders Charts. Chart.js, is an excellent example and it's dead-simple to provide a JSON and render a really nice looking chart.
That's how it ,usually, goes.
I'm creating a Spotfire/JavaScript mashup and I'd quite like the user to be able to select the most appropriate visualisation/analysis from a dropdown list.
However, I'd rather not hard-code the list of analyses, I'd prefer it if there was some way to programmatically poll the webplayer application and get back a list of analyses in the webplayer library. There doesn't seem to be anything obvious in the API.
How would I go about doing this?
The Spotfire Library appears to be implemented as several tables in the Spotfire database with "LIB" prefix.
We can retrieve relevant analysis meta data from the Library with something like following query, for example:
SELECT LIB_ITEMS.TITLE,LIB_ITEMS.DESCRIPTION,LIB_ITEMS.CONTENT_SIZE
FROM LIB_ITEMS
WHERE LIB_ITEMS.ITEM_TYPE = (SELECT LIB_ITEM_TYPES.TYPE_ID FROM LIB_ITEM_TYPES WHERE LIB_ITEM_TYPES.LABEL = 'dpx')
ORDER BY LIB_ITEMS.TITLE ASC
Hope this helps. :)
I'm looking to create or find a screener tool similar to this that will read through the records in a database, allow you to select the criteria, create a histogram of said records and criteria, and allow the user to sort and filter through the data, just like the Google Stock Screener.
How would I go about creating something like this or is there somewhere that I could find a plug-in that would allow this? Thanks.
I think Flot would be a good javascript library to try for this. I've used it to display share market data in the past and it deals with time series data fairly well. It's not very hard to add interactive elements.