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; 

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);
    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?


Apparently the filter is more like a delete statement in SQL than a where clause. I got it to work by creating a copy of the original layer and displaying the copy.

if (layerFilter) 

{ map.removeLayer(layerFilter); }


layerFilter = layer1.applyFilter(new OM.filter.In('OBJECTTYPE',filterArray),false);



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.