-
Notifications
You must be signed in to change notification settings - Fork 18
Area filters
Currently csWeb implements two ways of filtering features based on their location. The first allows you to select a rectangular region of interest, the other lets you choose an existing polygon to use as filter.
To activate the draggable filter, click on the filter icon in the left panel. In the left tab that appears, click on "Enable location filter". A highlighted rectangle appears, which can be resized and moved to select the desired area of interest. All active features of the current project outside the region will be filtered out.
To use the polygon filter, a layer containing polygons should be enabled. Right-clicking a polygon will show a context menu, with the option to select the current polygon as filter.
To implement the polygon filter in your project, open the file 'public/app.ts'. In the class definition, add a AreaFilterModel:
public areaFilter: AreaFilter.AreaFilterModel;
Also make sure that the AreaFilterModel is initialized and registered when the project is loaded:
$messageBusService.subscribe("project", (action: string) => {
if (action === "loaded") {
this.areaFilter = new AreaFilter.AreaFilterModel();
this.$layerService.addActionService(this.areaFilter);
}
});
Finally, add the locationfilter.js to the index.html by adding the line:
<script src="cs/js/locationfilter.js"></script>