Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have this javascript which I am working on but the map in the HTML is just not displaying. I have a similar fusion table with layer_1 which is displaying fine but when I put layer-2 instead of layer_1 and pull up a different tableid with same code. The map does not show up.

var tableid_2 = 431xxxx; 
var layer_2;
var queryUrlHead = 'http://www.google.com/fusiontables/api/query?sql=';
var queryUrlTail = '&jsonCallback=?';
var zoom = 7;
var latlng = new google.maps.LatLng(3x.7996, -11x.1668);

function initialize() {

var myOptions = {
    zoom : zoom,
    center : latlng,
    mapTypeId : google.maps.MapTypeId.TERRAIN,
    mapTypeControl: true,
    mapTypeControlOptions: {
    style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
    position: google.maps.ControlPosition.TOP_LEFT
},
    scaleControl: true,
    scaleControlOptions: {
    position: google.maps.ControlPosition.BOTTOM_LEFT
},
};

var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);




layer_2 = new google.maps.FusionTablesLayer(tableid_2);
var qry = "SELECT 'Location2', 'Name2','URL' FROM " + tableid_2;
layer_2.setMap(map);
    layer_2.enableMapTips({
        select: "'Name2'",
        from: tableid_2,
        geometryColumn: 'Location2', 
        suppressMapTips: false, 
        delay: 50,
        tolerance: 5
});
    addListeners();



layer_2.setQuery(qry);

var col_list = 'Name2';

if(order_list && order_list !== 'Name2') {
    query += " ORDER BY " + order_list;
}

var queryurl = encodeURI(queryUrlHead + qry + queryUrlTail);




$.ajax({
    type : "GET",
    url : queryurl,
    dataType : "jsonp",
    success : dataHandlerCallback,
    error : function() {
        alert("AJAX ERROR for " + queryurl);
    }
});
share|improve this question
    
What is going on with your code new google.maps.LatLng(3x.7996, -11x.1668); ? –  tmcw Jun 26 '12 at 17:27

1 Answer 1

If the code really works for Layer 1 then the only thing that I can think of is to double check to make sure that your second Google Fusion Table is not set as private file, which is the default setting when uploading new data if I recall correctly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.