融合表过滤器

时间:2016-03-30 02:17:11

标签: javascript google-maps google-maps-api-3 google-fusion-tables

我无法为我的生活找到我的复选框过滤器出了什么问题。 我使用Derek Eder提供的源代码作为模板。 这里有一个类似的问题,但答案并不能解决我的问题。

<h4>Vacancy Selection</h4>
        <div class='row'>
          <div class='col-md-6'>
            <ul class='inputs-list unstyled'>
                <li>
                    <label class='checkbox inline'>
                    <input type='checkbox' id='cbTypeVacant1' />
                    <span class='filter-box filter-green'></span>
                    Vacant
                    </label>
                </li>
                <li>
                    <label class='checkbox inline'>
                    <input type='checkbox' id='cbTypeVacant2' />
                    <span class='filter-box filter-red'></span>
                    Occupied
                    </label>
                </li>
            </ul>

在我的index.html中定义

//-----custom filters-----
        var type_column = "'Type Vacant'";
        var searchType = type_column + " IN (-1,";
        if ( $("#cbTypeVacant1").is(':checked')) searchType += "1,";
        if ( $("#cbTypeVacant2").is(':checked')) searchType += "2,";
        self.whereClause += " AND " + searchType.slice(0, searchType.length - 1) + ")";
    //-----end of custom filters-----

在我的maps_lib.js中找到

复选框不会更改我的标记,无论是否选中了复选框,都会显示所有标记。有什么建议吗?

fusionTableId:      "1FMeZBi_NYNqAV2Bnf7MdiL1eUlC3zbOg9vpXFxea",
        googleApiKey:       "AIzaSyC8hYnLrg5zUvWEx5klDHe_q8gmgxPiIiI"

不确定如何检查我的Api是否特定于Fusion Tables?

包含该项目的JS小提琴: https://jsfiddle.net/yqmn2brw/

1 个答案:

答案 0 :(得分:1)

您还必须修改from operator import add, sub def check_answer(number1, number2, answer, operator): operations = { "+": add, "-": sub } if operator not in operations: raise ValueError("Operator '%s' not supported" % operator) return operations[operator](number1, number2) == answer 的名称(默认为locationColumn,但在您的表格中似乎是geometry

在控制台中应该有关于此的通知。