Note that there are some explanatory texts on larger screens.

plurals
  1. POFiltering google map by check box not work properly
    primarykey
    data
    text
    <p>I am trying to develop a google map using Fusion Table. I want to filter the map by checkbox. But it is not working properly. This is my code</p> <pre><code>&lt;form&gt; &lt;input type="checkbox" checked="checked" name="store" value="male" onclick="filterData()"&gt;Male &lt;input type="checkbox" checked="checked" name="store" value="female" onclick="filterData()"&gt;Female &lt;/form&gt; &lt;div id="map_canvas"&gt;&lt;/div&gt; &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; var map; var layer_0; function initialize() { map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(9.35300524537724, -82.31857926757817), zoom: 7, mapTypeId: google.maps.MapTypeId.ROADMAP }); layer_0 = new google.maps.FusionTablesLayer({ query: { select: 'sex', from: "1Cr2ObveEaSINhSVx1D9rZQN06o5aRxxcf8lFE6Y" }, map: map }); } function filterData() { var filter = []; var stores = document.getElementsByName('store'); for (var i = 0, store; store = stores[i]; i++) { if (store.checked) { filter.push('\'' + store.value + '\''); } } if (filter.length) { if (!layer.getMap()) { layer.setMap(map); } layer.setOptions({ query: { select: 'sex', from: "1Cr2ObveEaSINhSVx1D9rZQN06o5aRxxcf8lFE6Y", where: '\'sex\' IN (' + filter.join(',') + ')' } }); } else { layer.setMap(null); } } &lt;/script&gt; </code></pre> <p>map is showing but checkbox is not working. Where is the problem? Please tell me the solution.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload