import type { Feature as FeatureType } from 'ol'; import type { FeatureLike } from 'ol/Feature'; import type { ReadOptions } from 'ol/format/Feature'; import type { Vector } from 'ol/layer'; import type VectorSource from 'ol/source/Vector'; export type MapsetKmlFormatReadOptions = { applyMinMaxZoom?: boolean; doNotRevert32pxScaling?: boolean; getResolutionForZoom?: (zoom: number) => number; } & ReadOptions; declare class MapsetKmlFormat { /** * Read a KML string. * * @param {String} kmlString A string representing a KML file. * @param {Object} formatOptions used to read and writes features. It extends the ol KML format read options with some custom options. * @param {boolean} [formatOptions.applyMinMaxZoom=true] Generate a style function to apply the minZoom and maxZoom properties of features if they are defined and if the getResolutionForZoom function is provided in options. The style function will return undefined for features that are out of the zoom range defined by minZoom and maxZoom, so they will not be displayed on the map. * @param {boolean} [formatOptions.doNotRevert32pxScaling=false] Set it to true if you use ol < 6.7 and last version of react-spatial, Fix the 32px scaling, introduced by (ol >= 6.7), see https://github.com/openlayers/openlayers/pull/12695. * @param {function} [formatOptions.getResolutionForZoom] A function to get the resolution for a given zoom level. Mandatory if applyMinMaxZoom is true. It can be the map.getView().getResolutionForZoom function. */ readFeatures(kmlString: string, formatOptions?: MapsetKmlFormatReadOptions): FeatureType[]; /** * Removes the tag from a KML string. Returns the KML string with removed tag. * @param {String} kmlString A string representing a KML file. */ removeDocumentCamera(kmlString: string): string; sanitizeFeature(feature: FeatureType, formatOptions: MapsetKmlFormatReadOptions): void; /** * Write the tag into a KML string. Returns the KML string with added tag. * @param {String} kmlString A string representing a KML file. * @param {Object} cameraAttributes Object containing the camera tags (longitude, latitude, altitude, heading, tilt, altitudeMode, roll) * as keys with corresponding values. See https://developers.google.com/kml/documentation/kmlreference#camera */ writeDocumentCamera: (kmlString: string, cameraAttributes: null | Record) => string; /** * Create a KML string. * @param {VectorLayer} layer A openlayers VectorLayer. * @param {} featureProjection The current projection used by the features. * @param {} mapResolution The current map resolution. */ writeFeatures(layer: Vector>, featureProjection: string, mapResolution: number): string | undefined; } export default MapsetKmlFormat;