Skip to content
Snippets Groups Projects

Overlay query params

Merged Tadeusz Miesiąc requested to merge overlay-query-params into development
5 unresolved threads
18 files
+ 368
23
Compare changes
  • Side-by-side
  • Inline
Files
18
import { Fill, Style } from 'ol/style';
import { Fill, Stroke, Style } from 'ol/style';
import { fromExtent } from 'ol/geom/Polygon';
import Feature from 'ol/Feature';
import type Polygon from 'ol/geom/Polygon';
const createFeatureFromExtent = ([xMin, yMin, xMax, yMax]: number[]): Feature<Polygon> =>
new Feature({ geometry: fromExtent([xMin, yMin, xMax, yMax]) });
const getBioEntityOverlayFeatureStyle = (color: string): Style =>
new Style({ fill: new Fill({ color }), stroke: new Stroke({ color: 'black', width: 1 }) });
export const createOverlayGeometryFeature = (
[xMin, yMin, xMax, yMax]: number[],
color: string,
): Feature<Polygon> => {
const feature = new Feature({ geometry: fromExtent([xMin, yMin, xMax, yMax]) });
feature.setStyle(new Style({ fill: new Fill({ color }) }));
const feature = createFeatureFromExtent([xMin, yMin, xMax, yMax]);
feature.setStyle(getBioEntityOverlayFeatureStyle(color));
return feature;
};
Loading