-2

I can't for the life of me find what's wrong with my checkbox filter. I'm using the source code supplied by Derek Eder as a template. There's a similar question on here however the answer doesn't cover my issue.

<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>

As defined in my 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-----

And as found in my maps_lib.js

The checkboxes make no changes to my markers, all are displayed regardless of whether the checkboxes are selected or not. Any suggestions?

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

Not sure how to check if my Api is specific to Fusion Tables?

A JS Fiddle containing the project: https://jsfiddle.net/yqmn2brw/

Berry
  • 115
  • 9
  • From looking into it further, it seems to be my Fusion Table API. Perhaps something to do with the credentials? I can't seem to set up the API correctly – Berry Mar 30 '16 at 02:22
  • Please provide a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve) that demonstrates your issue. – geocodezip Mar 30 '16 at 02:27
  • @geocodezip Not sure what else I need to include on this? Everything else works except for the filters – Berry Mar 30 '16 at 02:37
  • Can you reproduce and debug the issue with the information posted? – geocodezip Mar 30 '16 at 02:56
  • @geocodezip Sorry I'm pretty new to JS so I'm not really sure where the issue is! I've posted a JSfiddle that contains the majority of the code but I think the issue lies in the above sections – Berry Mar 30 '16 at 03:29

1 Answers1

1

You must also modify the name of the locationColumn (the default is geometry, but in your table it seems to be Latitude)

There should be a notification about that in the console.

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201