How to use the @here/harp-omv-datasource.OmvFeatureFilterDescriptionBuilder function in @here/harp-omv-datasource

To help you get started, we’ve selected a few @here/harp-omv-datasource examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / @here / harp-examples / src / multiview_sync-filter-view.ts View on Github external
mapViews.view1.mapView.addDataSource(dataSources.omvDataSource1);
    mapViews.view2.mapView.addDataSource(dataSources.omvDataSource2);

    CopyrightElementHandler.install("copyrightNotice")
        .attach(mapViews.view1.mapView)
        .attach(mapViews.view2.mapView)
        .setDefaults([
            {
                id: "openstreetmap.org",
                label: "OpenStreetMap contributors",
                link: "https://www.openstreetmap.org/copyright"
            }
        ]);

    //filter all but one layer on one of the mapviews
    const filterBuilder = new OmvFeatureFilterDescriptionBuilder({
        processLayersDefault: true
    });

    filterBuilder.ignoreLayer("boundaries", OmvFilterString.StringMatch.Match);
    filterBuilder.ignoreLayer("water", OmvFilterString.StringMatch.Match);
    filterBuilder.ignoreLayer("landuse", OmvFilterString.StringMatch.Match);
    filterBuilder.ignoreLayer("earth", OmvFilterString.StringMatch.Match);
    filterBuilder.ignoreLayer("places", OmvFilterString.StringMatch.Match);
    filterBuilder.ignoreLayer("pois", OmvFilterString.StringMatch.Match);
    filterBuilder.ignoreLayer("buildings", OmvFilterString.StringMatch.Match);
    filterBuilder.ignoreLayer("transit", OmvFilterString.StringMatch.Match);
    //filterBuilder.ignoreLayer("roads", OmvFilterString.StringMatch.Match);

    const filterDescr = filterBuilder.createDescription();
    dataSources.omvDataSource2.setDataFilter(filterDescr);