{"version":3,"file":"ngx-ol-library-source-core.mjs","sources":["../../../src/source/core/data-tile-source-host.ts","../../../src/source/core/image-source-host.ts","../../../src/source/core/tile-image-source-host.ts","../../../src/source/core/tile-source-host.ts","../../../src/source/core/ngx-ol-library-source-core.ts"],"sourcesContent":["import { InjectOptions } from '@angular/core';\nimport { injectTileLayer } from 'ngx-ol-library/layer/tile';\nimport { useWebGLTileLayer } from 'ngx-ol-library/layer/webgl-tile';\nimport { injectRasterSource } from 'ngx-ol-library/source/raster';\nimport Layer from 'ol/layer/Layer';\nimport { SourceType } from 'ol/layer/WebGLTile';\nimport Source from 'ol/source/Source';\nimport TileSource from 'ol/source/Tile';\n\nexport function useDataTileSourceHost(selector: string) {\n  const options: InjectOptions = { optional: true, host: true };\n  const tileLayer = injectTileLayer(options);\n  const webglTileLayer = useWebGLTileLayer(options);\n  const rasterSource = injectRasterSource(options);\n\n  let getInstance, addSource, removeSource;\n\n  if (rasterSource) {\n    getInstance = () => rasterSource.getInstance();\n    addSource = (source: Source|Layer) => rasterSource.addSource(source);\n    removeSource = (source: Source|Layer) => rasterSource.removeSource(source);\n  } else if (tileLayer) {\n    getInstance = () => tileLayer.getInstance();\n    addSource = (source: TileSource) => tileLayer.getInstance().setSource(source);\n    removeSource = () => tileLayer.getInstance().setSource(null);\n  } else if (webglTileLayer) {\n    getInstance = () => webglTileLayer.getInstance();\n    addSource = (source: SourceType) => webglTileLayer.getInstance().setSource(source);\n    removeSource = () => webglTileLayer.getInstance().setSource(null);\n  } else {\n    throw new Error(\n      '`' + selector + '` component must be nested within `nol-tile-layer`' +\n      ' `nol-webgl-tile-layer` or `nol-raster-source` component.'\n    );\n  }\n\n  return { getInstance, addSource, removeSource };\n}","import { InjectOptions } from '@angular/core';\nimport { injectImageLayer } from 'ngx-ol-library/layer/image';\nimport { injectRasterSource } from 'ngx-ol-library/source/raster';\nimport Layer from 'ol/layer/Layer';\nimport ImageSource from 'ol/source/Image';\nimport Source from 'ol/source/Source';\n\nexport function useImageSourceHost(selector: string) {\n  const options: InjectOptions = { optional: true, host: true };\n  const imageLayer = injectImageLayer(options);\n  const rasterSource = injectRasterSource(options);\n\n  let addSource, removeSource;\n\n  if (rasterSource) {\n    addSource = (source: Source|Layer) => rasterSource.addSource(source);\n    removeSource = (source: Source|Layer) => rasterSource.removeSource(source);\n  } else if (imageLayer) {\n    addSource = (source: ImageSource) => imageLayer.getInstance().setSource(source);\n    removeSource = () => imageLayer.getInstance().setSource(null);\n  } else {\n    throw new Error(\n      '`' + selector + '` component must be nested within `nol-image-layer`' +\n      ' or `nol-raster-source` component.'\n    );\n  }\n\n  return { addSource, removeSource };\n}","import { InjectOptions } from '@angular/core';\nimport { injectTileLayer } from 'ngx-ol-library/layer/tile';\nimport { useWebGLTileLayer } from 'ngx-ol-library/layer/webgl-tile';\nimport { injectRasterSource } from 'ngx-ol-library/source/raster';\nimport Layer from 'ol/layer/Layer';\nimport { SourceType } from 'ol/layer/WebGLTile';\nimport Source from 'ol/source/Source';\nimport TileSource from 'ol/source/Tile';\n\nexport function useTileImageSourceHost(selector: string) {\n  const options: InjectOptions = { optional: true, host: true };\n  const tileLayer = injectTileLayer(options);\n  const webglTileLayer = useWebGLTileLayer(options);\n  const rasterSource = injectRasterSource(options);\n\n  let getInstance, addSource, removeSource;\n\n  if (rasterSource) {\n    getInstance = () => rasterSource.getInstance();\n    addSource = (source: Source|Layer) => rasterSource.addSource(source);\n    removeSource = (source: Source|Layer) => rasterSource.removeSource(source);\n  } else if (tileLayer) {\n    getInstance = () => tileLayer.getInstance();\n    addSource = (source: TileSource) => tileLayer.getInstance().setSource(source);\n    removeSource = () => tileLayer.getInstance().setSource(null);\n  } else if (webglTileLayer) {\n    getInstance = () => webglTileLayer.getInstance();\n    addSource = (source: SourceType) => webglTileLayer.getInstance().setSource(source);\n    removeSource = () => webglTileLayer.getInstance().setSource(null);\n  } else {\n    throw new Error(\n      '`' + selector + '` component must be nested within `nol-tile-layer`' +\n      ' `nol-webgl-tile-layer` or `nol-raster-source` component.'\n    );\n  }\n\n  return { getInstance, addSource, removeSource };\n}","import { InjectOptions } from '@angular/core';\nimport { injectTileLayer } from 'ngx-ol-library/layer/tile';\nimport { injectRasterSource } from 'ngx-ol-library/source/raster';\nimport Layer from 'ol/layer/Layer';\nimport Source from 'ol/source/Source';\nimport TileSource from 'ol/source/Tile';\n\nexport function useTileSourceHost(selector: string) {\n  const options: InjectOptions = { optional: true, host: true };\n  const tileLayer = injectTileLayer(options);\n  const rasterSource = injectRasterSource(options);\n\n  let addSource, removeSource;\n\n  if (rasterSource) {\n    addSource = (source: Source|Layer) => rasterSource.addSource(source);\n    removeSource = (source: Source|Layer) => rasterSource.removeSource(source);\n  } else if (tileLayer) {\n    addSource = (source: TileSource) => tileLayer.getInstance().setSource(source);\n    removeSource = () => tileLayer.getInstance().setSource(null);\n  } else {\n    throw new Error(\n      '`' + selector + '` component must be nested within `nol-tile-layer`' +\n      ' or `nol-raster-source` component.'\n    );\n  }\n\n  return { addSource, removeSource };\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASM,SAAU,qBAAqB,CAAC,QAAgB,EAAA;IACpD,MAAM,OAAO,GAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC9D,IAAA,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAC3C,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAClD,IAAA,MAAM,YAAY,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAEjD,IAAA,IAAI,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC;IAEzC,IAAI,YAAY,EAAE;QAChB,WAAW,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC;AAC/C,QAAA,SAAS,GAAG,CAAC,MAAoB,KAAK,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AACrE,QAA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