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 7899425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:41:57+00:00 2026-06-03T08:41:57+00:00

hope this makes sense. I have merged together two tables one containing information about

  • 0

hope this makes sense. I have merged together two tables one containing information about telephone exchanges and their specific location in the uk and another containing region info for the uk. What I want to do is when I roll over or click on a region I want to be able to list all the exchanges that fall into that area on a panel on my web page. At the moment when I click on a region the last exchange in the table is displayed. I’m guessing this could be something simple that I need to do within my addListeners2() function. Any pointers in the right direction would be greatly appreciated.

var map, layer;   
function initialize() 
{

    map = new google.maps.Map(document.getElementById('map_canvas'), {
            center: new google.maps.LatLng(54.54658,-4.87793),
            zoom: 6,
            mapTypeId: google.maps.MapTypeId.ROADMAP
          });
          loadPoint();            
    }  

        function loadPoint() 
        {
           if (layer != null) 
           {
                layer.setMap(null);
                google.maps.event.clearInstanceListeners(layer);
           }
           var tableid = '3569550';
           layer = new google.maps.FusionTablesLayer
           ({
                query: 
                {
                    select: 'LATITUDE',
                    from: tableid
                    //where: 'latitude is not null'
                },

            map: map                
           })
            layer.enableMapTips({
            select: "'REGION','EXCHANGE','MPF','WLR','SMPF','BB_CONNECT'", // list of columns to query, typially need only one column.
            from: tableid, // fusion table name
            geometryColumn: 'LATITUDE', // geometry column name
            suppressMapTips: true, // optional, whether to show map tips. default false
            delay: 100, // milliseconds mouse pause before send a server query. default 300.
            tolerance: 8 // tolerance in pixel around mouse. default is 6.
            });
            addListeners1();
        }

        function loadRegion() 
        {
           if (layer != null) 
           {
                layer.setMap(null);
                google.maps.event.clearInstanceListeners(layer);
           }
           var tableid = '3569550';
           layer = new google.maps.FusionTablesLayer
           ({
                query: 
                {
                    select: 'geometry',
                    from: tableid
                },

            map: map                
           })
            layer.enableMapTips({
            select: "'REGION','EXCHANGE','MPF','WLR','SMPF','BB_CONNECT'",
            from: tableid, // fusion table name
            geometryColumn: 'geometry', // geometry column name
            suppressMapTips: true, // optional, whether to show map tips. default false
            delay: 100, // milliseconds mouse pause before send a server query. default 300.
            tolerance: 8 // tolerance in pixel around mouse. default is 6.
            });
            addListeners2();
        }

        function addListeners1() 
        {
            google.maps.event.addListener(layer, 'mouseover', function(fEvent) 
            {
                var row = fEvent.row;
                myHtml = '<TABLE width = "600" cellspacing="0" cellpadding="0"><TR>';
                myHtml += '<TD><b>REGION</b></TD>';
                myHtml += '<TD><b>EXCHANGE</b></TD>';
                myHtml += '<TD><b>MPF</b></TD>';
                myHtml += '<TD><b>WLR</b></TD>';
                myHtml += '<TD><b>SMPF</b></TD>';
                myHtml += '<TD><b>BB_CONNECT</b></TD></TR><TR>';
                for (var x in row) 
                {
                    if (row.hasOwnProperty(x)) 
                    {
                        myHtml += '<td>' + row[x].value +'</td>';
                    }
                }
                myHtml += '</TR></TABLE>';
                document.getElementById('info').innerHTML = myHtml;
            });
        }

        function addListeners2() 
        {
            google.maps.event.addListener(layer, 'mouseover', function(fEvent) 
            {
                var row = fEvent.row;
                myHtml = '<TABLE width = "600" cellspacing="0" cellpadding="0"><TR>';
                myHtml += '<TD><b>REGION</b></TD>';
                myHtml += '<TD><b>EXCHANGE</b></TD>';
                myHtml += '<TD><b>MPF</b></TD>';
                myHtml += '<TD><b>WLR</b></TD>';
                myHtml += '<TD><b>SMPF</b></TD>';
                myHtml += '<TD><b>BB_CONNECT</b></TD></TR><TR>';
                for (var x in row) 
                {
                    if (row.hasOwnProperty(x)) 
                    {
                        myHtml += '<td>' + row[x].value +'</td>';
                    }
                }
                myHtml += '</TR></TABLE>';
                document.getElementById('info').innerHTML = myHtml;
            });
        }
}
  • 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-03T08:41:58+00:00Added an answer on June 3, 2026 at 8:41 am

    I have found the solution!!!

    function loadRegion() 
    {
        if (layer != null) 
        {
            layer.setMap(null);
            google.maps.event.clearInstanceListeners(layer);
        }
        layer = new google.maps.FusionTablesLayer
        ({
            query: 
            {
                select: 'geometry',
                from: tableid
            },
            map: map                
        })
        google.maps.event.addListener(layer, 'click', function(e) 
        {
            if (e && e.row && e.row["REGION"]) 
            {
                query4infowindowData(e.row["REGION"].value);
                infowindow.setPosition(e.latLng);
            } 
            else 
            {
                alert("no row:"+e.latLng);
            }
        });
    }
    function query4infowindowData(term) 
    {
        var queryText = "SELECT 'REGION', 'EXCHANGE', 'MPF', 'WLR', 'BB_CONNECT', 'SMPF' FROM "+tableid+" WHERE 'REGION' = '"+term+"';";
        var encodedQuery = encodeURIComponent(queryText);
        var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq='  + encodedQuery);
        query.send(openInfoWindow);
    }
    function openInfoWindow(response) 
    {
        if (!response) 
        {
            alert('no response');
            return;
        }
        if (response.isError()) 
        {
            alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
            return;
        } 
        FTresponse = response;
        numRows = response.getDataTable().getNumberOfRows();
        numCols = response.getDataTable().getNumberOfColumns();
        var dataTable = response.getDataTable();
        var contents = "REGION: <u><b>"+dataTable.getValue(0,0)+"</b></u><br><table border='1'><tr><th>#</th><th>EXCHANGE</th><th>MPF</th><th>WLR</th><th>BB_CONNECT</th><th>SMPF</th></tr>";
        for(i = 0; i < numRows; i++) 
        {
            contents += "<tr><th>"+i+"</th><td>"+dataTable.getValue(i,1)
                +"</td><td>"+dataTable.getValue(i,2)
                +"</td><td>"+dataTable.getValue(i,3)
                +"</td><td>"+dataTable.getValue(i,4)
                +"</td><td>"+dataTable.getValue(i,5)
                +"</td></tr>";
        }
        contents += "</table>";
        document.getElementById('info').innerHTML = contents;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this makes sense. I have created several WPF User Controls. The lowest
I hope this makes sense. I have a Windows Phone 7 app that is
I have an issue with jQuery and Safari (5.03). Hope this makes sense. I
I have a process that I need to follow, I hope this makes sense.
I hope this makes sense. I have a ASP.NET web application that uses Entity
Bit tricky to communicate but hope this makes sense. I have 8 div containers
First time here so I hope this makes sense! I have a Map which
I have a collection of dictionaries like so (hope this makes sense, did on
Hope this makes sense... Is there a simple way to return a set of
I hope this makes sense, I am trying to store a SQL Server 2008

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.