Openlayers 4 – Parametric View

Openlayers 4 – a parametric view is defined in Geoserver, and flitered in Openlayers through javascript – filter parameters are retrieved through an Ajax request querying the source layer in Postgres/Postgis. The layer is refined and point locations are returned and displayed. In addition, on-click events trigger retrieval of point attributes based on GeoJson.
A corresponding bounding-box is returned through an additional Postgis request, querying st_extent of the features’ geometries.

See:

http://gis.spatialventures.com.au/png_demo/census_map.html