One select box to query two separate Fusion Tables.

35 views
Skip to first unread message

Daniel Bentley

unread,
Apr 19, 2012, 7:54:07 AM4/19/12
to google-visua...@googlegroups.com
Hi all,

I've created this page here from two different table sources


And as you can see, the values queried from both tables are the same "Ashton, Brookfield..."

Is there a way to use one select box to show results for "Ashton" from both tables rather than change the values in each box?

Many thanks.

asgallant

unread,
Apr 19, 2012, 11:34:51 AM4/19/12
to google-visua...@googlegroups.com
You can merge those two functions together into one rather easily:

function changeMapl (val{
    // since you pass 'this.value' in the function call, you can get rid of those doc.getElement calls
    var searchString val.replace(/'/g"\\'");
    layerl0.setOptions({
        query{
            select"'geometry'",
            from3550449,
            where"'STwardname' = '" searchString "'"
        }
    });
    
    layerl1.setOptions({
        query{
            select"'Postcode'",
            from3560603,
            where"'Ward' = '" searchString "'"
        }
    });

Daniel Bentley

unread,
Apr 19, 2012, 12:58:12 PM4/19/12
to google-visua...@googlegroups.com
Thanks, what do I change to the select box code?

asgallant

unread,
Apr 19, 2012, 1:24:24 PM4/19/12
to google-visua...@googlegroups.com
Just change the function name (ie, from changeMapl0 -> changeMapl).

Daniel Bentley

unread,
Apr 19, 2012, 1:32:03 PM4/19/12
to google-visua...@googlegroups.com
ah ha! thank you very much for your help.

asgallant

unread,
Apr 19, 2012, 3:03:03 PM4/19/12
to google-visua...@googlegroups.com
You're welcome.
Reply all
Reply to author
Forward
0 new messages