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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:31:39+00:00 2026-06-08T18:31:39+00:00

I’m trying to create a reset button in a Fusion Tables Map, to once

  • 0

I’m trying to create a reset button in a Fusion Tables Map, to once it is clicked all the markers show up. But something is not working on it. Please take a look:

HERE’S THE ENTIRE CODE:

Actually I tryed to “mimic” the function initialize() from the layer10 part in the function clearBox(). I also tryed to use the method reset(), but it didn’t work too.

<!DOCTYPE html>
<html>
<head>
<style>
#map-canvas { width:500px; height:600px; }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var map;
var layerl0;
function initialize() {
  map = new google.maps.Map(document.getElementById('map-canvas'), {
    center: new google.maps.LatLng(-30.070876662388095, -51.1907958984375),
    zoom: 12,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  layerl0 = new google.maps.FusionTablesLayer({
    query: {
      select: "'ENDERECO'",
      from: '3385625'
    },
    map: map
  });
}
function changeMapl0() {
  var searchString = document.getElementById('search-string-l0').value.replace(/'/g, "\\'");
  layerl0.setOptions({
    query: {
      select: "'ENDERECO'",
      from: 3385625,
      where: "'TIPO' = '" + searchString + "'"
    }
  });
}
google.maps.event.addDomListener(window, 'load', initialize);

//Function to be activated by the reset button
function clearBox() {
document.getElementById('search-string-l0').value = "";
  layerl0 = google.maps.FusionTablesLayer({
    query: {
      select: "'ENDERECO'",
      from: '3385625'
    },
  });
}

 </script>
 </head>
 <body>
<div id="map-canvas"></div>
<div style="margin-top: 10px;">
  <label>Tipo</label>
  <select id="search-string-l0" onchange="changeMapl0 (this.value);">
    <option value="">--Select--</option>
    <option value="Comidas variadas">Comidas variadas</option>
    <option value="Restaurante">Restaurante</option>
    <option value="Bar">Bar</option>
    <option value="Hotel">Hotel</option>
    <option value="Shopping Center">Shopping Center</option>
    <option value="Teatro">Teatro</option>
    <option value="Igreja">Igreja</option>
    <option value="Museu">Museu</option>
    <option value="Espaço de Cultura">Espaço de Cultura</option>
  </select><br/>
<input type="button" onclick="clearBox()" value="Reset Map" />
</div>
</body>
</html>
  • 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-08T18:31:41+00:00Added an answer on June 8, 2026 at 6:31 pm

    Sounds like you need to reset your query like this map from this recent post on SO

    Looking at your complete code, the simplest way to make it work is to change your reset function to just change the query, not recreate the FusionTablesLayer:

    change:

    function clearBox() {
    document.getElementById('search-string-l0').value = "";
      layerl0 = google.maps.FusionTablesLayer({
        query: {
          select: "'ENDERECO'",
          from: '3385625'
        },
      });
    }
    

    to:

    function clearBox() {
    document.getElementById('search-string-l0').value = "";
      layerl0.setOptions({
        query: {
          select: "'ENDERECO'",
          from: '3385625'
        }
      });
    }
    

    Note: I also removed an extraneous comma that would probably cause issues in IE.

    Working Example

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

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.