UNPKG

@terrestris/ol-util

Version:

A set of helper classes for working with openLayers

29 lines (28 loc) 1.06 kB
import { FeatureCollection } from 'geojson'; import OlMap from 'ol/Map'; /** * Helper class for adding layers from various file formats. * * @class */ export declare class FileUtil { /** * Adds a new vector layer from a geojson file. * @param {File} file the file to read the geojson from * @param {import("ol/Map").default} map the map to add the layer to */ static addGeojsonLayerFromFile(file: File, map: OlMap): void; /** * Adds a new vector layer from a shape file (zip). * @param {File} file the file to read the geojson from * @param {import("ol/Map").default} map the map to add the layer to */ static addShpLayerFromFile(file: File, map: OlMap): void; /** * Adds a new vector layer from a geojson string. * @param {string|object} json the geojson string or object * @param {import("ol/Map").default} map the map to add the layer to */ static addGeojsonLayer(json: string | FeatureCollection | FeatureCollection[], map: OlMap): void; } export default FileUtil;