Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);