Search code examples
google-maps-api-3google-fusion-tables

Filter the results not replace them?


I am working on a google Map Api using fusion. I have multiple search queries and want them to filter the results. At the moment they overrule each other and don't work together the filter the results. The site is called earthquakedamagemap.com. It is my university project. Any help would be much appreciated.

I think it is the 'value.replace' attribute which needs changing?

    function changeMap2() { 
      var searchString = document.getElementById('search-string2').value.replace(/'/g, "\\'");  
      if(!searchString) {
        layer.setQuery("SELECT 'Latitude' FROM " + tableid);
        return;
      }
      layer.setQuery("SELECT 'Latitude' FROM " + tableid + " WHERE 'Updated Risk Assessment:' = '" + searchString + "'");
    }

Solution

  • I posted some example code: in this post not too long ago. You need to combine your search conditions with AND and call layer.setQuery with multiple search conditions only once. I don't think it has anything to do with your replace call as I didn't see any embedded single quotes in your input values.

    Eric