Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8148047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:34:00+00:00 2026-06-06T14:34:00+00:00

here’s a Fusion Tables map that’s broken after a search. It does everything well

  • 0

here’s a Fusion Tables map that’s broken after a search. It does everything well before I do a search. The points on the map just don’t show (although the information in the table below it gets updated).

What am I doing wrong?

//write the map on page load
$(document).ready(function() {

    createMap();

});

//ft layer
var layer;

//ft table
var tableid = 4176964;

//map
var map;

//geocoder instance
var geocoder = new google.maps.Geocoder();

//infowindow
var infowindow;

//gviz
var table;

//FT data in gviz object
var datatable;

//center of map
var center = new google.maps.LatLng(52.146973340644735, 4.7021484375);

//default zoom
var zoom = 7;
google.load('visualization', '1', {
    'packages': ['table']
});

function createMap() {
    //map options
    map = new google.maps.Map(document.getElementById('map_canvas'), {
        center: center,
        zoom: zoom,
        minZoom: 2,
        maxZoom: 12,
        scrollwheel: true,
        disableDragging: true,
        mapTypeControl: false,
        navigationControl: true,
        streetViewControl: false,
        scaleControl: false,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        navigationControlOptions: {
            style: google.maps.NavigationControlStyle.SMALL,
            position: google.maps.ControlPosition.RIGHT_TOP
        }
    });

    //intial fusion layer & supress fusion info window
    layer = new google.maps.FusionTablesLayer(tableid, {
        suppressInfoWindows: true,
        query: "SELECT Latitude FROM " + tableid,
        map: map
    });

    //adds click listener on layer
    google.maps.event.addListener(layer, 'click', function(e) {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
        if (infowindow) infowindow.close();
        else infowindow = new google.maps.InfoWindow();

        //write FT data to info window
        text = infowindow.setContent('<p>Op <b>' + e.row['Datum'].value + '</b> storte een ' + e.row['Type'].value + ' van ' + e.row['Vliegmaatschappij'].value +' met registratienummer ' + e.row['Registratie'].value + ' neer bij <b>' + e.row['Locatie'].value + '</b>.<p><p>Hierbij overleden ' + e.row['Slachtoffers'].value + ' van de ' + e.row['Inzittenden'].value + ' inzittenden en ' + e.row['Grond'].value + ' overleden op de grond.<p><p><a href="http://aviation-safety.net/database/record.php?id=' + e.row['ASN'].value + '" target="_blank">Meer informatie op Aviation Safety Network</a>.');

        infowindow.setPosition(e.latLng);
        map.setCenter(e.latLng);
        infowindow.open(map);
    });

    //query FT data for visualization
    var queryText = encodeURIComponent("SELECT Datum, Locatie, Type, Registratie, Vliegmaatschappij, Slachtoffers, Inzittenden, Grond FROM 4176964 ORDER BY 'Datum' ASC");
    var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText);
    query.send(getData);
}

//write FT data to table
var getData = function(response) {
    console.log('getData');
    console.log(response);
    table = new google.visualization.Table(document.getElementById('visualization'));
    datatable = response.getDataTable();
    table.draw(datatable, {
        showRowNumber: true
    });

    //add table listener when row clicked
    google.visualization.events.addListener(table, 'select', selectHandler);
}

//match table data to map data

function selectHandler() {

    //get lat/lng from FT
    var selection = table.getSelection();
    var Datum = datatable.getValue(selection[0].row, 0);
    var Locatie = datatable.getValue(selection[0].row, 1);    
    var Type = datatable.getValue(selection[0].row, 2);
    var Registratie = datatable.getValue(selection[0].row, 3);
    var Vliegmaatschappij = datatable.getValue(selection[0].row, 4);
    var Slachtoffers = datatable.getValue(selection[0].row, 5);   
    var Inzittenden = datatable.getValue(selection[0].row, 6);
    var Grond = datatable.getValue(selection[0].row, 7);

    infoWindowContent = ('<p>Op <b>' + e.row['Datum'].value + '</b> storte een ' + e.row['Type'].value + ' van ' + e.row['Vliegmaatschappij'].value +' met registratienummer ' + e.row['Registratie'].value + ' neer bij <b>' + e.row['Locatie'].value + '</b>.<p><p>Hierbij overleden ' + e.row['Slachtoffers'].value + ' van de ' + e.row['Inzittenden'].value + ' inzittenden en ' + e.row['Grond'].value + ' overleden op de grond.<p><p><a href="http://aviation-safety.net/database/record.php?id=' + e.row['ASN'].value + '" target="_blank">Meer informatie op Aviation Safety Network</a>.');

}


function changeSearch(dater) {
    dater = document.getElementById('newDatum').value;
    console.log('dater: ' + dater);

    //with a query based on the variables
    var sql = "SELECT Datum, Locatie, Type, Registratie, Vliegmaatschappij, Slachtoffers, Inzittenden, Grond FROM " + tableid + " WHERE Datum CONTAINS '" + dater + "' ORDER BY 'Datum' ASC";
    var polySql = "SELECT Latitude FROM " + tableid + " WHERE Datum CONTAINS '" + dater + "'";
    console.log('SQL: ' + sql);
    console.log('Polygon-SQL: ' + polySql);
    layer.setOptions({
        query: polySql,
        map: map
    });
    var queryText = encodeURIComponent(sql);
    var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText);
    query.send(getData);

    //adds a click listener on search layer
    google.maps.event.addListener(layer, 'click', function(e) {
        if (infowindow) infowindow.close();
        else infowindow = new google.maps.InfoWindow();

        //writes the info window on search layer
        infowindow.setContent('<p>Op <b>' + e.row['Datum'].value + '</b> storte een ' + e.row['Type'].value + ' van ' + e.row['Vliegmaatschappij'].value +' met registratienummer ' + e.row['Registratie'].value + ' neer bij <b>' + e.row['Locatie'].value + '</b>.<p><p>Hierbij overleden ' + e.row['Slachtoffers'].value + ' van de ' + e.row['Inzittenden'].value + ' inzittenden en ' + e.row['Grond'].value + ' overleden op de grond.<p><p><a href="http://aviation-safety.net/database/record.php?id=' + e.row['ASN'].value + '" target="_blank">Meer informatie op Aviation Safety Network</a>.');

        infowindow.setPosition(e.latLng);
        map.setCenter(e.latLng);
        infowindow.open(map);
    });
}
//end function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:34:03+00:00Added an answer on June 6, 2026 at 2:34 pm

    This works for a query on the map:
    SELECT Latitude FROM 4176964 WHERE Datum <= ’16 JAN 1950′

    I suspect you need to treat the data as a number (even though you specify it as a string)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the deal: I'm in the process of planning a mid-sized business application that
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the problem that I am trying to solve. I have two folders
Here's a query that works fine: SELECT rowid as msg_rowid, a, b, c FROM
here's what we have today: * NxM grid of points in 3D * we
Here is my code (Say we have a single button on the page that
Here's the flow that I am trying to achieve: 1) User uploads an audio
Here is another spoj problem that asks how to find the number of distinct
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here is the issue I am having: I have a large query that needs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.