Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Filter.In I can only substract items from view, not add.

Rene W.Jul 7 2020 — edited Jul 8 2020

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?

This post has been answered by Honglei Zhu-Oracle on Jul 7 2020
Jump to Answer
Comments
Post Details
Added on Jul 7 2020
5 comments
144 views