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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:51:20+00:00 2026-06-08T03:51:20+00:00

I modified the coding (see below) to customize my own markers. BUT the checkboxes

  • 0

I modified the coding (see below) to customize my own markers. BUT the checkboxes don’t work anymore. Can anyone please help me figure out what is the problem? I have tried recoding several times but I still can’t make the checkboxes work..

<body>
<div id="map-canvas"></div>
                <img src='https://lh6.googleusercontent.com/-rk8_2yBXUUg/T-FbxjCq4WI/AAAAAAAAAGo/UIMF525RtLY/s37/ramp.png'/><input type="checkbox" value="4596492" id="markers_ramp" onclick="changeLayer(this.value);"/> Ramps<br/>
                <img src='https://lh6.googleusercontent.com/-iiPL-RHuq-I/T-FeawdppiI/AAAAAAAAAHY/G--PHmgTbQs/s37/stair.png'/><input type="checkbox" value="4597805" id="markers_stairway" onclick="changeLayer(this.value);"/> Stairways<br/>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>    
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">

    google.load('visualization', '1');

    function initialize() 
    {
        var infoWindow = new google.maps.InfoWindow();
        var map = new google.maps.Map(document.getElementById('map-canvas'), {
            center: new google.maps.LatLng(1.36940, 103.84856),
            zoom: 14,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        });


        // RAMP markers query 
        var ramp_query = "SELECT 'Type', Coordinates, Waypoints FROM 4597805";
        ramp_query = encodeURIComponent(ramp_query);

        var gvizQuery_ramp = new google.visualization.Query(
            'http://www.google.com/fusiontables/gvizdata?tq=' + ramp_query);

        var create_rampMarker = function(ramp_coordinate, type) 
        {
            var marker = new google.maps.Marker({
                map: map,
                position: ramp_coordinate,
                icon: new google.maps.MarkerImage('https://lh6.googleusercontent.com/-rk8_2yBXUUg/T-FbxjCq4WI/AAAAAAAAAGo/UIMF525RtLY/s37/ramp.png')
            });
            google.maps.event.addListener(marker, 'click', function(event) {
            infoWindow.setPosition(ramp_coordinate);
            infoWindow.setContent('<b>Type: </b>'+ type);
            infoWindow.open(map);
            });
        };        

        gvizQuery_ramp.send(function(response) 
        {
            var numRows = response.getDataTable().getNumberOfRows();

            // For each row in the table, create a marker
            for (var i = 0; i < numRows; i++) {
                var stringCoordinates = response.getDataTable().getValue(i, 1);
                var splitCoordinates = stringCoordinates.split(',');
                var lat = splitCoordinates[0];
                var lng = splitCoordinates[1];
                var ramp_coordinate = new google.maps.LatLng(lat, lng);
                var type = response.getDataTable().getValue(i, 0);

                create_rampMarker(ramp_coordinate, type);
            }
        });


        // STAIRWAY markers query 
        var stairway_query = "SELECT 'Type', Coordinates FROM 4596492";
        stairway_query = encodeURIComponent(stairway_query);

        var gvizQuery_stairway = new google.visualization.Query(
            'http://www.google.com/fusiontables/gvizdata?tq=' + stairway_query);

        var create_stairwayMarker = function(stairway_coordinate, type) 
        {
            var marker = new google.maps.Marker({
                map: map,
                position: stairway_coordinate,
                icon: new google.maps.MarkerImage('https://lh6.googleusercontent.com/-iiPL-RHuq-I/T-FeawdppiI/AAAAAAAAAHY/G--PHmgTbQs/s37/stair.png')
            });
            google.maps.event.addListener(marker, 'click', function(event) {
                infoWindow.setPosition(stairway_coordinate);
                infoWindow.setContent('<b>Type: </b>'+ type);
                infoWindow.open(map);
            });
        };        

        gvizQuery_stairway.send(function(response) 
        {
            var numRows = response.getDataTable().getNumberOfRows();

            // For each row in the table, create a marker
            for (var i = 0; i < numRows; i++) {
                var stringCoordinates = response.getDataTable().getValue(i, 1);
                var splitCoordinates = stringCoordinates.split(',');
                var lat = splitCoordinates[0];
                var lng = splitCoordinates[1];
                var stairway_coordinate = new google.maps.LatLng(lat, lng);
                var type = response.getDataTable().getValue(i, 0);

                create_stairwayMarker(stairway_coordinate, type);
            }
        });

    }   // function initialize

    google.maps.event.addDomListener(window, 'load', initialize);


    function changeLayer(tableidselections) 
    {
        if (tableidselections == 4596492) {
            if (document.getElementById("markers_ramp").checked == true) {
                stairway_query.setMap(map);
            }
            if (document.getElementById("markers_ramp").checked == false) {
                stairway_query.setMap(null); /*layersetoff*/
            }
        }

        if (tableidselections == 4597805) {
            if (document.getElementById("markers_stairway").checked == true) {
                stairway_query.setMap(map);
            }
            if (document.getElementById("markers_stairway").checked == false) {
                stairway_query.setMap(null); /*layersetoff*/
            }
        }

    }   // function changelayer

</script>
  • 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-08T03:51:22+00:00Added an answer on June 8, 2026 at 3:51 am

    One way to fix the problem is to make arrays of markers using the query, then hide and show them using setMap

    working example

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

Sidebar

Related Questions

I'm not a developer, so I don't know too much about coding/programming. But I
can this code snippet be modified to reveal html coding? <?php $_option = $this->getOption()
Can anyone give me a hand? This is for a charity event and coding
I modified an example with threads and got the example with multiprocessing included below.
I've modified my run.sh file and added JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n but when I start
I have been coding with C# for a good little while, but this locking
C files can be modified from .c to .m files and can be called
I really new to Python and coding in general, but I have been making
I am coding a dynamic query editor with knockoutjs, but ko.toJSON is not outputting
Modified the code this time the objective to count the line of code was

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.