UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

36 lines (35 loc) 1.55 kB
import type { EventsKey } from 'ol/events'; import type { Map } from 'ol'; import type BaseLayer from 'ol/layer/Base'; import type Feature from 'ol/Feature'; import { Coordinate } from 'ol/coordinate'; import { Circle, Polygon } from 'ol/geom'; /** * 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;