New javascript functions for geocubes filtering:
After you set one or more filters you have to call the function renderFilter so that the geocubes overlay on your map is reloaded and the filters become active.
renderFilter();
Function orFilter means that one of these values can occur, if you set more than one.
Adds a filter to the geocubes map overlay.
orFilter(int field, int operator, int value);
Releases a filter from the geocubes map overlay.
orFilterRelease(int field, int operator, int value);
int field:
GC_FD1
GC_FD2
These are the two optional integer Fields from the client Library, which you can set, if you add a point.
int operator:
GC_EQ - means "field" have to be equal "value", both are integer
int value:
32 Bit signed integer. That is the value which is compared to the optional fields (int field) in our Database.
Function andFilter means that all values must occur.
Adds a filter to the geocubes map overlay.
andFilter(int field, int operator, int value);
Releases a Filter from the geocubes map overlay.
andFilterRelease(int field, int operator, int value);
int field:
GC_FD1
GC_FD2
These are the two optional integer Fields from the client library, which you can set, if you add a point.
int operator:
GC_EQ - means "field" has to be equal "value", both are integer
- more operators like "lower than" or "greater than" will be added soon
int value:
32 Bit signed integer. That is the value which is compared to the optional fields (int field) in our Database.
First Example Javascript:
var gc = new geocubes(map, key);
...code...
// show all geo-points where optional field1 is 33 OR 54 OR 128
gc.orFilter(GC_FD1, GC_EQ, 33);
gc.orFilter(GC_FD1, GC_EQ, 54);
gc.orFilter(GC_FD1, GC_EQ, 128);
gc.renderFilter();
window.setTimeout(function () {
// release filters after 5 seconds
gc.orFilterRelease(GC_FD1, GC_EQ, 33);
gc.orFilterRelease(GC_FD1, GC_EQ, 54);
gc.orFilterRelease(GC_FD1, GC_EQ, 128);
gc.renderFilter();
}, 5000);
...code...
Second Example:
...code...
// show all geo-points where optional field1 is 12 AND optional field2 is 8
gc.andFilter(GC_FD1, GC_EQ, 12);
gc.andFilter(GC_FD2, GC_EQ, 8);
gc.renderFilter();
...code...
You can set Text Filtering for the free text field by the geocubes client library.
Searches through all geo-points that CONTAINS "value" in the free text field.
Adds a text filter to geocubes map overlay.
textFilter(string value);
Releases the text filter from the geocubes map overlay.
textFilterRelease();
Example:
...code...
gc.textFilter("mykeyword");
window.setTimeout(function() {
// resets text filter after 5 seconds.
gc.textFilterRelease();
}, 5000);
...code....
Releases all filters you set by function andFilter, orFilter, textFilter
releaseFilters();
See Javascript API Reference for further Information.