UNPKG

@terrestris/ol-util

Version:

A set of helper classes for working with openLayers

24 lines 832 B
import OlLayer from 'ol/layer/Layer'; import OlVectorLayer from 'ol/layer/Vector'; import OlImageWMS from 'ol/source/ImageWMS'; import OlTileWMS from 'ol/source/TileWMS'; import OlSourceVector from 'ol/source/Vector'; import OlSourceWMTS from 'ol/source/WMTS'; export function isWmsLayer(layer) { if (layer instanceof OlLayer) { const source = layer.getSource(); return source instanceof OlImageWMS || source instanceof OlTileWMS; } return false; } export function isWmtsLayer(layer) { if (layer instanceof OlLayer) { const source = layer.getSource(); return source instanceof OlSourceWMTS; } return false; } export function isWfsLayer(layer) { return (layer instanceof OlVectorLayer && layer.getSource() instanceof OlSourceVector); } //# sourceMappingURL=typeUtils.js.map