Working from a basic example generated by Oracle MapBuilder. I have a base map and a FOI layer.
At the start no filter is applied and the map shows all object types (column OBJECTTYPE) available in the FOI layer.
function addThemeBasedFOI()
{
layers["themebasedfoi1"] = layer1;
map.addLayer(layer1);
layer1.setZoomLevelRange(0,9);
}
A checkbox, initially unchecked, calls this function:
function setFilter(item)
{
if (item.checked) {
layer1.applyFilter(new OM.filter.In('OBJECTTYPE',["WGD","PND","OTD","BTD"]),true);
}
else
{
layer1.applyFilter(new OM.filter.In('OBJECTTYPE',["WGD","PND","OTD"]),true);
}
}
First click on the checkbox checks it and all objecttypes are removed from the layer except the four specified ["WGD","PND","OTD","BTD"].
Second click on the checkbox unchecks it and the layer now show only the three object types. ["WGD","PND","OTD"]
With the checkbox checked again I expect the objecttype "BTD" to return but this doesn't happen.
How should this be done?