@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
40 lines (39 loc) • 1.92 kB
TypeScript
import type { EventsKey } from 'ol/events';
import { Map } from 'ol';
import type BaseLayer from 'ol/layer/Base';
import type Feature from 'ol/Feature';
import { Coordinate } from 'ol/coordinate';
import { ProjectionLike } from 'ol/proj';
import { Circle, Geometry, Polygon } from 'ol/geom';
import { Pixel } from 'ol/pixel';
/**
* Unsubscribe to all OpenLayer listeners.
*/
export declare const unByKeyAll: (eventKeys: EventsKey[]) => void;
/**
* @returns a layer in the map that match the given name (property name).
*/
export declare const getOlayerByName: (map: Map, layerName: string) => BaseLayer | undefined;
/**
* Clone the properties of the given feature and delete ol properties to keep only the feature "app" properties.
* Handle map server values served as object and serve them as "simple" values.
*/
export declare const removeUnwantedOlParams: (feature: Feature, keepGeom?: boolean) => Record<string, unknown>;
/**
* @returns A polygon generated from the circle.
*/
export declare const polygonFromCircle: (geometry: Circle) => Polygon;
/**
* @param coordinates ol Coordinate list
* @returns the length between coordinates, considering the current map projection (projected or geographic)
*/
export declare const getDistance: (coordinates: Coordinate[]) => number;
/**
* @param polygon ol Polygon
* @returns the area of a polygon, considering the current map projection (projected or geographic)
*/
export declare const getArea: (polygon: Polygon) => number;
export declare const isProjectionInDegrees: () => boolean;
export declare const isCoordinateInDegrees: (coordinate: Coordinate) => boolean;
export declare const getSelectionBoxFromMapClick: (eventCoordinate: Pixel | [number, number], olMap: Map, pixelTolerance: number) => number[];
export declare const reprojectGeometry: (geometry: Geometry, sourceProjection: ProjectionLike, destinationProjection: ProjectionLike) => Geometry;