0

http://zoofinder.us/map2.html https://www.google.com/fusiontables/DataSource?docid=1EawtHPl3kbnsXqzPPxQWPZOJeHX3i0XUOffz884

Trying to create buttons to load certain categories.

Would eventually like it to load with all Categories and have the ability to turn them on and off via buttons on the left.

My queries do not seem to be working. For testing, I was trying to load all Farms and then toggle on the Zoos (and eventually toggle back off Zoos).

     var layer = new google.maps.FusionTablesLayer({
       query: {
         select: 'Location',
         from: '3092255',
         where: 'Category contains Farm',


  function updateMapZoosOn() {
 layer.setOption("SELECT Location FROM 3092255 WHERE Category CONTAINS Zoo");
  }

Any help please?

THANKS!

4

1 回答 1

0

CONTAINS 是一个字符串运算符,您的搜索值必须被引用,例如:“Category CONTAINS 'Farm'”,加上您的 layer.setOptions() 语法不正确。您需要与创建图层时使用的相同类型的 {query: ....} 选项

GMap FT Query Reference解释了这一点。

于 2012-03-02T14:42:25.413 回答