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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:22:32+00:00 2026-05-28T07:22:32+00:00

I have implemented a javascript menu allowing users to change to different map views

  • 0

I have implemented a javascript menu allowing users to change to different map views using the Google Fusion Table overlays. Unfortunately, my dropdown menus don’t work separately or together. For example, someone wants to see ports in “Middle East” Region only or someone wants to see ports in “Indian Sub-Continent” Region AND “ICD” Type of port.

Second problem seems to be the markers not showing up as identified in Fusion Table. They have different colors for “Shipping” and “ICD” for “Type” of port.

This is my work so far:

<!DOCTYPE>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fusion Map</title>

    <style>
        body {margin:0 auto; width:960px;}
        #map_div {height:550px; width:100%; margin-top:50px;}
    </style>

    <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
    <script>
        var tableid = 1102368;
        var layer = new google.maps.FusionTablesLayer(1102368);

        function initialize() {
        var ports = new google.maps.LatLng(35.173808, 37.236325);
        var myOptions = {
            center: ports,
            zoom: 3,
            mapTypeId:google.maps.MapTypeId.ROADMAP
        };

        var map = new google.maps.Map(document.getElementById('map_div'),
            myOptions);
                layer.setMap(map);
        }

        function refreshFusion() {
            var qry = "SELECT PortName, 'Region' FROM " + tableid;
            var region = document.getElementById('ddRegion').value;
            var type = document.getElementById('ddType').value;
            var filters = [];
            if(type != '') {
                filters.push("'Type' CONTAINS '" + type + "'");
            }
            if(type != '') {
                filters.push("'Region' CONTAINS '" + region + "'");
            }
            if(filters.lenght > 0) {
                qry += " WHERE " + filters.join(" AND ");
            }
            layer.setQuery(qry);
        }
    </script>

</head>

<body onload="initialize();">
    <div id="map_div"></div>

    <div>
        <h3>Region</h3> 
        <select id="ddRegion" style="width: 150px;" onchange="refreshFusion();">
            <option value="">All</option>
            <option value="Middle East">Middle East</option>
            <option value="Red Sea">Red Sea</option>
            <option value="East Mediterranean">East Mediterranean</option>
            <option value="West Mediterranean">West Mediterranean</option>
            <option value="Adriatic">Adriatic</option>
            <option value="Black Sea">Black Sea</option>
            <option value="North Africa">North Africa</option>
            <option value="Indian Sub-Continent">Indian Sub-Continent</option>
        </select>
        <h3>Type</h3> 
        <select id="ddType" style="width: 150px;" onchange="refreshFusion();">
            <option value="">All</option>
            <option value="Shipping">Shipping</option>
            <option value="ICD">ICD</option>
        </select>
    </div>
</body>
</html>

Here is the Fusion Table: Link

Here is the Live Code: Link

Any and all help is greatly appreciated!

  • 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-05-28T07:22:33+00:00Added an answer on May 28, 2026 at 7:22 am

    You will also want to change the SELECT clause in your query to the following:

    "SELECT PortName FROM " + tableid;
    

    since only the location column should be in the SELECT clause of a Fusion Tables Layer query.

    In general, you might want to consider using the new Fusion Tables Layer syntax as well. An example can be seen here:

    http://code.google.com/apis/fusiontables/docs/samples/change_query.html

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

Sidebar

Related Questions

I have implemented Simple Google Map Direction Api Javascript in my webpage. When my
I have implemented a dynamic creation of a HTML table using AJAX. Here's what
I have a menu implemented using a set of nested accordions, 1 and 2
I have implemented the Google map successfully. But one more thing has left to
I have implemented google map in my project . I've set all the required
Possible Duplicate: Can Read-Only Properties be Implemented in Pure JavaScript? I have an Object
I have implemented VirtualPathProvider class so I can keep all my views in the
I have implemented tracing based on System.Diagnostics. I am also using a System.Diagnostics.TextWriterTraceListener, and
We have implemented a popup window as a modal dialog using the IE method:
I have implemented a linked list as a self-referencing database table: CREATE TABLE LinkedList(

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.