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H,WAAWkgC,iBAAiBltB,EAAaitB,EAAKjtB,GAE9C,IAAIxe,SAAQ,CAACC,EAASK,KACtBqB,KAAK8mC,sBAKVp9B,EAAOsgC,MAAM,CACXntB,cACAhE,SAAUA,IAAMva,IAChBwa,OAAQA,IAAMna,IACdsrC,aAAchoC,OAAO4I,QAAQ02B,WAR7B5iC,GASA,GAEN,ECzRF,YAsBMurC,GAAOp8B,OAAa,KAAI,CAAC,EAC/Bo8B,GAAK3Q,SAAWA,GAKhB2Q,GAAKvrB,qBAAuBA,GAC5BurB,GAAKpoB,mBAAqBA,GAC1BooB,GAAKrX,mBAAqBA,GAK1BqX,GAAKC,KAAOA,EACZD,GAAKC,KAAKpqC,kBAAoBA,EAC9BmqC,GAAKC,KAAK/lB,uBAAyBA,GAEnC8lB,GAAKE,QAAU,CAAC,EAGhBF,GAAKE,QAAQ9D,WAAa+D,GAC1BH,GAAKE,QAAQxD,QAAU0D,G","sources":["webpack://olcs_unused_var/webpack/bootstrap","webpack://olcs_unused_var/webpack/runtime/compat get default export","webpack://olcs_unused_var/webpack/runtime/define property getters","webpack://olcs_unused_var/webpack/runtime/hasOwnProperty shorthand","webpack://olcs_unused_var/webpack/runtime/make namespace object","webpack://olcs_unused_var/external var \"ol.geom.Point\"","webpack://olcs_unused_var/./src/olcs/util.ts","webpack://olcs_unused_var/external var \"ol.easing\"","webpack://olcs_unused_var/external var \"ol.layer.Tile\"","webpack://olcs_unused_var/external var \"ol.layer.Image\"","webpack://olcs_unused_var/external var \"ol.proj\"","webpack://olcs_unused_var/external var \"ol.source.ImageStatic\"","webpack://olcs_unused_var/external var \"ol.source.ImageWMS\"","webpack://olcs_unused_var/external var \"ol.source.TileImage\"","webpack://olcs_unused_var/external var \"ol.source.TileWMS\"","webpack://olcs_unused_var/external var \"ol.source.VectorTile\"","webpack://olcs_unused_var/external var \"ol.source.Image\"","webpack://olcs_unused_var/external var \"ol.source\"","webpack://olcs_unused_var/./src/olcs/core/OLImageryProvider.ts","webpack://olcs_unused_var/external var \"ol.format.MVT\"","webpack://olcs_unused_var/external var \"ol.style.Style\"","webpack://olcs_unused_var/external var \"ol.style.Stroke\"","webpack://olcs_unused_var/external var \"ol.render\"","webpack://olcs_unused_var/external var \"ol.util\"","webpack://olcs_unused_var/external var \"ol.structs.LRUCache\"","webpack://olcs_unused_var/external var \"ol.tilegrid\"","webpack://olcs_unused_var/external var \"ol.tileurlfunction\"","webpack://olcs_unused_var/external var \"ol.render.Feature\"","webpack://olcs_unused_var/./src/olcs/MVTImageryProvider.ts","webpack://olcs_unused_var/external var \"ol.layer.VectorTile\"","webpack://olcs_unused_var/external var \"ol.extent\"","webpack://olcs_unused_var/./src/olcs/core.ts","webpack://olcs_unused_var/./src/olcs/AutoRenderLoop.ts","webpack://olcs_unused_var/external var \"ol.Observable\"","webpack://olcs_unused_var/./src/olcs/math.ts","webpack://olcs_unused_var/./src/olcs/Camera.ts","webpack://olcs_unused_var/external var \"ol.layer.Group\"","webpack://olcs_unused_var/./src/olcs/AbstractSynchronizer.ts","webpack://olcs_unused_var/external var \"ol.layer.BaseVector\"","webpack://olcs_unused_var/./src/olcs/RasterSynchronizer.ts","webpack://olcs_unused_var/external var \"ol.source.Vector\"","webpack://olcs_unused_var/external var \"ol.layer.Layer\"","webpack://olcs_unused_var/external var \"ol.source.Cluster\"","webpack://olcs_unused_var/external var \"ol.layer.Vector\"","webpack://olcs_unused_var/external var \"ol.style.Icon\"","webpack://olcs_unused_var/external var \"ol.geom.Polygon\"","webpack://olcs_unused_var/external var \"ol.geom.SimpleGeometry\"","webpack://olcs_unused_var/./src/olcs/core/VectorLayerCounterpart.ts","webpack://olcs_unused_var/external var \"ol.geom\"","webpack://olcs_unused_var/./src/olcs/FeatureConverter.ts","webpack://olcs_unused_var/./src/olcs/VectorSynchronizer.ts","webpack://olcs_unused_var/external var \"ol.Overlay\"","webpack://olcs_unused_var/./src/olcs/SynchronizedOverlay.ts","webpack://olcs_unused_var/./src/olcs/OverlaySynchronizer.ts","webpack://olcs_unused_var/./src/olcs/OLCesium.ts","webpack://olcs_unused_var/./src/olcs/print/computeRectangle.ts","webpack://olcs_unused_var/./src/olcs/print/drawCesiumMask.ts","webpack://olcs_unused_var/./src/olcs/print/takeCesiumScreenshot.ts","webpack://olcs_unused_var/./src/olcs/contrib/LazyLoader.ts","webpack://olcs_unused_var/./src/olcs/contrib/Manager.ts","webpack://olcs_unused_var/./src/olcs.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = ol.geom.Point;","import type {Projection} from 'ol/proj';\nimport type {Source} from 'ol/source';\n\nlet _imageRenderingPixelatedSupported: boolean = undefined;\nlet _imageRenderingValue: string = undefined;\n\n\n/**\n * https://caniuse.com/mdn-css_properties_image-rendering_pixelated\n * @return whether the browser supports\n */\nexport function supportsImageRenderingPixelated(): boolean {\n if (_imageRenderingPixelatedSupported === undefined) {\n const canvas = document.createElement('canvas');\n canvas.setAttribute('style', 'image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; image-rendering: pixelated;');\n // canvas.style.imageRendering will be undefined, null or an\n // empty string on unsupported browsers.\n const imageRenderingValue = canvas.style.imageRendering;\n _imageRenderingPixelatedSupported = !!imageRenderingValue;\n if (_imageRenderingPixelatedSupported) {\n _imageRenderingValue = imageRenderingValue;\n }\n }\n return _imageRenderingPixelatedSupported;\n}\n\n\n/**\n * The value supported by thie browser for the CSS property \"image-rendering\"\n * @return {string}\n */\nexport function imageRenderingValue() {\n supportsImageRenderingPixelated();\n return _imageRenderingValue || '';\n}\n\n/**\n * Return the projection of the source that Cesium should use.\n *\n * @param source Source.\n * @return The projection of the source.\n */\nexport function getSourceProjection(source: Source): Projection {\n return source.get('olcs.projection') as Projection || source.getProjection();\n}\n\n\n/**\n * Counter for getUid.\n * @type {number}\n */\nlet uidCounter_ = 0;\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. Unique IDs are generated\n * as a strictly increasing sequence. Adapted from goog.getUid. Similar to OL getUid.\n *\n * @param obj The object to get the unique ID for.\n * @return The unique ID for the object.\n */\nexport function getUid(obj: any): number {\n return obj.olcs_uid || (obj.olcs_uid = ++uidCounter_);\n}\n\nexport function waitReady(object: Type): Promise {\n const o = object as any;\n const p = o.readyPromise;\n if (p) {\n return p;\n }\n if (o.ready !== undefined) {\n if (o.ready) {\n return Promise.resolve(object);\n }\n return new Promise((resolve, _) => {\n // FIXME: this is crazy\n // alternative: intercept _ready = true\n // altnerative: pass a timeout\n const stopper = setInterval(() => {\n if (o.ready) {\n clearInterval(stopper);\n resolve(object);\n }\n }, 20);\n });\n }\n return Promise.reject('Not a readyable object');\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.easing;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Tile;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Image;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.proj;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.ImageStatic;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.ImageWMS;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.TileImage;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.TileWMS;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.VectorTile;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.Image;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source;","import {getSourceProjection} from '../util';\nimport {Tile as TileSource, type TileImage} from 'ol/source.js';\nimport {attributionsFunctionToCredits} from '../core';\nimport type {Map} from 'ol';\nimport type {Projection} from 'ol/proj.js';\nimport type {Credit, Event, ImageryLayerFeatureInfo, ImageryProvider, ImageryTypes, Proxy, Rectangle, Request, TileDiscardPolicy, TilingScheme} from 'cesium';\n\n\nexport function createEmptyCanvas(): HTMLCanvasElement {\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return canvas;\n}\n\nconst olUseNewCoordinates = (function() {\n const tileSource = new TileSource({\n projection: 'EPSG:3857',\n wrapX: true\n });\n const tileCoord = tileSource.getTileCoordForTileUrlFunction([6, -31, 22]);\n return tileCoord && tileCoord[1] === 33 && tileCoord[2] === 22;\n // See b/test/spec/ol/source/tile.test.js\n // of e9a30c5cb7e3721d9370025fbe5472c322847b35 in OpenLayers repository\n})();\n\n\nexport default class OLImageryProvider implements ImageryProvider /* should not extend Cesium.ImageryProvider */ {\n private source_: TileImage;\n private projection_: Projection | undefined;\n private fallbackProj_: Projection | undefined;\n private map_: Map;\n private shouldRequestNextLevel: boolean;\n private emptyCanvas_: HTMLCanvasElement = createEmptyCanvas();\n private emptyCanvasPromise_: Promise = Promise.resolve(this.emptyCanvas_);\n private tilingScheme_: TilingScheme;\n private ready_: boolean;\n private rectangle_: Rectangle;\n\n /**\n * When true, this model is ready to render, i.e., the external binary, image,\n * and shader files were downloaded and the WebGL resources were created.\n */\n get ready(): boolean {\n return this.ready_;\n }\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by the instance.\n */\n get rectangle() {\n return this.rectangle_;\n }\n\n /**\n * Gets the tiling scheme used by the provider.\n */\n get tilingScheme(): TilingScheme {\n return this.tilingScheme_;\n }\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link Cesium.TileProviderError}.\n */\n readonly errorEvent: Event = new Cesium.Event();\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery.\n */\n readonly credit: Credit;\n\n /**\n * Gets the proxy used by this provider.\n */\n readonly proxy: Proxy;\n\n get _ready(): boolean {\n return this.ready_;\n }\n\n /**\n * Gets the width of each tile, in pixels.\n */\n get tileWidth(): number {\n const tileGrid = this.source_.getTileGrid();\n if (tileGrid) {\n const tileSizeAtZoom0 = tileGrid.getTileSize(0);\n if (Array.isArray(tileSizeAtZoom0)) {\n return tileSizeAtZoom0[0];\n } else {\n return tileSizeAtZoom0; // same width and height\n }\n }\n return 256;\n }\n\n /**\n * Gets the height of each tile, in pixels.\n */\n get tileHeight(): number {\n const tileGrid = this.source_.getTileGrid();\n if (tileGrid) {\n const tileSizeAtZoom0 = tileGrid.getTileSize(0);\n if (Array.isArray(tileSizeAtZoom0)) {\n return tileSizeAtZoom0[1];\n } else {\n return tileSizeAtZoom0; // same width and height\n }\n }\n return 256;\n }\n\n /**\n * Gets the maximum level-of-detail that can be requested.\n */\n get maximumLevel(): number {\n const tileGrid = this.source_.getTileGrid();\n if (tileGrid) {\n return tileGrid.getMaxZoom();\n } else {\n return 18; // some arbitrary value\n }\n }\n\n // FIXME: to implement, we could check the number of tiles at minzoom (for this rectangle) and return 0 if too big\n /**\n * Gets the minimum level-of-detail that can be requested. Generally,\n * a minimum level should only be used when the rectangle of the imagery is small\n * enough that the number of tiles at the minimum level is small. An imagery\n * provider with more than a few tiles at the minimum level will lead to\n * rendering problems.\n */\n get minimumLevel() {\n // WARNING: Do not use the minimum level (at least until the extent is\n // properly set). Cesium assumes the minimumLevel to contain only\n // a few tiles and tries to load them all at once -- this can\n // freeze and/or crash the browser !\n return 0;\n //var tg = this.source_.getTileGrid();\n //return tg ? tg.getMinZoom() : 0;\n }\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered.\n */\n get tileDiscardPolicy(): TileDiscardPolicy {\n return undefined;\n }\n\n // FIXME: this might be exposed\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n */\n get hasAlphaChannel() {\n return true;\n }\n\n // FIXME: this could be implemented by proxying to OL\n /**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile.\n * This function is optional, so it may not exist on all ImageryProviders.\n * @param x - The tile X coordinate.\n * @param y - The tile Y coordinate.\n * @param level - The tile level.\n * @param longitude - The longitude at which to pick features.\n * @param latitude - The latitude at which to pick features.\n * @return A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n * It may also be undefined if picking is not supported.\n */\n pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined {\n return undefined;\n }\n\n /**\n * Special class derived from Cesium.ImageryProvider\n * that is connected to the given ol.source.TileImage.\n * @param olMap OL map\n * @param source Tile image source\n * @param [opt_fallbackProj] Projection to assume if source has no projection\n */\n constructor(olMap: Map, source: TileImage, opt_fallbackProj: Projection) {\n this.source_ = source;\n\n this.projection_ = null;\n\n this.ready_ = false;\n\n this.fallbackProj_ = opt_fallbackProj || null;\n\n // cesium v107+ don't wait for ready anymore so we put somehing here while it loads\n this.tilingScheme_ = new Cesium.WebMercatorTilingScheme();\n\n this.rectangle_ = null;\n\n this.map_ = olMap;\n\n this.shouldRequestNextLevel = false;\n\n const proxy = this.source_.get('olcs.proxy');\n if (proxy) {\n if (typeof proxy === 'function') {\n // Duck typing a proxy\n this.proxy = {\n 'getURL': proxy\n } as Proxy;\n } else if (typeof proxy === 'string') {\n this.proxy = new Cesium.DefaultProxy(proxy);\n }\n }\n\n this.source_.on('change', (e) => {\n this.handleSourceChanged_();\n });\n this.handleSourceChanged_();\n }\n\n /**\n * Checks if the underlying source is ready and cached required data.\n */\n private handleSourceChanged_() {\n if (!this.ready_ && this.source_.getState() == 'ready') {\n this.projection_ = getSourceProjection(this.source_) || this.fallbackProj_;\n const options = {numberOfLevelZeroTilesX: 1, numberOfLevelZeroTilesY: 1};\n\n if (this.source_.tileGrid !== null) {\n // Get the number of tiles at level 0 if it is defined\n this.source_.tileGrid.forEachTileCoord(this.projection_.getExtent(), 0, ([zoom, xIndex, yIndex]) => {\n options.numberOfLevelZeroTilesX = xIndex + 1;\n options.numberOfLevelZeroTilesY = yIndex + 1;\n });\n }\n\n if (this.projection_.getCode() === 'EPSG:4326') {\n // Cesium zoom level 0 is OpenLayers zoom level 1 for layer in EPSG:4326 with a single tile on level 0\n this.shouldRequestNextLevel = options.numberOfLevelZeroTilesX === 1 && options.numberOfLevelZeroTilesY === 1;\n this.tilingScheme_ = new Cesium.GeographicTilingScheme(options);\n } else if (this.projection_.getCode() === 'EPSG:3857') {\n this.shouldRequestNextLevel = false;\n this.tilingScheme_ = new Cesium.WebMercatorTilingScheme(options);\n } else {\n return;\n }\n this.rectangle_ = this.tilingScheme_.rectangle;\n\n this.ready_ = true;\n }\n }\n\n /**\n * Generates the proper attributions for a given position and zoom\n * level.\n * @implements\n */\n getTileCredits(x: number, y: number, level: number): Credit[] {\n const attributionsFunction = this.source_.getAttributions();\n if (!attributionsFunction) {\n return [];\n }\n const extent = this.map_.getView().calculateExtent(this.map_.getSize());\n const center = this.map_.getView().getCenter();\n const zoom = this.shouldRequestNextLevel ? level + 1 : level;\n return attributionsFunctionToCredits(attributionsFunction, zoom, center, extent);\n }\n\n /**\n * @implements\n */\n requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined {\n const tileUrlFunction = this.source_.getTileUrlFunction();\n if (tileUrlFunction && this.projection_) {\n const z_ = this.shouldRequestNextLevel ? level + 1 : level;\n\n let y_ = y;\n if (!olUseNewCoordinates) {\n // LEGACY\n // OpenLayers version 3 to 5 tile coordinates increase from bottom to top\n y_ = -y - 1;\n }\n let url = tileUrlFunction.call(this.source_, [z_, x, y_], 1, this.projection_);\n if (this.proxy) {\n url = this.proxy.getURL(url);\n }\n if (url) {\n // It is probably safe to cast here\n return Cesium.ImageryProvider.loadImage(this, url) as Promise;\n }\n return this.emptyCanvasPromise_;\n } else {\n // return empty canvas to stop Cesium from retrying later\n return this.emptyCanvasPromise_;\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.format.MVT;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.style.Style;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.style.Stroke;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.render;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.util;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.structs.LRUCache;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.tilegrid;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.tileurlfunction;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.render.Feature;","import MVT from 'ol/format/MVT.js';\nimport Style, {type StyleFunction} from 'ol/style/Style.js';\nimport Stroke from 'ol/style/Stroke.js';\nimport {toContext} from 'ol/render.js';\nimport {get as getProjection} from 'ol/proj.js';\nimport {VERSION as OL_VERSION} from 'ol/util.js';\nimport LRUCache from 'ol/structs/LRUCache.js';\nimport {getForProjection as getTilegridForProjection} from 'ol/tilegrid.js';\nimport {createFromTemplates as createTileUrlFunctions} from 'ol/tileurlfunction.js';\nimport type {Credit, Event, ImageryLayerFeatureInfo, ImageryProvider, ImageryTypes, Proxy, Rectangle, Request, TileDiscardPolicy, TilingScheme} from 'cesium';\nimport type {UrlFunction} from 'ol/Tile.js';\nimport RenderFeature from 'ol/render/Feature.js';\nimport {createEmptyCanvas} from './core/OLImageryProvider';\n\n\nexport interface MVTOptions {\n urls: string[],\n rectangle: Rectangle,\n credit: Credit,\n styleFunction: StyleFunction,\n cacheSize?: number,\n featureCache?: LRUCache>\n minimumLevel: number\n}\n\nconst format = new MVT({\n featureClass: RenderFeature\n});\n\nconst styles = [new Style({\n stroke: new Stroke({\n color: 'blue',\n width: 2\n })\n})];\n\n\nexport default class MVTImageryProvider implements ImageryProvider {\n private urls: string[];\n private emptyCanvas_: HTMLCanvasElement = createEmptyCanvas();\n private emptyCanvasPromise_: Promise = Promise.resolve(this.emptyCanvas_);\n private tilingScheme_ = new Cesium.WebMercatorTilingScheme;\n private ready_ = true;\n private rectangle_: Rectangle;\n private tileRectangle_: Rectangle;\n readonly tileWidth = 256;\n readonly tileHeight = 256;\n readonly maximumLevel = 20;\n private minimumLevel_ = 0;\n get minimumLevel(): number {\n return this.minimumLevel_;\n }\n private featureCache: LRUCache>;\n private tileCache: LRUCache>;\n private tileFunction_: UrlFunction;\n private styleFunction_: StyleFunction;\n private projection_ = getProjection('EPSG:3857');\n\n /**\n * When true, this model is ready to render, i.e., the external binary, image,\n * and shader files were downloaded and the WebGL resources were created.\n */\n get ready(): boolean {\n return this.ready_;\n }\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by the instance.\n */\n get rectangle() {\n return this.rectangle_;\n }\n\n /**\n * Gets the tiling scheme used by the provider.\n */\n get tilingScheme(): TilingScheme {\n return this.tilingScheme_;\n }\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link Cesium.TileProviderError}.\n */\n readonly errorEvent: Event = new Cesium.Event();\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery.\n */\n readonly credit: Credit;\n\n getTileCredits(x: number, y: number, level: number): Credit[] {\n return [];\n }\n\n /**\n * Gets the proxy used by this provider.\n */\n readonly proxy: Proxy;\n\n get _ready(): boolean {\n return this.ready_;\n }\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered.\n */\n get tileDiscardPolicy(): TileDiscardPolicy {\n return undefined;\n }\n\n // FIXME: this might be exposed\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n */\n get hasAlphaChannel() {\n return true;\n }\n\n // FIXME: this could be implemented by proxying to OL\n /**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile.\n * This function is optional, so it may not exist on all ImageryProviders.\n * @param x - The tile X coordinate.\n * @param y - The tile Y coordinate.\n * @param level - The tile level.\n * @param longitude - The longitude at which to pick features.\n * @param latitude - The latitude at which to pick features.\n * @return A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n * It may also be undefined if picking is not supported.\n */\n pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined {\n return undefined;\n }\n\n constructor(options: MVTOptions) {\n this.urls = options.urls;\n this.rectangle_ = options.rectangle || this.tilingScheme.rectangle;\n this.credit = options.credit;\n this.styleFunction_ = options.styleFunction || (() => styles);\n this.tileRectangle_ = new Cesium.Rectangle();\n // to avoid too frequent cache grooming we allow x2 capacity\n const cacheSize = options.cacheSize !== undefined ? options.cacheSize : 50;\n this.tileCache = new LRUCache(cacheSize);\n this.featureCache = options.featureCache || new LRUCache(cacheSize);\n this.minimumLevel_ = options.minimumLevel || 0;\n const tileGrid = getTilegridForProjection(this.projection_);\n this.tileFunction_ = createTileUrlFunctions(this.urls, tileGrid);\n }\n\n private getTileFeatures(z: number, x: number, y: number): Promise {\n const cacheKey = this.getCacheKey_(z, x, y);\n let promise;\n if (this.featureCache.containsKey(cacheKey)) {\n promise = this.featureCache.get(cacheKey);\n }\n if (!promise) {\n const url = this.getUrl_(z, x, y);\n promise = fetch(url)\n .then(r => (r.ok ? r : Promise.reject(r)))\n .then(r => r.arrayBuffer())\n .then(buffer => this.readFeaturesFromBuffer(buffer));\n this.featureCache.set(cacheKey, promise);\n if (this.featureCache.getCount() > 2 * this.featureCache.highWaterMark) {\n while (this.featureCache.canExpireCache()) {\n this.featureCache.pop();\n }\n }\n }\n return promise;\n }\n\n readFeaturesFromBuffer(buffer: ArrayBuffer): RenderFeature[] {\n let options;\n if (OL_VERSION <= '6.4.4') {\n // See https://github.com/openlayers/openlayers/pull/11540\n options = {\n extent: [0, 0, 4096, 4096],\n dataProjection: this.projection_,\n featureProjection: this.projection_\n };\n }\n const features = format.readFeatures(buffer, options) as RenderFeature[];\n const scaleFactor = this.tileWidth / 4096;\n features.forEach((f) => {\n const flatCoordinates = f.getFlatCoordinates();\n let flip = false;\n for (let i = 0; i < flatCoordinates.length; ++i) {\n flatCoordinates[i] *= scaleFactor;\n if (flip) {\n // FIXME: why do we need this now?\n flatCoordinates[i] = this.tileWidth - flatCoordinates[i];\n }\n if (OL_VERSION <= '6.4.4') {\n // LEGACY\n flip = !flip;\n }\n }\n });\n\n return features;\n }\n\n private getUrl_(z: number, x: number, y: number): string {\n // FIXME: probably we should not pass 1 as pixelRatio\n const url = this.tileFunction_([z, x, y], 1, this.projection_);\n return url;\n }\n\n private getCacheKey_(z: number, x: number, y: number) {\n return `${z}_${x}_${y}`;\n }\n\n requestImage(x: number, y: number, z: number, request?: Request): Promise | undefined {\n if (z < this.minimumLevel_) {\n return this.emptyCanvasPromise_;\n }\n\n try {\n const cacheKey = this.getCacheKey_(z, x, y);\n let promise;\n if (this.tileCache.containsKey(cacheKey)) {\n promise = this.tileCache.get(cacheKey);\n }\n if (!promise) {\n promise = this.getTileFeatures(z, x, y)\n .then((features) => {\n // FIXME: here we suppose the 2D projection is in meters\n this.tilingScheme.tileXYToNativeRectangle(x, y, z, this.tileRectangle_);\n const resolution = (this.tileRectangle_.east - this.tileRectangle_.west) / this.tileWidth;\n return this.rasterizeFeatures(features, this.styleFunction_, resolution);\n });\n this.tileCache.set(cacheKey, promise);\n if (this.tileCache.getCount() > 2 * this.tileCache.highWaterMark) {\n while (this.tileCache.canExpireCache()) {\n this.tileCache.pop();\n }\n }\n }\n return promise;\n } catch (e) {\n console.trace(e);\n // FIXME: open PR on Cesium to fix incorrect typing\n // @ts-ignore\n this.errorEvent.raiseEvent('could not render pbf to tile', e);\n }\n }\n\n rasterizeFeatures(features: RenderFeature[], styleFunction: StyleFunction, resolution: number): HTMLCanvasElement {\n const canvas = document.createElement('canvas');\n const vectorContext = toContext(canvas.getContext('2d'), {size: [this.tileWidth, this.tileHeight]});\n features.forEach((f) => {\n const styles = styleFunction(f, resolution);\n if (styles) {\n if (Array.isArray(styles)) {\n styles.forEach((style) => {\n vectorContext.setStyle(style);\n vectorContext.drawGeometry(f);\n });\n } else {\n vectorContext.setStyle(styles);\n vectorContext.drawGeometry(f);\n }\n }\n });\n return canvas;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.VectorTile;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.extent;","import {linear as linearEasing} from 'ol/easing.js';\nimport olLayerTile from 'ol/layer/Tile.js';\nimport olLayerImage from 'ol/layer/Image.js';\nimport {get as getProjection, type ProjectionLike, transformExtent} from 'ol/proj.js';\nimport olSourceImageStatic from 'ol/source/ImageStatic.js';\nimport olSourceImageWMS from 'ol/source/ImageWMS.js';\nimport olSourceTileImage from 'ol/source/TileImage.js';\nimport olSourceTileWMS from 'ol/source/TileWMS.js';\nimport olSourceVectorTile from 'ol/source/VectorTile.js';\nimport {defaultImageLoadFunction} from 'ol/source/Image.js';\nimport olcsCoreOLImageryProvider from './core/OLImageryProvider';\nimport {getSourceProjection} from './util';\nimport MVTImageryProvider from './MVTImageryProvider';\nimport VectorTileLayer from 'ol/layer/VectorTile.js';\nimport {type Extent, getCenter as getExtentCenter} from 'ol/extent.js';\nimport type BaseLayer from 'ol/layer/Base.js';\nimport type LayerGroup from 'ol/layer/Group.js';\nimport type {\n BoundingSphere,\n Camera,\n Cartesian2,\n Cartesian3,\n Cartographic,\n Color, ImageMaterialProperty,\n ImageryLayer,\n Matrix4,\n Ray,\n Rectangle,\n Scene,\n SingleTileImageryProvider\n} from 'cesium';\nimport type Geometry from 'ol/geom/Geometry.js';\nimport type {Coordinate} from 'ol/coordinate.js';\nimport type Source from 'ol/source/Source.js';\n// eslint-disable-next-line no-duplicate-imports\nimport type {Attribution} from 'ol/source/Source.js';\n\nimport type Map from 'ol/Map.js';\nimport type Projection from 'ol/proj/Projection.js';\nimport type {Color as OLColor} from 'ol/color.js';\nimport type View from 'ol/View.js';\n\ntype CesiumUrlDefinition = {\n url: string,\n subdomains: string\n}\n\n\n/**\n * Options for rotate around axis core function.\n */\ntype RotateAroundAxisOption = {\n duration?: number,\n easing?: (value: number) => number,\n callback: () => void\n}\n\n\nexport type LayerWithParents = {\n layer: BaseLayer,\n parents: LayerGroup[] | BaseLayer[]\n}\n\n\n/**\n * Compute the pixel width and height of a point in meters using the\n * camera frustum.\n */\nexport function computePixelSizeAtCoordinate(scene: Scene, target: Cartesian3): Cartesian2 {\n const camera = scene.camera;\n const canvas = scene.canvas;\n const frustum = camera.frustum;\n const distance = Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(\n camera.position, target, new Cesium.Cartesian3()));\n // @ts-ignore TS2341\n return frustum.getPixelDimensions(canvas.clientWidth, canvas.clientHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());\n}\n\n\n/**\n * Compute bounding box around a target point.\n * @param {!Cesium.Scene} scene\n * @param {!Cesium.Cartesian3} target\n * @param {number} amount Half the side of the box, in pixels.\n * @return {Array} bottom left and top right\n * coordinates of the box\n */\nexport function computeBoundingBoxAtTarget(scene: Scene, target: Cartesian3, amount: number): Cartographic[] {\n const pixelSize = computePixelSizeAtCoordinate(scene, target);\n const transform = Cesium.Transforms.eastNorthUpToFixedFrame(target);\n\n const bottomLeft = Cesium.Matrix4.multiplyByPoint(\n transform,\n new Cesium.Cartesian3(-pixelSize.x * amount, -pixelSize.y * amount, 0),\n new Cesium.Cartesian3());\n\n const topRight = Cesium.Matrix4.multiplyByPoint(\n transform,\n new Cesium.Cartesian3(pixelSize.x * amount, pixelSize.y * amount, 0),\n new Cesium.Cartesian3());\n\n return Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(\n [bottomLeft, topRight]);\n}\n\nexport function applyHeightOffsetToGeometry(geometry: Geometry, height: number) {\n geometry.applyTransform((input, output, stride) => {\n console.assert(input === output);\n if (stride !== undefined && stride >= 3) {\n for (let i = 0; i < output.length; i += stride) {\n output[i + 2] = output[i + 2] + height;\n }\n }\n return output;\n });\n}\n\nexport function createMatrixAtCoordinates(\n coordinates: Coordinate,\n rotation = 0,\n translation = Cesium.Cartesian3.ZERO,\n scale = new Cesium.Cartesian3(1, 1, 1)\n): Matrix4 {\n const position = ol4326CoordinateToCesiumCartesian(coordinates);\n const rawMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position);\n const quaternion = Cesium.Quaternion.fromAxisAngle(Cesium.Cartesian3.UNIT_Z, -rotation);\n const rotationMatrix = Cesium.Matrix4.fromTranslationQuaternionRotationScale(translation, quaternion, scale);\n return Cesium.Matrix4.multiply(rawMatrix, rotationMatrix, new Cesium.Matrix4());\n}\n\nexport function rotateAroundAxis(camera: Camera, angle: number, axis: Cartesian3, transform: Matrix4,\n opt_options?: RotateAroundAxisOption) {\n const clamp = Cesium.Math.clamp;\n const defaultValue = Cesium.defaultValue;\n\n const options: RotateAroundAxisOption = opt_options;\n const duration = defaultValue(options?.duration, 500); // ms\n const easing = defaultValue(options?.easing, linearEasing);\n const callback = options?.callback;\n\n let lastProgress = 0;\n const oldTransform = new Cesium.Matrix4();\n\n const start = Date.now();\n const step = function() {\n const timestamp = Date.now();\n const timeDifference = timestamp - start;\n const progress = easing(clamp(timeDifference / duration, 0, 1));\n console.assert(progress >= lastProgress);\n\n camera.transform.clone(oldTransform);\n const stepAngle = (progress - lastProgress) * angle;\n lastProgress = progress;\n camera.lookAtTransform(transform);\n camera.rotate(axis, stepAngle);\n camera.lookAtTransform(oldTransform);\n\n if (progress < 1) {\n window.requestAnimationFrame(step);\n } else {\n if (callback) {\n callback();\n }\n }\n };\n window.requestAnimationFrame(step);\n}\n\nexport function setHeadingUsingBottomCenter(\n scene: Scene,\n heading: number,\n bottomCenter: Cartesian3,\n options?: RotateAroundAxisOption\n) {\n const camera = scene.camera;\n // Compute the camera position to zenith quaternion\n const angleToZenith = computeAngleToZenith(scene, bottomCenter);\n const axis = camera.right;\n const quaternion = Cesium.Quaternion.fromAxisAngle(axis, angleToZenith);\n const rotation = Cesium.Matrix3.fromQuaternion(quaternion);\n\n // Get the zenith point from the rotation of the position vector\n const vector = new Cesium.Cartesian3();\n Cesium.Cartesian3.subtract(camera.position, bottomCenter, vector);\n const zenith = new Cesium.Cartesian3();\n Cesium.Matrix3.multiplyByVector(rotation, vector, zenith);\n Cesium.Cartesian3.add(zenith, bottomCenter, zenith);\n\n // Actually rotate around the zenith normal\n const transform = Cesium.Matrix4.fromTranslation(zenith);\n rotateAroundAxis(camera, heading, zenith, transform, options);\n}\n\n\n/**\n * Get the 3D position of the given pixel of the canvas.\n */\nexport function pickOnTerrainOrEllipsoid(scene: Scene, pixel: Cartesian2): Cartesian3 {\n const ray = scene.camera.getPickRay(pixel);\n const target = scene.globe.pick(ray, scene);\n return target || scene.camera.pickEllipsoid(pixel);\n}\n\n\n/**\n * Get the 3D position of the point at the bottom-center of the screen.\n */\nexport function pickBottomPoint(scene: Scene): Cartesian3 | undefined {\n const canvas = scene.canvas;\n const bottom = new Cesium.Cartesian2(\n canvas.clientWidth / 2, canvas.clientHeight);\n return pickOnTerrainOrEllipsoid(scene, bottom);\n}\n\n\n/**\n * Get the 3D position of the point at the center of the screen.\n */\nexport function pickCenterPoint(scene: Scene): Cartesian3 | undefined {\n const canvas = scene.canvas;\n const center = new Cesium.Cartesian2(\n canvas.clientWidth / 2,\n canvas.clientHeight / 2);\n return pickOnTerrainOrEllipsoid(scene, center);\n}\n\n\n/**\n * Compute the signed tilt angle on globe, between the opposite of the\n * camera direction and the target normal. Return undefined if there is no\n */\nexport function computeSignedTiltAngleOnGlobe(scene: Scene): number | undefined {\n const camera = scene.camera;\n const ray = new Cesium.Ray(camera.position, camera.direction);\n let target = scene.globe.pick(ray, scene);\n\n if (!target) {\n // no tiles in the area were loaded?\n const ellipsoid = Cesium.Ellipsoid.WGS84;\n const obj = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);\n if (obj) {\n target = Cesium.Ray.getPoint(ray, obj.start);\n }\n }\n\n if (!target) {\n return undefined;\n }\n\n const normal = new Cesium.Cartesian3();\n Cesium.Ellipsoid.WGS84.geocentricSurfaceNormal(target, normal);\n\n const angleBetween = signedAngleBetween;\n const angle = angleBetween(camera.direction, normal, camera.right) - Math.PI;\n return Cesium.Math.convertLongitudeRange(angle);\n}\n\n\n/**\n * Compute the ray from the camera to the bottom-center of the screen.\n */\nexport function bottomFovRay(scene: Scene): Ray {\n const camera = scene.camera;\n // @ts-ignore TS2341\n const fovy2 = camera.frustum.fovy / 2;\n const direction = camera.direction;\n const rotation = Cesium.Quaternion.fromAxisAngle(camera.right, fovy2);\n const matrix = Cesium.Matrix3.fromQuaternion(rotation);\n const vector = new Cesium.Cartesian3();\n Cesium.Matrix3.multiplyByVector(matrix, direction, vector);\n return new Cesium.Ray(camera.position, vector);\n}\n\n\n/**\n * Compute the angle between two Cartesian3.\n */\nexport function signedAngleBetween(first: Cartesian3, second: Cartesian3, normal: Cartesian3): number {\n // We are using the dot for the angle.\n // Then the cross and the dot for the sign.\n const a = new Cesium.Cartesian3();\n const b = new Cesium.Cartesian3();\n const c = new Cesium.Cartesian3();\n Cesium.Cartesian3.normalize(first, a);\n Cesium.Cartesian3.normalize(second, b);\n Cesium.Cartesian3.cross(a, b, c);\n\n const cosine = Cesium.Cartesian3.dot(a, b);\n const sine = Cesium.Cartesian3.magnitude(c);\n\n // Sign of the vector product and the orientation normal\n const sign = Cesium.Cartesian3.dot(normal, c);\n const angle = Math.atan2(sine, cosine);\n return sign >= 0 ? angle : -angle;\n}\n\n\n/**\n * Compute the rotation angle around a given point, needed to reach the\n * zenith position.\n * At a zenith position, the camera direction is going througth the earth\n * center and the frustrum bottom ray is going through the chosen pivot\n * point.\n * The bottom-center of the screen is a good candidate for the pivot point.\n */\nexport function computeAngleToZenith(scene: Scene, pivot: Cartesian3): number {\n // This angle is the sum of the angles 'fy' and 'a', which are defined\n // using the pivot point and its surface normal.\n // Zenith | camera\n // \\ | /\n // \\fy| /\n // \\ |a/\n // \\|/pivot\n const camera = scene.camera;\n // @ts-ignore TS2341\n const fy = camera.frustum.fovy / 2;\n const ray = bottomFovRay(scene);\n const direction = Cesium.Cartesian3.clone(ray.direction);\n Cesium.Cartesian3.negate(direction, direction);\n\n const normal = new Cesium.Cartesian3();\n Cesium.Ellipsoid.WGS84.geocentricSurfaceNormal(pivot, normal);\n\n const left = new Cesium.Cartesian3();\n Cesium.Cartesian3.negate(camera.right, left);\n\n const a = signedAngleBetween(normal, direction, left);\n return a + fy;\n}\n\n\n/**\n * Convert an OpenLayers extent to a Cesium rectangle.\n * @param {ol.Extent} extent Extent.\n * @param {ol.ProjectionLike} projection Extent projection.\n * @return {Cesium.Rectangle} The corresponding Cesium rectangle.\n */\nexport function extentToRectangle(extent: Extent, projection: ProjectionLike) {\n if (extent && projection) {\n const ext = transformExtent(extent, projection, 'EPSG:4326');\n return Cesium.Rectangle.fromDegrees(ext[0], ext[1], ext[2], ext[3]);\n } else {\n return null;\n }\n}\n\nexport function sourceToImageryProvider(\n olMap: Map,\n source: Source,\n viewProj: Projection,\n olLayer: BaseLayer\n): olcsCoreOLImageryProvider | MVTImageryProvider | SingleTileImageryProvider {\n const skip = source.get('olcs_skip');\n if (skip) {\n return null;\n }\n let provider = null;\n // Convert ImageWMS to TileWMS\n if (source instanceof olSourceImageWMS && source.getUrl() &&\n source.getImageLoadFunction() === defaultImageLoadFunction) {\n const sourceProps = {\n 'olcs.proxy': source.get('olcs.proxy'),\n 'olcs.extent': source.get('olcs.extent'),\n 'olcs.projection': source.get('olcs.projection'),\n 'olcs.imagesource': source\n };\n source = new olSourceTileWMS({\n url: source.getUrl(),\n attributions: source.getAttributions(),\n projection: source.getProjection(),\n params: source.getParams()\n });\n source.setProperties(sourceProps);\n }\n\n if (source instanceof olSourceTileImage) {\n let projection = getSourceProjection(source);\n\n if (!projection) {\n // if not explicit, assume the same projection as view\n projection = viewProj;\n }\n\n if (isCesiumProjection(projection)) {\n provider = new olcsCoreOLImageryProvider(olMap, source, viewProj);\n }\n // Projection not supported by Cesium\n else {\n return null;\n }\n } else if (source instanceof olSourceImageStatic) {\n let projection = getSourceProjection(source);\n if (!projection) {\n projection = viewProj;\n }\n if (isCesiumProjection(projection)) {\n const rectangle: Rectangle = Cesium.Rectangle.fromDegrees(\n source.getImageExtent()[0],\n source.getImageExtent()[1],\n source.getImageExtent()[2],\n source.getImageExtent()[3],\n new Cesium.Rectangle()\n );\n provider = new Cesium.SingleTileImageryProvider({\n url: source.getUrl(),\n rectangle\n });\n }\n // Projection not supported by Cesium\n else {\n return null;\n }\n } else if (source instanceof olSourceVectorTile && olLayer instanceof VectorTileLayer) {\n let projection = getSourceProjection(source);\n\n if (!projection) {\n projection = viewProj;\n }\n if (skip === false) {\n // MVT is experimental, it should be whitelisted to be synchronized\n const fromCode = projection.getCode().split(':')[1];\n // @ts-ignore TS2341\n const urls = source.urls.map(u => u.replace(fromCode, '3857'));\n const extent = olLayer.getExtent();\n const rectangle = extentToRectangle(extent, projection);\n const minimumLevel = source.get('olcs_minimumLevel');\n const attributionsFunction = source.getAttributions();\n const styleFunction = olLayer.getStyleFunction();\n let credit;\n if (extent && attributionsFunction) {\n const center = getExtentCenter(extent);\n credit = attributionsFunctionToCredits(attributionsFunction, 0, center, extent)[0];\n }\n\n provider = new MVTImageryProvider({\n credit,\n rectangle,\n minimumLevel,\n styleFunction,\n urls\n });\n return provider;\n }\n return null; // FIXME: it is disabled by default right now\n } else {\n // sources other than TileImage|Imageexport function are currently not supported\n return null;\n }\n return provider;\n}\n\n/**\n * Creates Cesium.ImageryLayer best corresponding to the given ol.layer.Layer.\n * Only supports raster layers and export function images\n */\nexport function tileLayerToImageryLayer(olMap: Map, olLayer: BaseLayer, viewProj: Projection): ImageryLayer | null {\n\n if (!(olLayer instanceof olLayerTile) && !(olLayer instanceof olLayerImage) &&\n !(olLayer instanceof VectorTileLayer)) {\n return null;\n }\n\n const source = olLayer.getSource();\n if (!source) {\n return null;\n }\n let provider = source.get('olcs_provider');\n if (!provider) {\n provider = sourceToImageryProvider(olMap, source, viewProj, olLayer);\n }\n if (!provider) {\n return null;\n }\n\n const layerOptions: {rectangle?: Rectangle} = {};\n\n const forcedExtent = (olLayer.get('olcs.extent'));\n const ext = forcedExtent || olLayer.getExtent();\n if (ext) {\n layerOptions.rectangle = extentToRectangle(ext, viewProj);\n }\n\n const cesiumLayer = new Cesium.ImageryLayer(provider, layerOptions);\n return cesiumLayer;\n}\n\n\n/**\n * Synchronizes the layer rendering properties (opacity, visible)\n * to the given Cesium ImageryLayer.\n */\nexport function updateCesiumLayerProperties(olLayerWithParents: LayerWithParents, csLayer: ImageryLayer) {\n let opacity = 1;\n let visible = true;\n [olLayerWithParents.layer].concat(olLayerWithParents.parents).forEach((olLayer) => {\n const layerOpacity = olLayer.getOpacity();\n if (layerOpacity !== undefined) {\n opacity *= layerOpacity;\n }\n const layerVisible = olLayer.getVisible();\n if (layerVisible !== undefined) {\n visible = visible && layerVisible;\n }\n });\n csLayer.alpha = opacity;\n csLayer.show = visible;\n}\n\n\n/**\n * Convert a 2D or 3D OpenLayers coordinate to Cesium.\n */\nexport function ol4326CoordinateToCesiumCartesian(coordinate: Coordinate): Cartesian3 {\n const coo = coordinate;\n return coo.length > 2 ?\n Cesium.Cartesian3.fromDegrees(coo[0], coo[1], coo[2]) :\n Cesium.Cartesian3.fromDegrees(coo[0], coo[1]);\n}\n\n\n/**\n * Convert an array of 2D or 3D OpenLayers coordinates to Cesium.\n */\nexport function ol4326CoordinateArrayToCsCartesians(coordinates: Coordinate[]): Cartesian3[] {\n console.assert(coordinates !== null);\n const toCartesian = ol4326CoordinateToCesiumCartesian;\n const cartesians = [];\n for (let i = 0; i < coordinates.length; ++i) {\n cartesians.push(toCartesian(coordinates[i]));\n }\n return cartesians;\n}\n\n\n/**\n * Reproject an OpenLayers geometry to EPSG:4326 if needed.\n * The geometry will be cloned only when original projection is not EPSG:4326\n * and the properties will be shallow copied.\n */\nexport function olGeometryCloneTo4326(geometry: T, projection: ProjectionLike): T {\n console.assert(projection);\n\n const proj4326 = getProjection('EPSG:4326');\n const proj = getProjection(projection);\n if (proj.getCode() !== proj4326.getCode()) {\n const properties = geometry.getProperties();\n geometry = geometry.clone() as T;\n geometry.transform(proj, proj4326);\n geometry.setProperties(properties);\n }\n return geometry;\n}\n\n\n/**\n * Convert an OpenLayers color to Cesium.\n */\nexport function convertColorToCesium(olColor: OLColor | CanvasGradient | CanvasPattern | string): Color | ImageMaterialProperty {\n olColor = olColor || 'black';\n if (Array.isArray(olColor)) {\n return new Cesium.Color(\n Cesium.Color.byteToFloat(olColor[0]),\n Cesium.Color.byteToFloat(olColor[1]),\n Cesium.Color.byteToFloat(olColor[2]),\n olColor[3]\n );\n } else if (typeof olColor == 'string') {\n return Cesium.Color.fromCssColorString(olColor);\n } else if (olColor instanceof CanvasPattern || olColor instanceof CanvasGradient) {\n // Render the CanvasPattern/CanvasGradient into a canvas that will be sent to Cesium as material\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = canvas.height = 256;\n ctx.fillStyle = olColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n return new Cesium.ImageMaterialProperty({\n image: canvas\n });\n }\n console.assert(false, 'impossible');\n}\n\n\n/**\n * Convert an OpenLayers url to Cesium.\n */\nexport function convertUrlToCesium(url: string): CesiumUrlDefinition {\n let subdomains = '';\n const re = /\\{(\\d|[a-z])-(\\d|[a-z])\\}/;\n const match = re.exec(url);\n if (match) {\n url = url.replace(re, '{s}');\n const startCharCode = match[1].charCodeAt(0);\n const stopCharCode = match[2].charCodeAt(0);\n let charCode;\n for (charCode = startCharCode; charCode <= stopCharCode; ++charCode) {\n subdomains += String.fromCharCode(charCode);\n }\n }\n return {\n url,\n subdomains\n };\n}\n\n\n/**\n * Animate the return to a top-down view from the zenith.\n * The camera is rotated to orient to the North.\n */\nexport function resetToNorthZenith(map: Map, scene: Scene): Promise {\n return new Promise((resolve, reject) => {\n const camera = scene.camera;\n const pivot = pickBottomPoint(scene);\n if (!pivot) {\n reject('Could not get bottom pivot');\n return;\n }\n\n const currentHeading = map.getView().getRotation();\n if (currentHeading === undefined) {\n reject('The view is not initialized');\n return;\n }\n const angle = computeAngleToZenith(scene, pivot);\n\n // Point to North\n setHeadingUsingBottomCenter(scene, currentHeading, pivot);\n\n // Go to zenith\n const transform = Cesium.Matrix4.fromTranslation(pivot);\n const axis = camera.right;\n const options: RotateAroundAxisOption = {\n callback: () => {\n const view = map.getView();\n normalizeView(view);\n resolve(undefined);\n }\n };\n rotateAroundAxis(camera, -angle, axis, transform, options);\n });\n}\n\n\n/**\n * @param {!Cesium.Scene} scene\n * @param {number} angle in radian\n * @return {Promise}\n * @api\n */\nexport function rotateAroundBottomCenter(scene: Scene, angle: number): Promise {\n return new Promise((resolve, reject) => {\n const camera = scene.camera;\n const pivot = pickBottomPoint(scene);\n if (!pivot) {\n reject('could not get bottom pivot');\n return;\n }\n\n const options: RotateAroundAxisOption = {callback: () => resolve(undefined)};\n const transform = Cesium.Matrix4.fromTranslation(pivot);\n const axis = camera.right;\n rotateAroundAxis(camera, -angle, axis, transform, options);\n });\n}\n\n\n/**\n * Set the OpenLayers view to a specific rotation and\n * the nearest resolution.\n */\nexport function normalizeView(view: View, angle = 0) {\n const resolution = view.getResolution();\n view.setRotation(angle);\n\n // @ts-ignore TS2341\n if (view.constrainResolution) {\n // @ts-ignore TS2341\n view.setResolution(view.constrainResolution(resolution));\n } else {\n view.setResolution(view.getConstrainedResolution(resolution));\n }\n}\n\n/**\n * Check if the given projection is managed by Cesium (WGS84 or Mercator Spheric)\n */\nexport function isCesiumProjection(projection: Projection): boolean {\n const is3857 = projection.getCode() === 'EPSG:3857';\n const is4326 = projection.getCode() === 'EPSG:4326';\n return is3857 || is4326;\n}\n\nexport function attributionsFunctionToCredits(\n attributionsFunction: Attribution | null,\n zoom: number,\n center: Coordinate,\n extent: Extent\n) {\n\n if (!attributionsFunction) {\n return [];\n }\n let attributions = attributionsFunction({\n viewState: {zoom, center, projection: undefined, resolution: undefined, rotation: undefined},\n extent,\n });\n if (!Array.isArray(attributions)) {\n attributions = [attributions];\n }\n\n return attributions.map(html => new Cesium.Credit(html, true));\n}\n\n/**\n * calculate the distance between camera and centerpoint based on the resolution and latitude value\n */\nexport function calcDistanceForResolution(\n resolution: number,\n latitude: number,\n scene: Scene,\n projection: Projection\n): number {\n const canvas = scene.canvas;\n const camera = scene.camera;\n // @ts-ignore TS2341\n const fovy = camera.frustum.fovy; // vertical field of view\n console.assert(!isNaN(fovy));\n const metersPerUnit = projection.getMetersPerUnit();\n\n // number of \"map units\" visible in 2D (vertically)\n const visibleMapUnits = resolution * canvas.clientHeight;\n\n // The metersPerUnit does not take latitude into account, but it should\n // be lower with increasing latitude -- we have to compensate.\n // In 3D it is not possible to maintain the resolution at more than one point,\n // so it only makes sense to use the latitude of the \"target\" point.\n const relativeCircumference = Math.cos(Math.abs(latitude));\n\n // how many meters should be visible in 3D\n const visibleMeters = visibleMapUnits * metersPerUnit * relativeCircumference;\n\n // distance required to view the calculated length in meters\n //\n // fovy/2\n // |\\\n // x | \\\n // |--\\\n // visibleMeters/2\n const requiredDistance = (visibleMeters / 2) / Math.tan(fovy / 2);\n\n // NOTE: This calculation is not absolutely precise, because metersPerUnit\n // is a great simplification. It does not take ellipsoid/terrain into account.\n\n return requiredDistance;\n}\n\n/**\n * calculate the resolution based on a distance(camera to position) and latitude value\n */\nexport function calcResolutionForDistance(distance: number, latitude: number, scene: Scene, projection: Projection): number {\n // See the reverse calculation (calcDistanceForResolution) for details\n const canvas = scene.canvas;\n const camera = scene.camera;\n // @ts-ignore TS2341\n const fovy = camera.frustum.fovy; // vertical field of view\n console.assert(!isNaN(fovy));\n const metersPerUnit = projection.getMetersPerUnit();\n\n const visibleMeters = 2 * distance * Math.tan(fovy / 2);\n const relativeCircumference = Math.cos(Math.abs(latitude));\n const visibleMapUnits = visibleMeters / metersPerUnit / relativeCircumference;\n const resolution = visibleMapUnits / canvas.clientHeight;\n\n return resolution;\n}\n\n/**\n * Constrain the camera so that it stays close to the bounding sphere of the map extent.\n * Near the ground the allowed distance is shorter.\n */\nexport function limitCameraToBoundingSphere(camera: Camera, boundingSphere: BoundingSphere, ratio: (height: number) => number): () => void {\n let blockLimiter = false;\n return function() {\n if (!blockLimiter) {\n const position = camera.position;\n const carto = Cesium.Cartographic.fromCartesian(position);\n if (Cesium.Cartesian3.distance(boundingSphere.center, position) > boundingSphere.radius * ratio(carto.height)) {\n // @ts-ignore TS2339: FIXME, there is no flying property in Camera\n const currentlyFlying = camera.flying;\n if (currentlyFlying === true) {\n // There is a flying property and its value is true\n return;\n } else {\n blockLimiter = true;\n const unblockLimiter = () => (blockLimiter = false);\n camera.flyToBoundingSphere(boundingSphere, {\n complete: unblockLimiter,\n cancel: unblockLimiter,\n });\n }\n }\n }\n };\n}\n","import type {Scene} from 'cesium';\nimport type OLCesium from './OLCesium';\n\n/**\n * By default Cesium (used to?) renders as often as possible.\n * This is a waste of resources (CPU/GPU/battery).\n * An alternative mechanism in Cesium is on-demand rendering.\n * This class makes use of this alternative method and add some additionnal render points.\n */\nexport default class AutoRenderLoop {\n ol3d: OLCesium;\n private scene_: Scene;\n private canvas_: HTMLCanvasElement;\n private _boundNotifyRepaintRequired: typeof this.notifyRepaintRequired;\n private repaintEventNames_ = [\n 'mousemove', 'mousedown', 'mouseup',\n 'touchstart', 'touchend', 'touchmove',\n 'pointerdown', 'pointerup', 'pointermove',\n 'wheel'\n ] as const;\n\n /**\n * @param ol3d\n */\n constructor(ol3d: OLCesium) {\n this.ol3d = ol3d;\n this.scene_ = ol3d.getCesiumScene();\n this.canvas_ = this.scene_.canvas;\n this._boundNotifyRepaintRequired = this.notifyRepaintRequired.bind(this);\n this.enable();\n }\n\n /**\n * Enable.\n */\n enable() {\n this.scene_.requestRenderMode = true;\n this.scene_.maximumRenderTimeChange = 1000;\n for (const repaintKey of this.repaintEventNames_) {\n this.canvas_.addEventListener(repaintKey, this._boundNotifyRepaintRequired, false);\n }\n\n window.addEventListener('resize', this._boundNotifyRepaintRequired, false);\n\n // Listen for changes on the layer group\n this.ol3d.getOlMap().getLayerGroup().on('change', this._boundNotifyRepaintRequired);\n }\n\n /**\n * Disable.\n */\n disable() {\n for (const repaintKey of this.repaintEventNames_) {\n this.canvas_.removeEventListener(repaintKey, this._boundNotifyRepaintRequired, false);\n }\n\n window.removeEventListener('resize', this._boundNotifyRepaintRequired, false);\n\n this.ol3d.getOlMap().getLayerGroup().un('change', this._boundNotifyRepaintRequired);\n this.scene_.requestRenderMode = false;\n }\n\n /**\n * Restart render loop.\n * Force a restart of the render loop.\n */\n restartRenderLoop() {\n this.notifyRepaintRequired();\n }\n\n notifyRepaintRequired() {\n this.scene_.requestRender();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.Observable;","/**\n * Converts radians to to degrees.\n *\n * @param angleInRadians Angle in radians.\n * @return Angle in degrees.\n */\nexport function toDegrees(angleInRadians: number): number {\n return angleInRadians * 180 / Math.PI;\n}\n\n\n/**\n * Converts degrees to radians.\n *\n * @param angleInDegrees Angle in degrees.\n * @return Angle in radians.\n */\nexport function toRadians(angleInDegrees: number): number {\n return angleInDegrees * Math.PI / 180;\n}\n","import {unByKey as olObservableUnByKey} from 'ol/Observable.js';\nimport {toRadians, toDegrees} from './math';\nimport {getTransform} from 'ol/proj.js';\nimport {pickCenterPoint, calcDistanceForResolution, calcResolutionForDistance} from './core';\nimport type {Map, View} from 'ol';\nimport type {Scene, Camera as CesiumCamera, Matrix4, HeadingPitchRollValues} from 'cesium';\nimport type {EventsKey} from 'ol/events.js';\n\n/**\n * @param input Input coordinate array.\n * @param opt_output Output array of coordinate values.\n * @param opt_dimension Dimension.\n * @return Input coordinate array (same array as input).\n */\nexport function identityProjection(input: number[], opt_output?: number[], opt_dimension?: number): number[] {\n const dim = opt_dimension || input.length;\n if (opt_output) {\n for (let i = 0; i < dim; ++i) {\n opt_output[i] = input[i];\n }\n }\n return input;\n}\n\nexport default class Camera {\n private scene_: Scene;\n private cam_: CesiumCamera;\n private map_: Map;\n private view_: View;\n\n private viewListenKey_: EventsKey = null;\n\n private toLonLat_ = identityProjection;\n private fromLonLat_ = identityProjection;\n\n /**\n * 0 -- topdown, PI/2 -- the horizon\n */\n private tilt_: number = 0;\n private distance_ = 0;\n private lastCameraViewMatrix_: Matrix4 = null;\n\n /**\n * This is used to discard change events on view caused by updateView method.\n */\n private viewUpdateInProgress_ = false;\n\n /**\n * This object takes care of additional 3d-specific properties of the view and\n * ensures proper synchronization with the underlying raw Cesium.Camera object.\n */\n constructor(scene: Scene, map: Map) {\n this.scene_ = scene;\n this.cam_ = scene.camera;\n this.map_ = map;\n this.map_.on('change:view', (e) => {\n this.setView_(this.map_.getView());\n });\n this.setView_(this.map_.getView());\n }\n\n destroy() {\n olObservableUnByKey(this.viewListenKey_);\n this.viewListenKey_ = null;\n }\n\n /**\n * @param {?ol.View} view New view to use.\n * @private\n */\n setView_(view: View | undefined) {\n if (this.view_) {\n olObservableUnByKey(this.viewListenKey_);\n this.viewListenKey_ = null;\n }\n\n this.view_ = view;\n if (view) {\n const toLonLat = getTransform(view.getProjection(), 'EPSG:4326');\n const fromLonLat = getTransform('EPSG:4326', view.getProjection());\n console.assert(toLonLat && fromLonLat);\n\n this.toLonLat_ = toLonLat;\n this.fromLonLat_ = fromLonLat;\n\n this.viewListenKey_ = view.on('propertychange', e => this.handleViewChangedEvent_());\n\n this.readFromView();\n } else {\n this.toLonLat_ = identityProjection;\n this.fromLonLat_ = identityProjection;\n }\n }\n\n private handleViewChangedEvent_() {\n if (!this.viewUpdateInProgress_) {\n this.readFromView();\n }\n }\n\n /**\n * @deprecated\n * @param heading In radians.\n */\n setHeading(heading: number) {\n if (!this.view_) {\n return;\n }\n\n this.view_.setRotation(heading);\n }\n\n /**\n * @deprecated\n * @return Heading in radians.\n */\n getHeading(): number|undefined {\n if (!this.view_) {\n return undefined;\n }\n const rotation = this.view_.getRotation();\n return rotation || 0;\n }\n\n /**\n * @param tilt In radians.\n */\n setTilt(tilt: number) {\n this.tilt_ = tilt;\n this.updateCamera_();\n }\n\n /**\n * @return Tilt in radians.\n */\n getTilt(): number {\n return this.tilt_;\n }\n\n /**\n * @param distance In meters.\n */\n setDistance(distance: number) {\n this.distance_ = distance;\n this.updateCamera_();\n this.updateView();\n }\n\n /**\n * @return Distance in meters.\n */\n getDistance(): number {\n return this.distance_;\n }\n\n /**\n * @deprecated\n * Shortcut for ol.View.setCenter().\n * @param center Same projection as the ol.View.\n */\n setCenter(center: number[]) {\n if (!this.view_) {\n return;\n }\n this.view_.setCenter(center);\n }\n\n /**\n * @deprecated\n * Shortcut for ol.View.getCenter().\n * @return {ol.Coordinate|undefined} Same projection as the ol.View.\n * @api\n */\n getCenter() {\n if (!this.view_) {\n return undefined;\n }\n return this.view_.getCenter();\n }\n\n /**\n * Sets the position of the camera.\n * @param position Same projection as the ol.View.\n */\n setPosition(position: number[]) {\n if (!this.toLonLat_) {\n return;\n }\n const ll = this.toLonLat_(position);\n console.assert(ll);\n\n const carto = new Cesium.Cartographic(\n toRadians(ll[0]),\n toRadians(ll[1]),\n this.getAltitude());\n\n this.cam_.setView({\n destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(carto)\n });\n this.updateView();\n }\n\n /**\n * Calculates position under the camera.\n * @return Coordinates in same projection as the ol.View.\n * @api\n */\n getPosition(): number[] | undefined {\n if (!this.fromLonLat_) {\n return undefined;\n }\n const carto = Cesium.Ellipsoid.WGS84.cartesianToCartographic(this.cam_.position);\n\n const pos = this.fromLonLat_([\n toDegrees(carto.longitude),\n toDegrees(carto.latitude)\n ]);\n console.assert(pos);\n return pos;\n }\n\n /**\n * @param altitude In meters.\n */\n setAltitude(altitude: number) {\n const carto = Cesium.Ellipsoid.WGS84.cartesianToCartographic(\n this.cam_.position);\n carto.height = altitude;\n this.cam_.position = Cesium.Ellipsoid.WGS84.cartographicToCartesian(carto);\n\n this.updateView();\n }\n\n /**\n * @return Altitude in meters.\n */\n getAltitude(): number {\n const carto = Cesium.Ellipsoid.WGS84.cartesianToCartographic(\n this.cam_.position);\n\n return carto.height;\n }\n\n /**\n * Updates the state of the underlying Cesium.Camera\n * according to the current values of the properties.\n */\n private updateCamera_() {\n if (!this.view_ || !this.toLonLat_) {\n return;\n }\n const center = this.view_.getCenter();\n if (!center) {\n return;\n }\n const ll = this.toLonLat_(center);\n console.assert(ll);\n\n const carto = new Cesium.Cartographic(toRadians(ll[0]),\n toRadians(ll[1]));\n if (this.scene_.globe) {\n const height = this.scene_.globe.getHeight(carto);\n carto.height = height || 0;\n }\n\n const destination = Cesium.Ellipsoid.WGS84.cartographicToCartesian(carto);\n\n const orientation: HeadingPitchRollValues = {\n pitch: this.tilt_ - Cesium.Math.PI_OVER_TWO,\n heading: -this.view_.getRotation(),\n roll: undefined\n };\n this.cam_.setView({\n destination,\n orientation\n });\n\n this.cam_.moveBackward(this.distance_);\n\n this.checkCameraChange(true);\n }\n\n /**\n * Calculates the values of the properties from the current ol.View state.\n */\n readFromView() {\n if (!this.view_ || !this.toLonLat_) {\n return;\n }\n const center = this.view_.getCenter();\n if (center === undefined || center === null) {\n return;\n }\n const ll = this.toLonLat_(center);\n console.assert(ll);\n\n const resolution = this.view_.getResolution();\n this.distance_ = this.calcDistanceForResolution(\n resolution || 0, toRadians(ll[1]));\n\n this.updateCamera_();\n }\n\n /**\n * Calculates the values of the properties from the current Cesium.Camera state.\n * Modifies the center, resolution and rotation properties of the view.\n */\n updateView() {\n if (!this.view_ || !this.fromLonLat_) {\n return;\n }\n this.viewUpdateInProgress_ = true;\n\n // target & distance\n const ellipsoid = Cesium.Ellipsoid.WGS84;\n const scene = this.scene_;\n const target = pickCenterPoint(scene);\n\n let bestTarget = target;\n if (!bestTarget) {\n //TODO: how to handle this properly ?\n const globe = scene.globe;\n const carto = this.cam_.positionCartographic.clone();\n const height = globe.getHeight(carto);\n carto.height = height || 0;\n bestTarget = Cesium.Ellipsoid.WGS84.cartographicToCartesian(carto);\n }\n this.distance_ = Cesium.Cartesian3.distance(bestTarget, this.cam_.position);\n const bestTargetCartographic = ellipsoid.cartesianToCartographic(bestTarget);\n this.view_.setCenter(this.fromLonLat_([\n toDegrees(bestTargetCartographic.longitude),\n toDegrees(bestTargetCartographic.latitude)]));\n\n // resolution\n this.view_.setResolution(\n this.calcResolutionForDistance(this.distance_,\n bestTargetCartographic ? bestTargetCartographic.latitude : 0));\n\n\n /*\n * Since we are positioning the target, the values of heading and tilt\n * need to be calculated _at the target_.\n */\n if (target) {\n const pos = this.cam_.position;\n\n // normal to the ellipsoid at the target\n const targetNormal = new Cesium.Cartesian3();\n ellipsoid.geocentricSurfaceNormal(target, targetNormal);\n\n // vector from the target to the camera\n const targetToCamera = new Cesium.Cartesian3();\n Cesium.Cartesian3.subtract(pos, target, targetToCamera);\n Cesium.Cartesian3.normalize(targetToCamera, targetToCamera);\n\n\n // HEADING\n const up = this.cam_.up;\n const right = this.cam_.right;\n const normal = new Cesium.Cartesian3(-target.y, target.x, 0); // what is it?\n const heading = Cesium.Cartesian3.angleBetween(right, normal);\n const cross = Cesium.Cartesian3.cross(target, up, new Cesium.Cartesian3());\n const orientation = cross.z;\n\n this.view_.setRotation((orientation < 0 ? heading : -heading));\n\n // TILT\n const tiltAngle = Math.acos(\n Cesium.Cartesian3.dot(targetNormal, targetToCamera));\n this.tilt_ = isNaN(tiltAngle) ? 0 : tiltAngle;\n } else {\n // fallback when there is no target\n this.view_.setRotation(this.cam_.heading);\n this.tilt_ = -this.cam_.pitch + Math.PI / 2;\n }\n\n this.viewUpdateInProgress_ = false;\n }\n\n /**\n * Check if the underlying camera state has changed and ensure synchronization.\n * @param opt_dontSync Do not synchronize the view.\n */\n checkCameraChange(opt_dontSync?: boolean) {\n const old = this.lastCameraViewMatrix_;\n const current = this.cam_.viewMatrix;\n\n if (!old || !Cesium.Matrix4.equalsEpsilon(old, current, 1e-7)) {\n this.lastCameraViewMatrix_ = current.clone();\n if (opt_dontSync !== true) {\n this.updateView();\n }\n }\n }\n\n /**\n * calculate the distance between camera and centerpoint based on the resolution and latitude value\n * @param resolution Number of map units per pixel.\n * @param latitude Latitude in radians.\n * @return The calculated distance.\n */\n calcDistanceForResolution(resolution: number, latitude: number): number {\n return calcDistanceForResolution(resolution, latitude, this.scene_, this.view_.getProjection());\n }\n\n /**\n * calculate the resolution based on a distance(camera to position) and latitude value\n * @param distance\n * @param latitude\n * @return} The calculated resolution.\n */\n calcResolutionForDistance(distance: number, latitude: number): number {\n return calcResolutionForDistance(distance, latitude, this.scene_, this.view_.getProjection());\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Group;","import {unByKey as olObservableUnByKey} from 'ol/Observable.js';\nimport LayerGroup from 'ol/layer/Group.js';\nimport {getUid} from './util';\nimport type Map from 'ol/Map.js';\nimport type {Scene, ImageryLayer} from 'cesium';\nimport type View from 'ol/View.js';\nimport type Collection from 'ol/Collection.js';\nimport type BaseLayer from 'ol/layer/Base.js';\nimport type {EventsKey} from 'ol/events.js';\nimport type {LayerWithParents} from './core';\nimport type VectorLayerCounterpart from './core/VectorLayerCounterpart';\n\n\nexport default abstract class AbstractSynchronizer {\n protected map: Map;\n protected view: View;\n protected scene: Scene;\n protected olLayers: Collection;\n mapLayerGroup: LayerGroup;\n /**\n * Map of OpenLayers layer ids (from getUid) to the Cesium ImageryLayers.\n * Null value means, that we are unable to create equivalent layers.\n */\n protected layerMap: Record> = {};\n /**\n * Map of listen keys for OpenLayers layer layers ids (from getUid).\n */\n protected olLayerListenKeys: Record> = {};\n /**\n * Map of listen keys for OpenLayers layer groups ids (from getUid).\n */\n private olGroupListenKeys_: Record> = {};\n\n protected constructor(map: Map, scene: Scene) {\n this.map = map;\n this.view = map.getView();\n this.scene = scene;\n this.olLayers = map.getLayerGroup().getLayers();\n this.mapLayerGroup = map.getLayerGroup();\n }\n\n /**\n * Destroy all and perform complete synchronization of the layers.\n */\n synchronize() {\n this.destroyAll();\n this.addLayers_(this.mapLayerGroup);\n }\n\n /**\n * Order counterparts using the same algorithm as the Openlayers renderer:\n * z-index then original sequence order.\n */\n protected orderLayers() {\n // Ordering logics is handled in subclasses.\n }\n\n /**\n * Add a layer hierarchy.\n */\n private addLayers_(root: BaseLayer) {\n const fifo: LayerWithParents[] = [{\n layer: root,\n parents: []\n }];\n while (fifo.length > 0) {\n const olLayerWithParents = fifo.splice(0, 1)[0];\n const olLayer = olLayerWithParents.layer;\n const olLayerId = getUid(olLayer).toString();\n this.olLayerListenKeys[olLayerId] = [];\n console.assert(!this.layerMap[olLayerId]);\n\n let cesiumObjects = null;\n if (olLayer instanceof LayerGroup) {\n this.listenForGroupChanges_(olLayer);\n if (olLayer !== this.mapLayerGroup) {\n cesiumObjects = this.createSingleLayerCounterparts(olLayerWithParents);\n }\n if (!cesiumObjects) {\n olLayer.getLayers().forEach((l) => {\n if (l) {\n const newOlLayerWithParents: LayerWithParents = {\n layer: l,\n parents: olLayer === this.mapLayerGroup ?\n [] :\n [olLayerWithParents.layer].concat(olLayerWithParents.parents)\n };\n fifo.push(newOlLayerWithParents);\n }\n });\n }\n } else {\n cesiumObjects = this.createSingleLayerCounterparts(olLayerWithParents);\n if (!cesiumObjects) {\n // keep an eye on the layers that once failed to be added (might work when the layer is updated)\n // for example when a source is set after the layer is added to the map\n const layerId = olLayerId;\n const layerWithParents = olLayerWithParents;\n const onLayerChange = () => {\n const cesiumObjs = this.createSingleLayerCounterparts(layerWithParents);\n if (cesiumObjs) {\n // unsubscribe event listener\n layerWithParents.layer.un('change', onLayerChange);\n this.addCesiumObjects_(cesiumObjs, layerId, layerWithParents.layer);\n this.orderLayers();\n }\n };\n this.olLayerListenKeys[olLayerId].push(layerWithParents.layer.on('change', onLayerChange));\n }\n }\n // add Cesium layers\n if (cesiumObjects) {\n this.addCesiumObjects_(cesiumObjects, olLayerId, olLayer);\n }\n }\n\n this.orderLayers();\n }\n\n /**\n * Add Cesium objects.\n */\n private addCesiumObjects_(cesiumObjects: Array, layerId: string, layer: BaseLayer) {\n this.layerMap[layerId] = cesiumObjects;\n this.olLayerListenKeys[layerId].push(layer.on('change:zIndex', () => this.orderLayers()));\n cesiumObjects.forEach((cesiumObject) => {\n this.addCesiumObject(cesiumObject);\n });\n }\n\n /**\n * Remove and destroy a single layer.\n * @param {ol.layer.Layer} layer\n * @return {boolean} counterpart destroyed\n */\n private removeAndDestroySingleLayer_(layer: BaseLayer): boolean {\n const uid = getUid(layer).toString();\n const counterparts = this.layerMap[uid];\n if (!!counterparts) {\n counterparts.forEach((counterpart) => {\n this.removeSingleCesiumObject(counterpart, false);\n this.destroyCesiumObject(counterpart);\n });\n this.olLayerListenKeys[uid].forEach(olObservableUnByKey);\n delete this.olLayerListenKeys[uid];\n }\n delete this.layerMap[uid];\n return !!counterparts;\n }\n\n /**\n * Unlisten a single layer group.\n */\n private unlistenSingleGroup_(group: LayerGroup) {\n if (group === this.mapLayerGroup) {\n return;\n }\n const uid = getUid(group).toString();\n const keys = this.olGroupListenKeys_[uid];\n keys.forEach((key) => {\n olObservableUnByKey(key);\n });\n delete this.olGroupListenKeys_[uid];\n delete this.layerMap[uid];\n }\n\n /**\n * Remove layer hierarchy.\n */\n private removeLayer_(root: BaseLayer) {\n if (!!root) {\n const fifo = [root];\n while (fifo.length > 0) {\n const olLayer = fifo.splice(0, 1)[0];\n const done = this.removeAndDestroySingleLayer_(olLayer);\n if (olLayer instanceof LayerGroup) {\n this.unlistenSingleGroup_(olLayer);\n if (!done) {\n // No counterpart for the group itself so removing\n // each of the child layers.\n olLayer.getLayers().forEach((l) => {\n fifo.push(l);\n });\n }\n }\n }\n }\n }\n\n /**\n * Register listeners for single layer group change.\n */\n private listenForGroupChanges_(group: LayerGroup) {\n const uuid = getUid(group).toString();\n\n console.assert(this.olGroupListenKeys_[uuid] === undefined);\n\n const listenKeyArray: EventsKey[] = [];\n this.olGroupListenKeys_[uuid] = listenKeyArray;\n\n // only the keys that need to be relistened when collection changes\n let contentKeys: EventsKey[] = [];\n const listenAddRemove = (function() {\n const collection = group.getLayers();\n if (collection) {\n contentKeys = [\n collection.on('add', (event) => {\n this.addLayers_(event.element);\n }),\n collection.on('remove', (event) => {\n this.removeLayer_(event.element);\n })\n ];\n listenKeyArray.push(...contentKeys);\n }\n }).bind(this);\n\n listenAddRemove();\n\n listenKeyArray.push(group.on('change:layers', (e) => {\n contentKeys.forEach((el) => {\n const i = listenKeyArray.indexOf(el);\n if (i >= 0) {\n listenKeyArray.splice(i, 1);\n }\n olObservableUnByKey(el);\n });\n listenAddRemove();\n }));\n }\n\n /**\n * Destroys all the created Cesium objects.\n */\n public destroyAll() {\n this.removeAllCesiumObjects(true); // destroy\n let objKey;\n for (objKey in this.olGroupListenKeys_) {\n const keys = this.olGroupListenKeys_[objKey];\n keys.forEach(olObservableUnByKey);\n }\n for (objKey in this.olLayerListenKeys) {\n this.olLayerListenKeys[objKey].forEach(olObservableUnByKey);\n }\n this.olGroupListenKeys_ = {};\n this.olLayerListenKeys = {};\n this.layerMap = {};\n }\n\n /**\n * Adds a single Cesium object to the collection.\n */\n protected abstract addCesiumObject(object: T): void;\n\n protected abstract destroyCesiumObject(object: T): void;\n\n /**\n * Remove single Cesium object from the collection.\n */\n protected abstract removeSingleCesiumObject(object: T, destroy: boolean): void;\n\n protected abstract removeAllCesiumObjects(destroy: boolean): void;\n\n protected abstract createSingleLayerCounterparts(olLayerWithParents: LayerWithParents): Array;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.BaseVector;","import type Map from 'ol/Map.js';\nimport {getUid} from './util';\nimport olcsAbstractSynchronizer from './AbstractSynchronizer';\nimport {type LayerWithParents, tileLayerToImageryLayer, updateCesiumLayerProperties} from './core';\nimport type {Scene, ImageryLayer, ImageryLayerCollection} from 'cesium';\nimport type BaseLayer from 'ol/layer/Base.js';\nimport type Projection from 'ol/proj/Projection.js';\nimport BaseVectorLayer from 'ol/layer/BaseVector.js';\nimport LayerGroup from 'ol/layer/Group.js';\n\nexport default class RasterSynchronizer extends olcsAbstractSynchronizer {\n private cesiumLayers_: ImageryLayerCollection;\n private ourLayers_: ImageryLayerCollection;\n /**\n * This object takes care of one-directional synchronization of\n * Openlayers raster layers to the given Cesium globe.\n */\n constructor(map: Map, scene: Scene) {\n super(map, scene);\n\n this.cesiumLayers_ = scene.imageryLayers;\n this.ourLayers_ = new Cesium.ImageryLayerCollection();\n }\n\n addCesiumObject(object: ImageryLayer): void {\n this.cesiumLayers_.add(object);\n this.ourLayers_.add(object);\n }\n\n destroyCesiumObject(object: ImageryLayer): void {\n object.destroy();\n }\n\n removeSingleCesiumObject(object: ImageryLayer, destroy: boolean): void {\n this.cesiumLayers_.remove(object, destroy);\n this.ourLayers_.remove(object, false);\n }\n\n removeAllCesiumObjects(destroy: boolean): void {\n for (let i = 0; i < this.ourLayers_.length; ++i) {\n this.cesiumLayers_.remove(this.ourLayers_.get(i), destroy);\n }\n this.ourLayers_.removeAll(false);\n }\n\n /**\n * Creates an array of Cesium.ImageryLayer.\n * May be overriden by child classes to implement custom behavior.\n * The default implementation handles tiled imageries in EPSG:4326 or\n * EPSG:3859.\n */\n protected convertLayerToCesiumImageries(olLayer: BaseLayer, viewProj: Projection): ImageryLayer[] {\n const result = tileLayerToImageryLayer(this.map, olLayer, viewProj);\n return result ? [result] : null;\n }\n\n createSingleLayerCounterparts(olLayerWithParents: LayerWithParents): ImageryLayer[] {\n const olLayer = olLayerWithParents.layer;\n const uid = getUid(olLayer).toString();\n const viewProj = this.view.getProjection();\n console.assert(viewProj);\n const cesiumObjects = this.convertLayerToCesiumImageries(olLayer, viewProj);\n if (cesiumObjects) {\n const listenKeyArray = [];\n [olLayerWithParents.layer].concat(olLayerWithParents.parents).forEach((olLayerItem) => {\n listenKeyArray.push(olLayerItem.on(['change:opacity', 'change:visible'], () => {\n // the compiler does not seem to be able to infer this\n console.assert(cesiumObjects);\n for (let i = 0; i < cesiumObjects.length; ++i) {\n updateCesiumLayerProperties(olLayerWithParents, cesiumObjects[i]);\n }\n }));\n });\n\n if (olLayer instanceof BaseVectorLayer) {\n let previousStyleFunction = olLayer.getStyleFunction();\n // there is no convenient way to detect a style function change in OL\n listenKeyArray.push(olLayer.on('change', () => {\n const currentStyleFunction = olLayer.getStyleFunction();\n if (previousStyleFunction === currentStyleFunction) {\n return;\n }\n previousStyleFunction = currentStyleFunction;\n for (let i = 0; i < cesiumObjects.length; ++i) {\n const csObj = cesiumObjects[i];\n // clear cache and set new style\n // @ts-ignore TS2341\n if (csObj._imageryCache) {\n // @ts-ignore TS2341\n csObj._imageryCache = {};\n }\n\n const ip = csObj.imageryProvider;\n if (ip) {\n // @ts-ignore TS2341\n ip.tileCache?.clear();\n // @ts-ignore TS2341\n ip.styleFunction_ = currentStyleFunction;\n }\n }\n this.scene.requestRender();\n }));\n }\n\n for (let i = 0; i < cesiumObjects.length; ++i) {\n updateCesiumLayerProperties(olLayerWithParents, cesiumObjects[i]);\n }\n\n // there is no way to modify Cesium layer extent,\n // we have to recreate when OpenLayers layer extent changes:\n listenKeyArray.push(olLayer.on('change:extent', (e) => {\n for (let i = 0; i < cesiumObjects.length; ++i) {\n this.cesiumLayers_.remove(cesiumObjects[i], true); // destroy\n this.ourLayers_.remove(cesiumObjects[i], false);\n }\n delete this.layerMap[getUid(olLayer)]; // invalidate the map entry\n this.synchronize();\n }));\n\n listenKeyArray.push(olLayer.on('change', (e) => {\n // when the source changes, re-add the layer to force update\n for (let i = 0; i < cesiumObjects.length; ++i) {\n const position = this.cesiumLayers_.indexOf(cesiumObjects[i]);\n if (position >= 0) {\n this.cesiumLayers_.remove(cesiumObjects[i], false);\n this.cesiumLayers_.add(cesiumObjects[i], position);\n }\n }\n }));\n\n this.olLayerListenKeys[uid].push(...listenKeyArray);\n }\n\n return Array.isArray(cesiumObjects) ? cesiumObjects : null;\n }\n\n /**\n * Order counterparts using the same algorithm as the Openlayers renderer:\n * z-index then original sequence order.\n * @override\n * @protected\n */\n orderLayers() {\n const layers = [];\n const zIndices: Record = {};\n const queue: Array = [this.mapLayerGroup];\n\n while (queue.length > 0) {\n const olLayer = queue.splice(0, 1)[0];\n layers.push(olLayer);\n zIndices[getUid(olLayer)] = olLayer.getZIndex() || 0;\n\n if (olLayer instanceof LayerGroup) {\n const sublayers = olLayer.getLayers();\n if (sublayers) {\n // Prepend queue with sublayers in order\n queue.unshift(...sublayers.getArray());\n }\n }\n }\n\n // We assume sort is stable (which has been in the spec since a long time already).\n // See https://caniuse.com/mdn-javascript_builtins_array_sort_stable\n layers.sort((layer1, layer2) =>\n zIndices[getUid(layer1)] - zIndices[getUid(layer2)]\n );\n\n layers.forEach((olLayer) => {\n const olLayerId = getUid(olLayer).toString();\n const cesiumObjects = this.layerMap[olLayerId];\n if (cesiumObjects) {\n cesiumObjects.forEach((cesiumObject) => { this.raiseToTop(cesiumObject); });\n }\n });\n }\n\n raiseToTop(counterpart: ImageryLayer) {\n this.cesiumLayers_.raiseToTop(counterpart);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.Vector;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Layer;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.Cluster;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Vector;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.style.Icon;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.geom.Polygon;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.geom.SimpleGeometry;","import {unByKey as olObservableUnByKey} from 'ol/Observable.js';\nimport type Projection from 'ol/proj/Projection.js';\nimport type {Billboard, BillboardCollection, Primitive, PrimitiveCollection, Scene} from 'cesium';\nimport type {EventsKey} from 'ol/events.js';\n\n\n/**\n * Context for feature conversion.\n */\nexport type OlFeatureToCesiumContext = {\n projection: Projection | string,\n billboards: BillboardCollection,\n featureToCesiumMap: Record>,\n primitives: PrimitiveCollection\n};\n\n\nexport default class VectorLayerCounterpart {\n olListenKeys: EventsKey[] = [];\n context: OlFeatureToCesiumContext;\n private rootCollection_: PrimitiveCollection;\n /**\n * Result of the conversion of an OpenLayers layer to Cesium.\n */\n constructor(layerProjection: Projection | string, scene: Scene) {\n const billboards = new Cesium.BillboardCollection({scene});\n const primitives = new Cesium.PrimitiveCollection();\n this.rootCollection_ = new Cesium.PrimitiveCollection();\n this.context = {\n projection: layerProjection,\n billboards,\n featureToCesiumMap: {},\n primitives\n };\n\n this.rootCollection_.add(billboards);\n this.rootCollection_.add(primitives);\n }\n\n /**\n * Unlisten.\n */\n destroy() {\n this.olListenKeys.forEach(olObservableUnByKey);\n this.olListenKeys.length = 0;\n }\n\n getRootPrimitive(): PrimitiveCollection {\n return this.rootCollection_;\n }\n}\n\n\nexport type PrimitiveCollectionCounterpart = PrimitiveCollection & {counterpart: VectorLayerCounterpart};\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.geom;","import OLStyleIcon from 'ol/style/Icon.js';\nimport VectorSource, {type VectorSourceEvent} from 'ol/source/Vector.js';\nimport OLClusterSource from 'ol/source/Cluster.js';\nimport {circular as olCreateCircularPolygon} from 'ol/geom/Polygon.js';\nimport {boundingExtent, getCenter} from 'ol/extent.js';\nimport olGeomSimpleGeometry from 'ol/geom/SimpleGeometry.js';\nimport {convertColorToCesium, olGeometryCloneTo4326, ol4326CoordinateToCesiumCartesian, ol4326CoordinateArrayToCsCartesians} from './core';\nimport VectorLayerCounterpart, {type OlFeatureToCesiumContext} from './core/VectorLayerCounterpart';\nimport {getUid, waitReady} from './util';\nimport type {CircleGeometry, CircleOutlineGeometry, Primitive, Billboard, Label, Matrix4, Scene, Geometry as CSGeometry, Color as CSColor, GroundPrimitive, PrimitiveCollection, ImageMaterialProperty, BillboardCollection, Cartesian3, GroundPolylinePrimitive, PolygonHierarchy, HeightReference, Model, LabelCollection, Material} from 'cesium';\nimport type VectorLayer from 'ol/layer/Vector.js';\nimport type ImageLayer from 'ol/layer/Image.js';\nimport type {Feature, View} from 'ol';\nimport type Text from 'ol/style/Text.js';\nimport {type default as Style, type StyleFunction} from 'ol/style/Style.js';\nimport type {ColorLike as OLColorLike} from 'ol/colorlike.js';\nimport type {Color as OLColor} from 'ol/color.js';\nimport type {ProjectionLike} from 'ol/proj.js';\nimport {Geometry as OLGeometry, type MultiLineString, type MultiPolygon, type MultiPoint, type GeometryCollection, type Circle, type LineString, type Point, type Polygon} from 'ol/geom.js';\nimport type ImageStyle from 'ol/style/Image.js';\n\n\ntype ModelFromGltfOptions = Parameters[0];\n\ntype PrimitiveLayer = VectorLayer | ImageLayer;\n\ndeclare module 'cesium' {\n // eslint-disable-next-line no-unused-vars\n interface Primitive {\n olLayer: PrimitiveLayer;\n olFeature: Feature;\n }\n // eslint-disable-next-line no-unused-vars\n interface GroundPolylinePrimitive {\n olLayer: PrimitiveLayer;\n olFeature: Feature;\n _primitive: Primitive; // Missing from types published by Cesium\n }\n // eslint-disable-next-line no-unused-vars\n interface GroundPrimitive {\n olLayer: PrimitiveLayer;\n olFeature: Feature;\n }\n // eslint-disable-next-line no-unused-vars\n interface Label {\n olLayer: PrimitiveLayer;\n olFeature: Feature;\n }\n // eslint-disable-next-line no-unused-vars\n interface Billboard {\n olLayer: PrimitiveLayer;\n olFeature: Feature;\n }\n}\n\ninterface ModelStyle {\n debugModelMatrix?: Matrix4;\n cesiumOptions: ModelFromGltfOptions;\n}\n\ninterface MaterialAppearanceOptions {\n flat: boolean;\n renderState: {\n depthTest: {\n enabled: boolean;\n },\n lineWidth?: number;\n }\n}\n\nexport default class FeatureConverter {\n\n /**\n * Bind once to have a unique function for using as a listener\n */\n private boundOnRemoveOrClearFeatureListener_ = this.onRemoveOrClearFeature_.bind(this);\n\n private defaultBillboardEyeOffset_ = new Cesium.Cartesian3(0, 0, 10);\n\n /**\n * Concrete base class for converting from OpenLayers3 vectors to Cesium\n * primitives.\n * Extending this class is possible provided that the extending class and\n * the library are compiled together by the closure compiler.\n * @param scene Cesium scene.\n * @api\n */\n constructor(protected scene: Scene) {\n this.scene = scene;\n }\n\n /**\n * @param evt\n */\n private onRemoveOrClearFeature_(evt: VectorSourceEvent) {\n const source = evt.target;\n console.assert(source instanceof VectorSource);\n\n const cancellers = source['olcs_cancellers'];\n if (cancellers) {\n const feature = evt.feature;\n if (feature) {\n // remove\n const id = getUid(feature);\n const canceller = cancellers[id];\n if (canceller) {\n canceller();\n delete cancellers[id];\n }\n } else {\n // clear\n for (const key in cancellers) {\n if (cancellers.hasOwnProperty(key)) {\n cancellers[key]();\n }\n }\n source['olcs_cancellers'] = {};\n }\n }\n }\n\n /**\n * @param layer\n * @param feature OpenLayers feature.\n * @param primitive\n */\n protected setReferenceForPicking(layer: PrimitiveLayer, feature: Feature, primitive: GroundPolylinePrimitive | GroundPrimitive | Primitive| Label|Billboard) {\n primitive.olLayer = layer;\n primitive.olFeature = feature;\n }\n\n /**\n * Basics primitive creation using a color attribute.\n * Note that Cesium has 'interior' and outline geometries.\n * @param layer\n * @param feature OpenLayers feature.\n * @param olGeometry OpenLayers geometry.\n * @param geometry\n * @param color\n * @param opt_lineWidth\n * @return primitive\n */\n protected createColoredPrimitive(layer: PrimitiveLayer, feature: Feature, olGeometry: OLGeometry, geometry: CSGeometry | CircleGeometry, color: CSColor| ImageMaterialProperty, opt_lineWidth?: number): Primitive | GroundPrimitive {\n const createInstance = function(geometry: CSGeometry | CircleGeometry, color: CSColor | ImageMaterialProperty) {\n const instance = new Cesium.GeometryInstance({\n geometry\n });\n if (color && !(color instanceof Cesium.ImageMaterialProperty)) {\n instance.attributes = {\n color: Cesium.ColorGeometryInstanceAttribute.fromColor(color)\n };\n }\n return instance;\n };\n\n const options: MaterialAppearanceOptions = {\n flat: true, // work with all geometries\n renderState: {\n depthTest: {\n enabled: true\n }\n }\n };\n\n if (opt_lineWidth !== undefined) {\n options.renderState.lineWidth = opt_lineWidth;\n }\n\n const instances = createInstance(geometry, color);\n\n const heightReference = this.getHeightReference(layer, feature, olGeometry);\n\n let primitive: GroundPrimitive | Primitive;\n\n if (heightReference === Cesium.HeightReference.CLAMP_TO_GROUND) {\n if (!('createShadowVolume' in instances.geometry.constructor)) {\n // This is not a ground geometry\n return null;\n }\n primitive = new Cesium.GroundPrimitive({\n geometryInstances: instances\n });\n } else {\n primitive = new Cesium.Primitive({\n geometryInstances: instances\n });\n }\n\n if (color instanceof Cesium.ImageMaterialProperty) {\n // FIXME: we created stylings which are not time related\n // What should we pass here?\n // @ts-ignore\n const dataUri = color.image.getValue().toDataURL();\n\n primitive.appearance = new Cesium.MaterialAppearance({\n flat: true,\n renderState: {\n depthTest: {\n enabled: true,\n }\n },\n material: new Cesium.Material({\n fabric: {\n type: 'Image',\n uniforms: {\n image: dataUri\n }\n }\n })\n });\n } else {\n primitive.appearance = new Cesium.MaterialAppearance({\n ...options,\n material: new Cesium.Material({\n translucent: color.alpha !== 1,\n fabric: {\n type: 'Color',\n uniforms: {\n color,\n }\n }\n })\n });\n if (primitive instanceof Cesium.Primitive && (feature.get('olcs_shadows') || layer.get('olcs_shadows'))) {\n primitive.shadows = 1;\n }\n }\n this.setReferenceForPicking(layer, feature, primitive);\n return primitive;\n }\n\n /**\n * Return the fill or stroke color from a plain ol style.\n * @param style\n * @param outline\n * @return {!CSColor}\n */\n protected extractColorFromOlStyle(style: Style | Text, outline: boolean) {\n const fillColor = style.getFill() ? style.getFill().getColor() : null;\n const strokeColor = style.getStroke() ? style.getStroke().getColor() : null;\n\n let olColor: OLColorLike | OLColor = 'black';\n if (strokeColor && outline) {\n olColor = strokeColor;\n } else if (fillColor) {\n olColor = fillColor;\n }\n\n return convertColorToCesium(olColor);\n }\n\n /**\n * Return the width of stroke from a plain ol style.\n * @param style\n * @return {number}\n */\n protected extractLineWidthFromOlStyle(style: Style | Text) {\n // Handling of line width WebGL limitations is handled by Cesium.\n const width = style.getStroke() ? style.getStroke().getWidth() : undefined;\n return width !== undefined ? width : 1;\n }\n\n /**\n * Create a primitive collection out of two Cesium geometries.\n * Only the OpenLayers style colors will be used.\n */\n protected wrapFillAndOutlineGeometries(layer: PrimitiveLayer, feature: Feature, olGeometry: OLGeometry, fillGeometry: CSGeometry | CircleGeometry, outlineGeometry: CSGeometry | CircleOutlineGeometry, olStyle: Style): PrimitiveCollection {\n const fillColor = this.extractColorFromOlStyle(olStyle, false);\n const outlineColor = this.extractColorFromOlStyle(olStyle, true);\n\n const primitives = new Cesium.PrimitiveCollection();\n if (olStyle.getFill()) {\n const p1 = this.createColoredPrimitive(layer, feature, olGeometry,\n fillGeometry, fillColor);\n console.assert(!!p1);\n primitives.add(p1);\n }\n\n if (olStyle.getStroke() && outlineGeometry) {\n const width = this.extractLineWidthFromOlStyle(olStyle);\n const p2 = this.createColoredPrimitive(layer, feature, olGeometry,\n outlineGeometry, outlineColor, width);\n if (p2) {\n // Some outline geometries are not supported by Cesium in clamp to ground\n // mode. These primitives are skipped.\n primitives.add(p2);\n }\n }\n\n return primitives;\n }\n\n // Geometry converters\n\n // FIXME: would make more sense to only accept primitive collection.\n /**\n * Create a Cesium primitive if style has a text component.\n * Eventually return a PrimitiveCollection including current primitive.\n */\n protected addTextStyle(layer: PrimitiveLayer, feature: Feature, geometry: OLGeometry, style: Style, primitive: Primitive | PrimitiveCollection | GroundPolylinePrimitive): PrimitiveCollection {\n let primitives;\n if (!(primitive instanceof Cesium.PrimitiveCollection)) {\n primitives = new Cesium.PrimitiveCollection();\n primitives.add(primitive);\n } else {\n primitives = primitive;\n }\n\n if (!style.getText()) {\n return primitives;\n }\n\n const text = /** @type {!ol.style.Text} */ (style.getText());\n const label = this.olGeometry4326TextPartToCesium(layer, feature, geometry,\n text);\n if (label) {\n primitives.add(label);\n }\n return primitives;\n }\n\n /**\n * Add a billboard to a Cesium.BillboardCollection.\n * Overriding this wrapper allows manipulating the billboard options.\n * @param billboards\n * @param bbOptions\n * @param layer\n * @param feature OpenLayers feature.\n * @param geometry\n * @param style\n * @return newly created billboard\n * @api\n */\n csAddBillboard(billboards: BillboardCollection, bbOptions: Parameters[0], layer: PrimitiveLayer, feature: Feature, geometry: OLGeometry, style: Style): Billboard {\n if (!bbOptions.eyeOffset) {\n bbOptions.eyeOffset = this.defaultBillboardEyeOffset_;\n }\n const bb = billboards.add(bbOptions);\n this.setReferenceForPicking(layer, feature, bb);\n return bb;\n }\n\n /**\n * Convert an OpenLayers circle geometry to Cesium.\n * @api\n */\n olCircleGeometryToCesium(layer: PrimitiveLayer, feature: Feature, olGeometry: Circle, projection: ProjectionLike, olStyle: Style): PrimitiveCollection {\n\n olGeometry = olGeometryCloneTo4326(olGeometry, projection);\n console.assert(olGeometry.getType() == 'Circle');\n\n // ol.Coordinate\n const olCenter = olGeometry.getCenter();\n const height = olCenter.length == 3 ? olCenter[2] : 0.0;\n const olPoint = olCenter.slice();\n olPoint[0] += olGeometry.getRadius();\n\n // Cesium\n const center: Cartesian3 = ol4326CoordinateToCesiumCartesian(olCenter);\n const point: Cartesian3 = ol4326CoordinateToCesiumCartesian(olPoint);\n\n // Accurate computation of straight distance\n const radius = Cesium.Cartesian3.distance(center, point);\n\n const fillGeometry = new Cesium.CircleGeometry({\n center,\n radius,\n height\n });\n\n let outlinePrimitive: Primitive | GroundPrimitive | GroundPolylinePrimitive;\n let outlineGeometry;\n if (this.getHeightReference(layer, feature, olGeometry) === Cesium.HeightReference.CLAMP_TO_GROUND) {\n const width = this.extractLineWidthFromOlStyle(olStyle);\n if (width) {\n const circlePolygon = olCreateCircularPolygon(olGeometry.getCenter(), radius);\n const positions = ol4326CoordinateArrayToCsCartesians(circlePolygon.getLinearRing(0).getCoordinates());\n const op = outlinePrimitive = new Cesium.GroundPolylinePrimitive({\n geometryInstances: new Cesium.GeometryInstance({\n geometry: new Cesium.GroundPolylineGeometry({positions, width}),\n }),\n appearance: new Cesium.PolylineMaterialAppearance({\n material: this.olStyleToCesium(feature, olStyle, true),\n }),\n classificationType: Cesium.ClassificationType.TERRAIN,\n });\n waitReady(outlinePrimitive).then(() => {\n this.setReferenceForPicking(layer, feature, op._primitive);\n });\n }\n } else {\n outlineGeometry = new Cesium.CircleOutlineGeometry({\n center,\n radius,\n extrudedHeight: height,\n height\n });\n }\n\n const primitives = this.wrapFillAndOutlineGeometries(\n layer, feature, olGeometry, fillGeometry, outlineGeometry, olStyle);\n\n if (outlinePrimitive) {\n primitives.add(outlinePrimitive);\n }\n return this.addTextStyle(layer, feature, olGeometry, olStyle, primitives);\n }\n\n\n /**\n * Convert an OpenLayers line string geometry to Cesium.\n * @api\n */\n olLineStringGeometryToCesium(layer: PrimitiveLayer, feature: Feature, olGeometry: LineString, projection: ProjectionLike, olStyle: Style): PrimitiveCollection {\n\n olGeometry = olGeometryCloneTo4326(olGeometry, projection);\n console.assert(olGeometry.getType() == 'LineString');\n\n const positions = ol4326CoordinateArrayToCsCartesians(olGeometry.getCoordinates());\n const width = this.extractLineWidthFromOlStyle(olStyle);\n\n let outlinePrimitive: Primitive | GroundPolylinePrimitive;\n const heightReference = this.getHeightReference(layer, feature, olGeometry);\n\n const appearance = new Cesium.PolylineMaterialAppearance({\n material: this.olStyleToCesium(feature, olStyle, true)\n });\n if (heightReference === Cesium.HeightReference.CLAMP_TO_GROUND) {\n const geometry = new Cesium.GroundPolylineGeometry({\n positions,\n width,\n });\n const op = outlinePrimitive = new Cesium.GroundPolylinePrimitive({\n appearance,\n geometryInstances: new Cesium.GeometryInstance({\n geometry\n })\n });\n waitReady(outlinePrimitive).then(() => {\n this.setReferenceForPicking(layer, feature, op._primitive);\n });\n } else {\n const geometry = new Cesium.PolylineGeometry({\n positions,\n width,\n vertexFormat: appearance.vertexFormat\n });\n outlinePrimitive = new Cesium.Primitive({\n appearance,\n geometryInstances: new Cesium.GeometryInstance({\n geometry\n }),\n });\n }\n\n this.setReferenceForPicking(layer, feature, outlinePrimitive);\n\n return this.addTextStyle(layer, feature, olGeometry, olStyle, outlinePrimitive);\n }\n\n /**\n * Convert an OpenLayers polygon geometry to Cesium.\n * @api\n */\n olPolygonGeometryToCesium(layer: PrimitiveLayer, feature: Feature, olGeometry: Polygon, projection: ProjectionLike, olStyle: Style): PrimitiveCollection {\n\n olGeometry = olGeometryCloneTo4326(olGeometry, projection);\n console.assert(olGeometry.getType() == 'Polygon');\n\n const heightReference = this.getHeightReference(layer, feature, olGeometry);\n\n let fillGeometry, outlineGeometry;\n let outlinePrimitive: GroundPolylinePrimitive;\n if ((olGeometry.getCoordinates()[0].length == 5) &&\n (feature.get('olcs.polygon_kind') === 'rectangle')) {\n // Create a rectangle according to the longitude and latitude curves\n const coordinates = olGeometry.getCoordinates()[0];\n // Extract the West, South, East, North coordinates\n const extent = boundingExtent(coordinates);\n const rectangle = Cesium.Rectangle.fromDegrees(extent[0], extent[1],\n extent[2], extent[3]);\n\n // Extract the average height of the vertices\n let maxHeight = 0.0;\n if (coordinates[0].length == 3) {\n for (let c = 0; c < coordinates.length; c++) {\n maxHeight = Math.max(maxHeight, coordinates[c][2]);\n }\n }\n\n const featureExtrudedHeight = feature.get('olcs_extruded_height');\n\n // Render the cartographic rectangle\n fillGeometry = new Cesium.RectangleGeometry({\n ellipsoid: Cesium.Ellipsoid.WGS84,\n rectangle,\n height: maxHeight,\n extrudedHeight: featureExtrudedHeight,\n });\n\n outlineGeometry = new Cesium.RectangleOutlineGeometry({\n ellipsoid: Cesium.Ellipsoid.WGS84,\n rectangle,\n height: maxHeight,\n extrudedHeight: featureExtrudedHeight,\n });\n } else {\n const rings = olGeometry.getLinearRings();\n const hierarchy: PolygonHierarchy = {\n positions: [],\n holes: [],\n };\n const polygonHierarchy: PolygonHierarchy = hierarchy;\n console.assert(rings.length > 0);\n\n for (let i = 0; i < rings.length; ++i) {\n const olPos = rings[i].getCoordinates();\n const positions = ol4326CoordinateArrayToCsCartesians(olPos);\n console.assert(positions && positions.length > 0);\n if (i === 0) {\n hierarchy.positions = positions;\n } else {\n hierarchy.holes.push({\n positions,\n holes: [],\n });\n }\n }\n\n const featureExtrudedHeight = feature.get('olcs_extruded_height');\n\n fillGeometry = new Cesium.PolygonGeometry({\n polygonHierarchy,\n perPositionHeight: true,\n extrudedHeight: featureExtrudedHeight,\n });\n\n // Since Cesium doesn't yet support Polygon outlines on terrain yet (coming soon...?)\n // we don't create an outline geometry if clamped, but instead do the polyline method\n // for each ring. Most of this code should be removeable when Cesium adds\n // support for Polygon outlines on terrain.\n if (heightReference === Cesium.HeightReference.CLAMP_TO_GROUND) {\n const width = this.extractLineWidthFromOlStyle(olStyle);\n if (width > 0) {\n const positions: Cartesian3[][] = [hierarchy.positions];\n if (hierarchy.holes) {\n for (let i = 0; i < hierarchy.holes.length; ++i) {\n positions.push(hierarchy.holes[i].positions);\n }\n }\n const appearance = new Cesium.PolylineMaterialAppearance({\n material: this.olStyleToCesium(feature, olStyle, true)\n });\n const geometryInstances = [];\n for (const linePositions of positions) {\n const polylineGeometry = new Cesium.GroundPolylineGeometry({positions: linePositions, width});\n geometryInstances.push(new Cesium.GeometryInstance({\n geometry: polylineGeometry\n }));\n }\n outlinePrimitive = new Cesium.GroundPolylinePrimitive({\n appearance,\n geometryInstances\n });\n waitReady(outlinePrimitive).then(() => {\n this.setReferenceForPicking(layer, feature, outlinePrimitive._primitive);\n });\n }\n } else {\n // Actually do the normal polygon thing. This should end the removable\n // section of code described above.\n outlineGeometry = new Cesium.PolygonOutlineGeometry({\n polygonHierarchy: hierarchy,\n perPositionHeight: true,\n extrudedHeight: featureExtrudedHeight,\n });\n }\n }\n\n const primitives = this.wrapFillAndOutlineGeometries(\n layer, feature, olGeometry, fillGeometry, outlineGeometry, olStyle);\n\n if (outlinePrimitive) {\n primitives.add(outlinePrimitive);\n }\n\n return this.addTextStyle(layer, feature, olGeometry, olStyle, primitives);\n }\n\n /**\n * @api\n */\n getHeightReference(layer: PrimitiveLayer, feature: Feature, geometry: OLGeometry): HeightReference {\n\n // Read from the geometry\n let altitudeMode = geometry.get('altitudeMode');\n\n // Or from the feature\n if (altitudeMode === undefined) {\n altitudeMode = feature.get('altitudeMode');\n }\n\n // Or from the layer\n if (altitudeMode === undefined) {\n altitudeMode = layer.get('altitudeMode');\n }\n\n let heightReference = Cesium.HeightReference.NONE;\n if (altitudeMode === 'clampToGround') {\n heightReference = Cesium.HeightReference.CLAMP_TO_GROUND;\n } else if (altitudeMode === 'relativeToGround') {\n heightReference = Cesium.HeightReference.RELATIVE_TO_GROUND;\n }\n\n return heightReference;\n }\n\n /**\n * Convert a point geometry to a Cesium BillboardCollection.\n * @param {ol.layer.Vector|ol.layer.Image} layer\n * @param {!ol.Feature} feature OpenLayers feature..\n * @param {!ol.geom.Point} olGeometry OpenLayers point geometry.\n * @param {!ol.ProjectionLike} projection\n * @param {!ol.style.Style} style\n * @param {!ol.style.Image} imageStyle\n * @param {!Cesium.BillboardCollection} billboards\n * @param {function(!Cesium.Billboard)=} opt_newBillboardCallback Called when the new billboard is added.\n * @api\n */\n createBillboardFromImage(\n layer: PrimitiveLayer,\n feature: Feature,\n olGeometry: Point,\n projection: ProjectionLike,\n style: Style,\n imageStyle: ImageStyle,\n billboards: BillboardCollection,\n opt_newBillboardCallback: (bb: Billboard) => void,\n ) {\n if (imageStyle instanceof OLStyleIcon) {\n // make sure the image is scheduled for load\n imageStyle.load();\n }\n\n const image = imageStyle.getImage(1); // get normal density\n const isImageLoaded = function(image: HTMLImageElement) {\n return image.src != '' &&\n image.naturalHeight != 0 &&\n image.naturalWidth != 0 &&\n image.complete;\n };\n const reallyCreateBillboard = (function() {\n if (!image) {\n return;\n }\n if (!(image instanceof HTMLCanvasElement ||\n image instanceof Image ||\n image instanceof HTMLImageElement)) {\n return;\n }\n const center = olGeometry.getCoordinates();\n const position = ol4326CoordinateToCesiumCartesian(center);\n let color;\n const opacity = imageStyle.getOpacity();\n if (opacity !== undefined) {\n color = new Cesium.Color(1.0, 1.0, 1.0, opacity);\n }\n\n const scale = imageStyle.getScale();\n const heightReference = this.getHeightReference(layer, feature, olGeometry);\n\n const bbOptions: Parameters[0] = {\n image,\n color,\n scale,\n heightReference,\n position\n };\n\n // merge in cesium options from openlayers feature\n Object.assign(bbOptions, feature.get('cesiumOptions'));\n\n if (imageStyle instanceof OLStyleIcon) {\n const anchor = imageStyle.getAnchor();\n if (anchor) {\n const xScale = (Array.isArray(scale) ? scale[0] : scale);\n const yScale = (Array.isArray(scale) ? scale[1] : scale);\n bbOptions.pixelOffset = new Cesium.Cartesian2(\n (image.width / 2 - anchor[0]) * xScale,\n (image.height / 2 - anchor[1]) * yScale\n );\n }\n }\n\n const bb = this.csAddBillboard(billboards, bbOptions, layer, feature, olGeometry, style);\n if (opt_newBillboardCallback) {\n opt_newBillboardCallback(bb);\n }\n }).bind(this);\n\n if (image instanceof Image && !isImageLoaded(image)) {\n // Cesium requires the image to be loaded\n let cancelled = false;\n const source = layer.getSource();\n const canceller = function() {\n cancelled = true;\n };\n source.on(['removefeature', 'clear'],\n this.boundOnRemoveOrClearFeatureListener_);\n let cancellers = source['olcs_cancellers'];\n if (!cancellers) {\n cancellers = source['olcs_cancellers'] = {};\n }\n\n const fuid = getUid(feature);\n if (cancellers[fuid]) {\n // When the feature change quickly, a canceller may still be present so\n // we cancel it here to prevent creation of a billboard.\n cancellers[fuid]();\n }\n cancellers[fuid] = canceller;\n\n const listener = function() {\n image.removeEventListener('load', listener);\n if (!billboards.isDestroyed() && !cancelled) {\n // Create billboard if the feature is still displayed on the map.\n reallyCreateBillboard();\n }\n };\n\n image.addEventListener('load', listener);\n } else {\n reallyCreateBillboard();\n }\n }\n\n /**\n * Convert a point geometry to a Cesium BillboardCollection.\n * @param layer\n * @param feature OpenLayers feature..\n * @param olGeometry OpenLayers point geometry.\n * @param projection\n * @param style\n * @param billboards\n * @param opt_newBillboardCallback Called when the new billboard is added.\n * @return primitives\n * @api\n */\n olPointGeometryToCesium(\n layer: PrimitiveLayer,\n feature: Feature,\n olGeometry: Point,\n projection: ProjectionLike,\n style: Style,\n billboards: BillboardCollection,\n opt_newBillboardCallback?: (bb: Billboard) => void\n ): PrimitiveCollection {\n console.assert(olGeometry.getType() == 'Point');\n olGeometry = olGeometryCloneTo4326(olGeometry, projection);\n\n let modelPrimitive: PrimitiveCollection = null;\n const imageStyle = style.getImage();\n if (imageStyle) {\n const olcsModelFunction: () => ModelStyle = olGeometry.get('olcs_model') || feature.get('olcs_model');\n if (olcsModelFunction) {\n modelPrimitive = new Cesium.PrimitiveCollection();\n const olcsModel = olcsModelFunction();\n const options: ModelFromGltfOptions = Object.assign({}, {scene: this.scene}, olcsModel.cesiumOptions);\n if ('fromGltf' in Cesium.Model) {\n // pre Cesium v107\n // @ts-ignore\n const model = Cesium.Model.fromGltf(options);\n modelPrimitive.add(model);\n } else {\n Cesium.Model.fromGltfAsync(options).then((model) => {\n modelPrimitive.add(model);\n });\n }\n\n if (olcsModel.debugModelMatrix) {\n modelPrimitive.add(new Cesium.DebugModelMatrixPrimitive({\n modelMatrix: olcsModel.debugModelMatrix\n }));\n }\n } else {\n this.createBillboardFromImage(layer, feature, olGeometry, projection, style, imageStyle, billboards, opt_newBillboardCallback);\n }\n }\n\n if (style.getText()) {\n return this.addTextStyle(layer, feature, olGeometry, style, modelPrimitive || new Cesium.Primitive());\n } else {\n return modelPrimitive;\n }\n }\n\n /**\n * Convert an OpenLayers multi-something geometry to Cesium.\n * @param {ol.layer.Vector|ol.layer.Image} layer\n * @param {!ol.Feature} feature OpenLayers feature..\n * @param {!ol.geom.Geometry} geometry OpenLayers geometry.\n * @param {!ol.ProjectionLike} projection\n * @param {!ol.style.Style} olStyle\n * @param {!Cesium.BillboardCollection} billboards\n * @param {function(!Cesium.Billboard)=} opt_newBillboardCallback Called when\n * the new billboard is added.\n * @return {Cesium.Primitive} primitives\n * @api\n */\n olMultiGeometryToCesium(\n layer: PrimitiveLayer,\n feature: Feature,\n geometry: OLGeometry,\n projection: ProjectionLike,\n olStyle: Style,\n billboards: BillboardCollection,\n opt_newBillboardCallback: (bb: Billboard) => void\n ) {\n // Do not reproject to 4326 now because it will be done later.\n\n switch (geometry.getType()) {\n case 'MultiPoint': {\n const points = (geometry as MultiPoint).getPoints();\n if (olStyle.getText()) {\n const primitives = new Cesium.PrimitiveCollection();\n points.forEach((geom) => {\n console.assert(geom);\n const result = this.olPointGeometryToCesium(layer, feature, geom,\n projection, olStyle, billboards, opt_newBillboardCallback);\n if (result) {\n primitives.add(result);\n }\n });\n return primitives;\n } else {\n points.forEach((geom) => {\n console.assert(geom);\n this.olPointGeometryToCesium(layer, feature, geom, projection,\n olStyle, billboards, opt_newBillboardCallback);\n });\n return null;\n }\n }\n case 'MultiLineString': {\n const lineStrings = (geometry as MultiLineString).getLineStrings();\n // FIXME: would be better to combine all child geometries in one primitive\n // instead we create n primitives for simplicity.\n const primitives = new Cesium.PrimitiveCollection();\n lineStrings.forEach((geom) => {\n const p = this.olLineStringGeometryToCesium(layer, feature, geom, projection, olStyle);\n primitives.add(p);\n });\n return primitives;\n }\n case 'MultiPolygon': {\n const polygons = (geometry as MultiPolygon).getPolygons();\n // FIXME: would be better to combine all child geometries in one primitive\n // instead we create n primitives for simplicity.\n const primitives = new Cesium.PrimitiveCollection();\n polygons.forEach((geom) => {\n const p = this.olPolygonGeometryToCesium(layer, feature, geom, projection, olStyle);\n primitives.add(p);\n });\n return primitives;\n }\n default:\n console.assert(false, `Unhandled multi geometry type${geometry.getType()}`);\n }\n }\n\n /**\n * Convert an OpenLayers text style to Cesium.\n * @api\n */\n olGeometry4326TextPartToCesium(layer: PrimitiveLayer, feature: Feature, geometry: OLGeometry, style: Text): LabelCollection {\n const text = style.getText();\n if (!text) {\n return null;\n }\n\n const labels = new Cesium.LabelCollection({scene: this.scene});\n // TODO: export and use the text draw position from OpenLayers .\n // See src/ol/render/vector.js\n const extentCenter = getCenter(geometry.getExtent());\n if (geometry instanceof olGeomSimpleGeometry) {\n const first = geometry.getFirstCoordinate();\n extentCenter[2] = first.length == 3 ? first[2] : 0.0;\n }\n const options: Parameters[0] = {};\n\n options.position = ol4326CoordinateToCesiumCartesian(extentCenter);\n\n options.text = text;\n\n options.heightReference = this.getHeightReference(layer, feature, geometry);\n\n const offsetX = style.getOffsetX();\n const offsetY = style.getOffsetY();\n if (offsetX != 0 || offsetY != 0) {\n const offset = new Cesium.Cartesian2(offsetX, offsetY);\n options.pixelOffset = offset;\n }\n\n options.font = style.getFont() || '10px sans-serif'; // OpenLayers default\n\n let labelStyle = undefined;\n if (style.getFill()) {\n options.fillColor = this.extractColorFromOlStyle(style, false);\n labelStyle = Cesium.LabelStyle.FILL;\n }\n if (style.getStroke()) {\n options.outlineWidth = this.extractLineWidthFromOlStyle(style);\n options.outlineColor = this.extractColorFromOlStyle(style, true);\n labelStyle = Cesium.LabelStyle.OUTLINE;\n }\n if (style.getFill() && style.getStroke()) {\n labelStyle = Cesium.LabelStyle.FILL_AND_OUTLINE;\n }\n options.style = labelStyle;\n\n let horizontalOrigin;\n switch (style.getTextAlign()) {\n case 'left':\n horizontalOrigin = Cesium.HorizontalOrigin.LEFT;\n break;\n case 'right':\n horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;\n break;\n case 'center':\n default:\n horizontalOrigin = Cesium.HorizontalOrigin.CENTER;\n }\n options.horizontalOrigin = horizontalOrigin;\n\n if (style.getTextBaseline()) {\n let verticalOrigin;\n switch (style.getTextBaseline()) {\n case 'top':\n verticalOrigin = Cesium.VerticalOrigin.TOP;\n break;\n case 'middle':\n verticalOrigin = Cesium.VerticalOrigin.CENTER;\n break;\n case 'bottom':\n verticalOrigin = Cesium.VerticalOrigin.BOTTOM;\n break;\n case 'alphabetic':\n verticalOrigin = Cesium.VerticalOrigin.TOP;\n break;\n case 'hanging':\n verticalOrigin = Cesium.VerticalOrigin.BOTTOM;\n break;\n default:\n console.assert(false, `unhandled baseline ${style.getTextBaseline()}`);\n }\n options.verticalOrigin = verticalOrigin;\n }\n\n\n const l = labels.add(options);\n this.setReferenceForPicking(layer, feature, l);\n return labels;\n }\n\n /**\n * Convert an OpenLayers style to a Cesium Material.\n * @api\n */\n olStyleToCesium(feature: Feature, style: Style, outline: boolean): Material {\n const fill = style.getFill();\n const stroke = style.getStroke();\n if ((outline && !stroke) || (!outline && !fill)) {\n return null; // FIXME use a default style? Developer error?\n }\n\n const olColor = outline ? stroke.getColor() : fill.getColor();\n const color = convertColorToCesium(olColor);\n\n if (outline && stroke.getLineDash()) {\n return Cesium.Material.fromType('Stripe', {\n horizontal: false,\n repeat: 500, // TODO how to calculate this?\n evenColor: color,\n oddColor: new Cesium.Color(0, 0, 0, 0) // transparent\n });\n } else {\n return Cesium.Material.fromType('Color', {\n color\n });\n }\n\n }\n\n /**\n * Compute OpenLayers plain style.\n * Evaluates style function, blend arrays, get default style.\n * @api\n */\n computePlainStyle(layer: PrimitiveLayer, feature: Feature, fallbackStyleFunction: StyleFunction, resolution: number): Style[] {\n /**\n * @type {ol.FeatureStyleFunction|undefined}\n */\n const featureStyleFunction = feature.getStyleFunction();\n\n /**\n * @type {ol.style.Style|Array.}\n */\n let style = null;\n\n if (featureStyleFunction) {\n style = featureStyleFunction(feature, resolution);\n }\n\n if (!style && fallbackStyleFunction) {\n style = fallbackStyleFunction(feature, resolution);\n }\n\n if (!style) {\n // The feature must not be displayed\n return null;\n }\n\n // FIXME combine materials as in cesium-materials-pack?\n // then this function must return a custom material\n // More simply, could blend the colors like described in\n // http://en.wikipedia.org/wiki/Alpha_compositing\n return Array.isArray(style) ? style : [style];\n }\n\n /**\n */\n protected getGeometryFromFeature(feature: Feature, style: Style, opt_geom?: OLGeometry): OLGeometry | undefined {\n if (opt_geom) {\n return opt_geom;\n }\n\n const geom3d: OLGeometry = feature.get('olcs.3d_geometry');\n if (geom3d && geom3d instanceof OLGeometry) {\n return geom3d;\n }\n\n if (style) {\n const geomFuncRes = style.getGeometryFunction()(feature);\n if (geomFuncRes instanceof OLGeometry) {\n return geomFuncRes;\n }\n }\n\n return feature.getGeometry();\n }\n\n /**\n * Convert one OpenLayers feature up to a collection of Cesium primitives.\n * @api\n */\n olFeatureToCesium(layer: PrimitiveLayer, feature: Feature, style: Style, context: OlFeatureToCesiumContext, opt_geom?: OLGeometry): PrimitiveCollection {\n const geom: OLGeometry = this.getGeometryFromFeature(feature, style, opt_geom);\n\n if (!geom) {\n // OpenLayers features may not have a geometry\n // See http://geojson.org/geojson-spec.html#feature-objects\n return null;\n }\n\n const proj = context.projection;\n const newBillboardAddedCallback = function(bb: Billboard) {\n const featureBb = context.featureToCesiumMap[getUid(feature)];\n if (featureBb instanceof Array) {\n featureBb.push(bb);\n }\n else {\n context.featureToCesiumMap[getUid(feature)] = [bb];\n }\n };\n\n switch (geom.getType()) {\n case 'GeometryCollection':\n const primitives = new Cesium.PrimitiveCollection();\n (geom as GeometryCollection).getGeometriesArray().forEach((geom) => {\n if (geom) {\n const prims = this.olFeatureToCesium(layer, feature, style, context,\n geom);\n if (prims) {\n primitives.add(prims);\n }\n }\n });\n return primitives;\n case 'Point':\n const bbs = context.billboards;\n const result = this.olPointGeometryToCesium(layer, feature, geom as Point, proj,\n style, bbs, newBillboardAddedCallback);\n if (!result) {\n // no wrapping primitive\n return null;\n } else {\n return result;\n }\n case 'Circle':\n return this.olCircleGeometryToCesium(layer, feature, geom as Circle, proj,\n style);\n case 'LineString':\n return this.olLineStringGeometryToCesium(layer, feature, geom as LineString, proj,\n style);\n case 'Polygon':\n return this.olPolygonGeometryToCesium(layer, feature, geom as Polygon, proj,\n style);\n case 'MultiPoint':\n return this.olMultiGeometryToCesium(layer, feature, geom as MultiPoint, proj,\n style, context.billboards, newBillboardAddedCallback) || null;\n case 'MultiLineString':\n return this.olMultiGeometryToCesium(layer, feature, geom as MultiLineString, proj,\n style, context.billboards, newBillboardAddedCallback) || null;\n case 'MultiPolygon':\n return this.olMultiGeometryToCesium(layer, feature, geom as MultiPolygon, proj,\n style, context.billboards, newBillboardAddedCallback) || null;\n case 'LinearRing':\n throw new Error('LinearRing should only be part of polygon.');\n default:\n throw new Error(`Ol geom type not handled : ${geom.getType()}`);\n }\n }\n\n /**\n * Convert an OpenLayers vector layer to Cesium primitive collection.\n * For each feature, the associated primitive will be stored in\n * `featurePrimitiveMap`.\n * @api\n */\n olVectorLayerToCesium(olLayer: VectorLayer, olView: View, featurePrimitiveMap: Record): VectorLayerCounterpart {\n const proj = olView.getProjection();\n const resolution = olView.getResolution();\n\n if (resolution === undefined || !proj) {\n console.assert(false, 'View not ready');\n // an assertion is not enough for closure to assume resolution and proj\n // are defined\n throw new Error('View not ready');\n }\n\n let source = olLayer.getSource();\n if (source instanceof OLClusterSource) {\n source = source.getSource();\n }\n\n console.assert(source instanceof VectorSource);\n const features = source.getFeatures();\n const counterpart = new VectorLayerCounterpart(proj, this.scene);\n const context = counterpart.context;\n for (let i = 0; i < features.length; ++i) {\n const feature = features[i];\n if (!feature) {\n continue;\n }\n const layerStyle: StyleFunction | undefined = olLayer.getStyleFunction();\n const styles = this.computePlainStyle(olLayer, feature, layerStyle,\n resolution);\n if (!styles || !styles.length) {\n // only 'render' features with a style\n continue;\n }\n\n let primitives: PrimitiveCollection = null;\n for (let i = 0; i < styles.length; i++) {\n const prims = this.olFeatureToCesium(olLayer, feature, styles[i], context);\n if (prims) {\n if (!primitives) {\n primitives = prims;\n } else if (prims) {\n let i = 0, prim;\n while ((prim = prims.get(i))) {\n primitives.add(prim);\n i++;\n }\n }\n }\n }\n if (!primitives) {\n continue;\n }\n featurePrimitiveMap[getUid(feature)] = primitives;\n counterpart.getRootPrimitive().add(primitives);\n }\n\n return counterpart;\n }\n\n /**\n * Convert an OpenLayers feature to Cesium primitive collection.\n * @api\n */\n convert(layer: VectorLayer, view: View, feature: Feature, context: OlFeatureToCesiumContext): PrimitiveCollection {\n const proj = view.getProjection();\n const resolution = view.getResolution();\n\n if (resolution == undefined || !proj) {\n return null;\n }\n\n /**\n * @type {ol.StyleFunction|undefined}\n */\n const layerStyle = layer.getStyleFunction();\n\n const styles = this.computePlainStyle(layer, feature, layerStyle, resolution);\n\n if (!styles || !styles.length) {\n // only 'render' features with a style\n return null;\n }\n\n context.projection = proj;\n\n /**\n * @type {Cesium.Primitive|null}\n */\n let primitives = null;\n for (let i = 0; i < styles.length; i++) {\n const prims = this.olFeatureToCesium(layer, feature, styles[i], context);\n if (!primitives) {\n primitives = prims;\n } else if (prims) {\n let i = 0, prim;\n while ((prim = prims.get(i))) {\n primitives.add(prim);\n i++;\n }\n }\n }\n return primitives;\n }\n}\n","import olSourceVector, {type VectorSourceEvent} from 'ol/source/Vector.js';\nimport olLayerLayer from 'ol/layer/Layer.js';\nimport olSourceCluster from 'ol/source/Cluster.js';\nimport {getUid} from './util';\nimport olLayerVector from 'ol/layer/Vector.js';\nimport olLayerVectorTile from 'ol/layer/VectorTile.js';\nimport olcsAbstractSynchronizer from './AbstractSynchronizer';\nimport olcsFeatureConverter from './FeatureConverter';\nimport type VectorLayerCounterpart from './core/VectorLayerCounterpart';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n type OlFeatureToCesiumContext,\n type PrimitiveCollectionCounterpart\n} from './core/VectorLayerCounterpart';\nimport type Map from 'ol/Map.js';\nimport {type LayerWithParents} from './core';\nimport type Feature from 'ol/Feature.js';\nimport type BaseLayer from 'ol/layer/Base.js';\nimport type {PrimitiveCollection, Scene} from 'cesium';\n\nexport default class VectorSynchronizer extends olcsAbstractSynchronizer {\n protected converter: olcsFeatureConverter;\n private csAllPrimitives_: PrimitiveCollection;\n /**\n * Unidirectionally synchronize OpenLayers vector layers to Cesium.\n */\n constructor(map: Map, scene: Scene, opt_converter?: olcsFeatureConverter) {\n super(map, scene);\n\n this.converter = opt_converter || new olcsFeatureConverter(scene);\n this.csAllPrimitives_ = new Cesium.PrimitiveCollection();\n scene.primitives.add(this.csAllPrimitives_);\n this.csAllPrimitives_.destroyPrimitives = false;\n }\n\n addCesiumObject(counterpart: VectorLayerCounterpart) {\n console.assert(counterpart);\n const collection = counterpart.getRootPrimitive();\n collection.counterpart = counterpart;\n this.csAllPrimitives_.add(counterpart.getRootPrimitive());\n }\n\n destroyCesiumObject(object: VectorLayerCounterpart) {\n object.getRootPrimitive().destroy();\n }\n\n removeSingleCesiumObject(object: VectorLayerCounterpart, destroy: boolean) {\n object.destroy();\n this.csAllPrimitives_.destroyPrimitives = destroy;\n this.csAllPrimitives_.remove(object.getRootPrimitive());\n this.csAllPrimitives_.destroyPrimitives = false;\n }\n\n removeAllCesiumObjects(destroy: boolean) {\n this.csAllPrimitives_.destroyPrimitives = destroy;\n if (destroy) {\n for (let i = 0; i < this.csAllPrimitives_.length; ++i) {\n this.csAllPrimitives_.get(i)['counterpart'].destroy();\n }\n }\n this.csAllPrimitives_.removeAll();\n this.csAllPrimitives_.destroyPrimitives = false;\n }\n\n /**\n * Synchronizes the layer visibility properties\n * to the given Cesium Primitive.\n */\n updateLayerVisibility(olLayerWithParents: LayerWithParents, csPrimitive: PrimitiveCollection) {\n let visible = true;\n [olLayerWithParents.layer].concat(olLayerWithParents.parents).forEach((olLayer) => {\n const layerVisible = olLayer.getVisible();\n if (layerVisible !== undefined) {\n visible = visible && layerVisible;\n } else {\n visible = false;\n }\n });\n csPrimitive.show = visible;\n }\n\n createSingleLayerCounterparts(olLayerWithParents: LayerWithParents): VectorLayerCounterpart[] {\n const olLayer: BaseLayer = olLayerWithParents.layer;\n if (!(olLayer instanceof olLayerVector) || olLayer instanceof olLayerVectorTile) {\n return null;\n }\n console.assert(olLayer instanceof olLayerLayer);\n\n let source = olLayer.getSource();\n if (source instanceof olSourceCluster) {\n source = source.getSource();\n }\n\n if (!source) {\n return null;\n }\n\n console.assert(source instanceof olSourceVector);\n console.assert(this.view);\n\n const view = this.view;\n const featurePrimitiveMap: Record = {};\n const counterpart: VectorLayerCounterpart = this.converter.olVectorLayerToCesium(olLayer, view, featurePrimitiveMap);\n const csPrimitives = counterpart.getRootPrimitive();\n const olListenKeys = counterpart.olListenKeys;\n\n [olLayerWithParents.layer].concat(olLayerWithParents.parents).forEach((olLayerItem) => {\n olListenKeys.push(olLayerItem.on('change:visible', () => {\n this.updateLayerVisibility(olLayerWithParents, csPrimitives);\n }));\n });\n this.updateLayerVisibility(olLayerWithParents, csPrimitives);\n\n const onAddFeature = (feature: Feature) => {\n const context = counterpart.context;\n const prim: PrimitiveCollection = this.converter.convert(olLayer, view, feature, context);\n if (prim) {\n featurePrimitiveMap[getUid(feature)] = prim;\n csPrimitives.add(prim);\n }\n };\n\n const onRemoveFeature = (feature: Feature) => {\n const id = getUid(feature);\n const context: OlFeatureToCesiumContext = counterpart.context;\n const bbs = context.featureToCesiumMap[id];\n if (bbs) {\n delete context.featureToCesiumMap[id];\n bbs.forEach((bb) => {\n if (bb instanceof Cesium.Billboard) {\n context.billboards.remove(bb);\n }\n });\n }\n const csPrimitive = featurePrimitiveMap[id];\n delete featurePrimitiveMap[id];\n if (csPrimitive) {\n csPrimitives.remove(csPrimitive);\n }\n };\n\n olListenKeys.push(source.on('addfeature', (e: VectorSourceEvent) => {\n console.assert(e.feature);\n onAddFeature(e.feature);\n }));\n\n olListenKeys.push(source.on('removefeature', (e: VectorSourceEvent) => {\n console.assert(e.feature);\n onRemoveFeature(e.feature);\n }));\n\n olListenKeys.push(source.on('changefeature', (e: VectorSourceEvent) => {\n const feature = e.feature;\n console.assert(feature);\n onRemoveFeature(feature);\n onAddFeature(feature);\n }));\n\n return counterpart ? [counterpart] : null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = ol.Overlay;","import OLOverlay from 'ol/Overlay.js';\nimport {transform} from 'ol/proj.js';\nimport {unByKey as olObservableUnByKey} from 'ol/Observable.js';\nimport type {Scene} from 'cesium';\nimport type OverlaySynchronizer from './OverlaySynchronizer';\nimport type {EventsKey} from 'ol/events';\nimport type {ObjectEvent} from 'ol/Object';\n\n\n/**\n * @param node The node to remove.\n * @return The node that was removed or null.\n */\nfunction removeNode(node: Node): Node {\n return node && node.parentNode ? node.parentNode.removeChild(node) : null;\n}\n\n/**\n * @param {Node} node The node to remove the children from.\n */\nfunction removeChildren(node: Node) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n}\n\nfunction cloneNode(node: T, parent: U): T {\n const clone = node.cloneNode() as T;\n if (node.nodeName === 'CANVAS') {\n const ctx = (clone as unknown as HTMLCanvasElement).getContext('2d');\n ctx.drawImage(node as unknown as HTMLCanvasElement, 0, 0);\n }\n if (parent) {\n parent.appendChild(clone);\n }\n if (node.nodeType !== Node.TEXT_NODE) {\n clone.addEventListener('click', (event) => {\n node.dispatchEvent(new MouseEvent('click', event));\n event.stopPropagation();\n });\n }\n const nodes = node.childNodes;\n for (let i = 0; i < nodes.length; i++) {\n if (!nodes[i]) {\n continue;\n }\n cloneNode(nodes[i], clone);\n }\n return clone;\n}\n\n\ninterface SynchronizedOverlayOptions {\n scene: Scene;\n parent: OLOverlay;\n synchronizer: OverlaySynchronizer;\n}\n\n\nexport default class SynchronizedOverlay extends OLOverlay {\n\n private scenePostRenderListenerRemover_?: Function = null;\n private scene_: Scene;\n private synchronizer_: OverlaySynchronizer;\n private parent_: OLOverlay;\n private positionWGS84_: number[];\n private observer_: MutationObserver;\n private attributeObserver_: MutationObserver[] = [];\n private listenerKeys_: EventsKey[];\n\n\n /**\n * @param options SynchronizedOverlay Options.\n * @api\n */\n constructor(options: SynchronizedOverlayOptions) {\n const parent = options.parent;\n super(parent.getOptions());\n this.scene_ = options.scene;\n this.synchronizer_ = options.synchronizer;\n this.parent_ = parent;\n this.positionWGS84_ = undefined;\n this.observer_ = new MutationObserver(this.handleElementChanged.bind(this));\n this.attributeObserver_ = [];\n this.listenerKeys_ = [];\n\n // synchronize our Overlay with the parent Overlay\n const setPropertyFromEvent = (event: ObjectEvent) => this.setPropertyFromEvent_(event);\n this.listenerKeys_.push(this.parent_.on('change:element', setPropertyFromEvent));\n this.listenerKeys_.push(this.parent_.on('change:offset', setPropertyFromEvent));\n this.listenerKeys_.push(this.parent_.on('change:position', setPropertyFromEvent));\n this.listenerKeys_.push(this.parent_.on('change:positioning', setPropertyFromEvent));\n\n this.setProperties(this.parent_.getProperties());\n\n this.handleMapChanged();\n this.handleElementChanged();\n }\n\n /**\n * @param target\n */\n private observeTarget_(target: Node) {\n if (!this.observer_) {\n // not ready, skip the event (this occurs on construction)\n return;\n }\n this.observer_.disconnect();\n this.observer_.observe(target, {\n attributes: false,\n childList: true,\n characterData: true,\n subtree: true\n });\n this.attributeObserver_.forEach((observer) => {\n observer.disconnect();\n });\n this.attributeObserver_.length = 0;\n for (let i = 0; i < target.childNodes.length; i++) {\n const node = target.childNodes[i];\n if (node.nodeType === 1) {\n const observer = new MutationObserver(this.handleElementChanged.bind(this));\n observer.observe(node, {\n attributes: true,\n subtree: true\n });\n this.attributeObserver_.push(observer);\n }\n }\n }\n\n /**\n *\n * @param event\n */\n private setPropertyFromEvent_(event: ObjectEvent) {\n if (event.target && event.key) {\n this.set(event.key, event.target.get(event.key));\n }\n }\n\n /**\n * Get the scene associated with this overlay.\n * @see ol.Overlay.prototype.getMap\n * @return The scene that the overlay is part of.\n * @api\n */\n getScene(): Scene {\n return this.scene_;\n }\n\n /**\n * @override\n */\n handleMapChanged() {\n if (this.scenePostRenderListenerRemover_) {\n this.scenePostRenderListenerRemover_();\n removeNode(this.element);\n }\n this.scenePostRenderListenerRemover_ = null;\n const scene = this.getScene();\n if (scene) {\n this.scenePostRenderListenerRemover_ = scene.postRender.addEventListener(this.updatePixelPosition.bind(this));\n this.updatePixelPosition();\n const container = this.stopEvent ?\n this.synchronizer_.getOverlayContainerStopEvent() : this.synchronizer_.getOverlayContainer();\n if (this.insertFirst) {\n container.insertBefore(this.element, container.childNodes[0] || null);\n } else {\n container.appendChild(this.element);\n }\n }\n }\n\n /**\n * @override\n */\n handlePositionChanged() {\n // transform position to WGS84\n const position = this.getPosition();\n if (position) {\n const sourceProjection = this.parent_.getMap().getView().getProjection();\n this.positionWGS84_ = transform(position, sourceProjection, 'EPSG:4326');\n } else {\n this.positionWGS84_ = undefined;\n }\n this.updatePixelPosition();\n }\n\n /**\n * @override\n */\n handleElementChanged() {\n removeChildren(this.element);\n const element = this.getElement();\n if (element) {\n if (element.parentNode && element.parentNode.childNodes) {\n for (const node of Array.from(element.parentNode.childNodes)) {\n const clonedNode = cloneNode(node, null);\n this.element.appendChild(clonedNode);\n }\n }\n }\n if (element.parentNode) {\n // set new Observer\n this.observeTarget_(element.parentNode);\n }\n }\n\n /**\n * @override\n */\n updatePixelPosition() {\n const position = this.positionWGS84_;\n if (!this.scene_ || !position) {\n this.setVisible(false);\n return;\n }\n let height = 0;\n if (position.length === 2) {\n const globeHeight = this.scene_.globe.getHeight(Cesium.Cartographic.fromDegrees(position[0], position[1]));\n if (globeHeight && this.scene_.globe.tilesLoaded) {\n position[2] = globeHeight;\n }\n if (globeHeight) {\n height = globeHeight;\n }\n } else {\n height = position[2];\n }\n const cartesian = Cesium.Cartesian3.fromDegrees(position[0], position[1], height);\n const camera = this.scene_.camera;\n const ellipsoidBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(), 6356752);\n const occluder = new Cesium.Occluder(ellipsoidBoundingSphere, camera.position);\n // check if overlay position is behind the horizon\n if (!occluder.isPointVisible(cartesian)) {\n this.setVisible(false);\n return;\n }\n const cullingVolume = camera.frustum.computeCullingVolume(camera.position, camera.direction, camera.up);\n // check if overlay position is visible from the camera\n if (cullingVolume.computeVisibility(new Cesium.BoundingSphere(cartesian)) !== 1) {\n this.setVisible(false);\n return;\n }\n this.setVisible(true);\n\n const pixelCartesian = this.scene_.cartesianToCanvasCoordinates(cartesian);\n const pixel = [pixelCartesian.x, pixelCartesian.y];\n const mapSize = [this.scene_.canvas.width, this.scene_.canvas.height];\n this.updateRenderedPosition(pixel, mapSize);\n }\n\n /**\n * Destroys the overlay, removing all its listeners and elements\n * @api\n */\n destroy() {\n if (this.scenePostRenderListenerRemover_) {\n this.scenePostRenderListenerRemover_();\n }\n if (this.observer_) {\n this.observer_.disconnect();\n }\n olObservableUnByKey(this.listenerKeys_);\n this.listenerKeys_.splice(0);\n if ('removeNode' in this.element) {\n // @ts-ignore\n this.element.removeNode(true);\n } else {\n this.element.remove();\n }\n this.element = null;\n }\n}\n","import type {Collection, Map as OLMap, Overlay} from 'ol';\nimport SynchronizedOverlay from './SynchronizedOverlay';\nimport {getUid} from './util';\nimport type {Scene} from 'cesium';\nimport type {CollectionEvent} from 'ol/Collection.js';\n\nexport default class OverlaySynchronizer {\n private overlayCollection_: Collection;\n private overlayContainerStopEvent_: HTMLDivElement;\n private overlayContainer_: HTMLDivElement;\n private overlayMap_: Map = new Map();\n private overlayEvents = ['click', 'dblclick', 'mousedown', 'touchstart', 'pointerdown', 'mousewheel', 'wheel'];\n\n /**\n * @param map\n * @param scene\n * @constructor\n * @api\n */\n constructor(protected map: OLMap, protected scene: Scene) {\n this.map = map;\n this.overlayCollection_ = this.map.getOverlays();\n this.scene = scene;\n this.overlayContainerStopEvent_ = document.createElement('div');\n this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';\n this.overlayEvents.forEach((name) => {\n this.overlayContainerStopEvent_.addEventListener(name, evt => evt.stopPropagation());\n });\n this.scene.canvas.parentElement.appendChild(this.overlayContainerStopEvent_);\n\n this.overlayContainer_ = document.createElement('div');\n this.overlayContainer_.className = 'ol-overlaycontainer';\n this.scene.canvas.parentElement.appendChild(this.overlayContainer_);\n }\n\n /**\n * Get the element that serves as a container for overlays that don't allow\n * event propagation. Elements added to this container won't let mousedown and\n * touchstart events through to the map, so clicks and gestures on an overlay\n * don't trigger any {@link ol.MapBrowserEvent}.\n * @return The map's overlay container that stops events.\n */\n getOverlayContainerStopEvent(): Element {\n return this.overlayContainerStopEvent_;\n }\n\n /**\n * Get the element that serves as a container for overlays.\n * @return The map's overlay container.\n */\n getOverlayContainer(): Element {\n return this.overlayContainer_;\n }\n\n /**\n * Destroy all and perform complete synchronization of the overlays.\n * @api\n */\n synchronize() {\n this.destroyAll();\n this.overlayCollection_.forEach((overlay) => { this.addOverlay(overlay); });\n this.overlayCollection_.on('add', (evt: CollectionEvent) => this.addOverlay(evt.element));\n this.overlayCollection_.on('remove', (evt: CollectionEvent) => this.removeOverlay(evt.element));\n }\n\n\n /**\n * @api\n */\n addOverlay(overlay: Overlay) {\n if (!overlay) {\n return;\n }\n const cesiumOverlay = new SynchronizedOverlay({\n scene: this.scene,\n synchronizer: this,\n parent: overlay\n });\n\n this.overlayMap_.set(getUid(overlay), cesiumOverlay);\n }\n\n\n /**\n * Removes an overlay from the scene\n * @api\n */\n removeOverlay(overlay: Overlay) {\n const overlayId = getUid(overlay);\n const csOverlay = this.overlayMap_.get(overlayId);\n if (csOverlay) {\n csOverlay.destroy();\n this.overlayMap_.delete(overlayId);\n }\n }\n\n /**\n * Destroys all the created Cesium objects.\n */\n protected destroyAll() {\n this.overlayMap_.forEach((overlay: SynchronizedOverlay) => {\n overlay.destroy();\n });\n this.overlayMap_.clear();\n }\n}\n","import olGeomPoint from 'ol/geom/Point.js';\nimport {supportsImageRenderingPixelated, imageRenderingValue} from './util';\nimport {ol4326CoordinateToCesiumCartesian} from './core';\nimport {getTransform, type TransformFunction} from 'ol/proj.js';\nimport olcsAutoRenderLoop from './AutoRenderLoop';\nimport olcsCamera from './Camera';\nimport olcsRasterSynchronizer from './RasterSynchronizer';\nimport olcsVectorSynchronizer from './VectorSynchronizer';\nimport olcsOverlaySynchronizer from './OverlaySynchronizer';\nimport type Map from 'ol/Map.js';\nimport type Interaction from 'ol/interaction/Interaction.js';\nimport type {Group} from 'ol/layer.js';\nimport type Feature from 'ol/Feature.js';\nimport type View from 'ol/View.js';\nimport type {\n BoundingSphere, ContextOptions,\n DataSourceCollection,\n DataSourceDisplay,\n Entity,\n EntityView,\n Globe,\n JulianDate, MapMode2D, MapProjection, PerspectiveFrustum,\n Scene,\n ImageryLayer\n} from 'cesium';\nimport type AbstractSynchronizer from './AbstractSynchronizer';\nimport type VectorLayerCounterpart from './core/VectorLayerCounterpart';\n\n/**\n * Moved from Cesium\n * The state of a BoundingSphere computation being performed by a {@link Visualizer}.\n */\nconst BoundingSphereState: Record = {\n /**\n * The BoundingSphere has been computed.\n */\n DONE: 0,\n /**\n * The BoundingSphere is still being computed.\n */\n PENDING: 1,\n /**\n * The BoundingSphere does not exist.\n */\n FAILED: 2,\n};\n\ntype SceneOptions = {\n canvas: HTMLCanvasElement;\n contextOptions?: ContextOptions;\n creditContainer?: Element;\n creditViewport?: Element;\n mapProjection?: MapProjection;\n orderIndependentTranslucency?: boolean;\n scene3DOnly?: boolean;\n shadows?: boolean;\n mapMode2D?: MapMode2D;\n requestRenderMode?: boolean;\n maximumRenderTimeChange?: number;\n depthPlaneEllipsoidOffset?: number;\n msaaSamples?: number;\n}\n\ntype OLCesiumOptions = {\n map: Map,\n time?: () => JulianDate,\n target?: Element | string,\n createSynchronizers?: (map: Map, scene: Scene, dataSourceCollection: DataSourceCollection) => AbstractSynchronizer[],\n stopOpenLayersEventsPropagation?: boolean,\n sceneOptions?: SceneOptions\n}\n\n// FIXME: remove this when all the synchronizers are migrated to typescript.\ntype SynchronizerType = AbstractSynchronizer;\n\n/**\n * @typedef {Object} OLCesiumOptions\n * @property {import('ol/Map.js').default} map The OpenLayers map we want to show on a Cesium scene.\n * @property {Element|string} [target] Target element for the Cesium scene.\n * @property {function(!import('ol/Map.js').default, !Cesium.Scene, !Cesium.DataSourceCollection): Array}\n * [createSynchronizers] Callback function which will be called by the {@link olcs.OLCesium}\n * constructor to create custom synchronizers. Receives an `ol.Map` and a `Cesium.Scene` as arguments,\n * and needs to return an array of {@link import('olcs/AbstractSynchronizer.js').default}.\n * @property {function(): Cesium.JulianDate} [time] Control the current time used by Cesium.\n * @property {boolean} [stopOpenLayersEventsPropagation] Prevent propagation of mouse/touch events to\n * OpenLayers when Cesium is active.\n * @property {Cesium.SceneOptions} [sceneOptions] Allows the passing of property value to the\n * `Cesium.Scene`.\n */\nexport default class OLCesium {\n private autoRenderLoop_: olcsAutoRenderLoop | null = null;\n private map_: Map;\n private time_: () => JulianDate;\n private to4326Transform_: TransformFunction;\n private resolutionScale_ = 1.0;\n private canvasClientWidth_ = 0.0;\n private canvasClientHeight_ = 0.0;\n private resolutionScaleChanged_ = true; // force resize\n private container_: HTMLElement;\n private isOverMap_: boolean;\n private canvas_: HTMLCanvasElement;\n private enabled_ = false;\n private pausedInteractions_: Interaction[] = [];\n private hiddenRootGroup_: Group | null = null;\n private scene_: Scene;\n private camera_: olcsCamera;\n private globe_: Globe;\n private dataSourceCollection_: DataSourceCollection;\n private dataSourceDisplay_: DataSourceDisplay;\n /** Time of the last rendered frame, as returned by `performance.now()`. */\n private lastFrameTime_ = 0;\n /** The identifier returned by `requestAnimationFrame`. */\n private renderId_: number | undefined;\n /** Target frame rate for the render loop. */\n private targetFrameRate_ = Number.POSITIVE_INFINITY;\n /** If the Cesium render loop is being blocked. */\n private blockCesiumRendering_ = false;\n /** If the warmup routine is active. */\n private warmingUp_ = false;\n private trackedFeature_: Feature | null = null;\n private trackedEntity_: Entity | null = null;\n private entityView_: EntityView | null = null;\n private needTrackedEntityUpdate_ = false;\n private boundingSphereScratch_: BoundingSphere = new Cesium.BoundingSphere();\n private synchronizers_: SynchronizerType[];\n\n constructor(options: OLCesiumOptions) {\n this.map_ = options.map;\n\n this.time_ = options.time || function() {\n return Cesium.JulianDate.now();\n };\n\n /**\n * No change of the view projection.\n */\n this.to4326Transform_ = getTransform(this.map_.getView().getProjection(), 'EPSG:4326');\n\n const fillArea = 'position:absolute;top:0;left:0;width:100%;height:100%;touch-action:none;';\n this.container_ = document.createElement('DIV');\n const containerAttribute = document.createAttribute('style');\n containerAttribute.value = `${fillArea}visibility:hidden;`;\n this.container_.setAttributeNode(containerAttribute);\n\n let targetElement = options.target || this.map_.getViewport();\n if (typeof targetElement === 'string') {\n targetElement = document.getElementById(targetElement);\n }\n targetElement.appendChild(this.container_);\n\n /**\n * Whether the Cesium container is placed over the ol map.\n * a target => side by side mode\n * no target => over map mode\n */\n this.isOverMap_ = !options.target;\n\n\n if (this.isOverMap_ && options.stopOpenLayersEventsPropagation) {\n const overlayEvents = ['click', 'dblclick', 'mousedown', 'touchstart', 'pointerdown', 'mousewheel', 'wheel'];\n for (let i = 0, ii = overlayEvents.length; i < ii; ++i) {\n this.container_.addEventListener(overlayEvents[i], evt => evt.stopPropagation());\n }\n }\n\n this.canvas_ = document.createElement<'canvas'>('canvas');\n const canvasAttribute = document.createAttribute('style');\n canvasAttribute.value = fillArea;\n this.canvas_.setAttributeNode(canvasAttribute);\n\n if (supportsImageRenderingPixelated()) {\n // non standard CSS4\n this.canvas_.style['imageRendering'] = imageRenderingValue();\n }\n\n this.canvas_.oncontextmenu = function() {\n return false;\n };\n this.canvas_.onselectstart = function() {\n return false;\n };\n\n this.container_.appendChild(this.canvas_);\n\n const sceneOptions: SceneOptions = options.sceneOptions !== undefined ?\n {...options.sceneOptions, canvas: this.canvas_, scene3DOnly: true} :\n {canvas: this.canvas_, scene3DOnly: true};\n\n this.scene_ = new Cesium.Scene(sceneOptions);\n\n const sscc = this.scene_.screenSpaceCameraController;\n\n if (!Array.isArray(sscc.tiltEventTypes)) {\n console.log('sscc is not an array');\n } else {\n sscc.tiltEventTypes.push({\n 'eventType': Cesium.CameraEventType.LEFT_DRAG,\n 'modifier': Cesium.KeyboardEventModifier.SHIFT\n });\n\n sscc.tiltEventTypes.push({\n 'eventType': Cesium.CameraEventType.LEFT_DRAG,\n 'modifier': Cesium.KeyboardEventModifier.ALT\n });\n }\n\n sscc.enableLook = false;\n\n this.scene_.camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z;\n\n this.camera_ = new olcsCamera(this.scene_, this.map_);\n\n this.globe_ = new Cesium.Globe(Cesium.Ellipsoid.WGS84);\n this.globe_.baseColor = Cesium.Color.WHITE;\n this.scene_.globe = this.globe_;\n this.scene_.skyAtmosphere = new Cesium.SkyAtmosphere();\n\n // The first layer of Cesium is special; using a 1x1 transparent image to workaround it.\n // See https://github.com/AnalyticalGraphicsInc/cesium/issues/1323 for details.\n const firstImageryProvider = new Cesium.SingleTileImageryProvider({\n tileHeight: 1,\n tileWidth: 1,\n url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=',\n rectangle: Cesium.Rectangle.fromDegrees(0, 0, 1, 1) // the Rectangle dimensions are arbitrary\n });\n this.globe_.imageryLayers.addImageryProvider(firstImageryProvider, 0);\n\n this.dataSourceCollection_ = new Cesium.DataSourceCollection();\n this.dataSourceDisplay_ = new Cesium.DataSourceDisplay({\n scene: this.scene_,\n dataSourceCollection: this.dataSourceCollection_\n });\n\n this.synchronizers_ = options.createSynchronizers ?\n options.createSynchronizers(this.map_, this.scene_, this.dataSourceCollection_) : [\n new olcsRasterSynchronizer(this.map_, this.scene_),\n new olcsVectorSynchronizer(this.map_, this.scene_),\n new olcsOverlaySynchronizer(this.map_, this.scene_)\n ] as unknown as SynchronizerType[];\n\n // Assures correct canvas size after initialisation\n this.handleResize_();\n\n for (let i = this.synchronizers_.length - 1; i >= 0; --i) {\n this.synchronizers_[i].synchronize();\n }\n\n const eventHelper = new Cesium.EventHelper();\n eventHelper.add(this.scene_.postRender, OLCesium.prototype.updateTrackedEntity_, this);\n }\n\n /**\n * Destroys the Cesium resources held by this object.\n */\n destroy() {\n cancelAnimationFrame(this.renderId_);\n this.renderId_ = undefined;\n this.synchronizers_.forEach(synchronizer => synchronizer.destroyAll());\n this.camera_.destroy();\n this.scene_.destroy();\n // @ts-ignore TS2341\n this.scene_._postRender = null;\n this.container_.remove();\n }\n\n /**\n * Render the Cesium scene.\n */\n private render_() {\n // if a call to `requestAnimationFrame` is pending, cancel it\n if (this.renderId_ !== undefined) {\n cancelAnimationFrame(this.renderId_);\n this.renderId_ = undefined;\n }\n\n // only render if Cesium is enabled/warming and rendering hasn't been blocked\n if ((this.enabled_ || this.warmingUp_) && !this.blockCesiumRendering_) {\n this.renderId_ = requestAnimationFrame(this.onAnimationFrame_.bind(this));\n }\n }\n\n /**\n * Callback for `requestAnimationFrame`.\n * @param {number} frameTime The frame time, from `performance.now()`.\n */\n private onAnimationFrame_(frameTime: number) {\n this.renderId_ = undefined;\n\n // check if a frame was rendered within the target frame rate\n const interval = 1000.0 / this.targetFrameRate_;\n const delta = frameTime - this.lastFrameTime_;\n if (delta < interval) {\n // too soon, don't render yet\n this.render_();\n return;\n }\n\n // time to render a frame, save the time\n this.lastFrameTime_ = frameTime;\n\n const julianDate = this.time_();\n // initializeFrame private property\n // @ts-ignore TS2341\n this.scene_.initializeFrame();\n this.handleResize_();\n this.dataSourceDisplay_.update(julianDate);\n\n // Update tracked entity\n if (this.entityView_) {\n const trackedEntity = this.trackedEntity_;\n // getBoundingSphere private property\n // @ts-ignore TS2341\n const trackedState = this.dataSourceDisplay_.getBoundingSphere(trackedEntity, false, this.boundingSphereScratch_);\n if (trackedState === BoundingSphereState.DONE) {\n this.boundingSphereScratch_.radius = 1; // a radius of 1 is enough for tracking points\n this.entityView_.update(julianDate, this.boundingSphereScratch_);\n }\n }\n\n this.scene_.render(julianDate);\n this.camera_.checkCameraChange();\n\n // request the next render call after this one completes to ensure the browser doesn't get backed up\n this.render_();\n }\n\n private updateTrackedEntity_() {\n if (!this.needTrackedEntityUpdate_) {\n return;\n }\n\n const trackedEntity = this.trackedEntity_;\n const scene = this.scene_;\n\n // getBoundingSphere private property\n // @ts-ignore TS2341\n const state = this.dataSourceDisplay_.getBoundingSphere(trackedEntity, false, this.boundingSphereScratch_);\n if (state === BoundingSphereState.PENDING) {\n return;\n }\n\n scene.screenSpaceCameraController.enableTilt = false;\n\n const bs = state !== BoundingSphereState.FAILED ? this.boundingSphereScratch_ : undefined;\n if (bs) {\n bs.radius = 1;\n }\n this.entityView_ = new Cesium.EntityView(trackedEntity, scene, scene.mapProjection.ellipsoid);\n this.entityView_.update(this.time_(), bs);\n this.needTrackedEntityUpdate_ = false;\n }\n\n private handleResize_() {\n let width = this.canvas_.clientWidth;\n let height = this.canvas_.clientHeight;\n\n if (width === 0 || height === 0) {\n // The canvas DOM element is not ready yet.\n return;\n }\n\n if (width === this.canvasClientWidth_ &&\n height === this.canvasClientHeight_ &&\n !this.resolutionScaleChanged_) {\n return;\n }\n\n let resolutionScale = this.resolutionScale_;\n if (!supportsImageRenderingPixelated()) {\n resolutionScale *= window.devicePixelRatio || 1.0;\n }\n this.resolutionScaleChanged_ = false;\n\n this.canvasClientWidth_ = width;\n this.canvasClientHeight_ = height;\n\n width *= resolutionScale;\n height *= resolutionScale;\n\n this.canvas_.width = width;\n this.canvas_.height = height;\n ( this.scene_.camera.frustum).aspectRatio = width / height;\n }\n\n getCamera(): olcsCamera {\n return this.camera_;\n }\n\n getOlMap(): Map {\n return this.map_;\n }\n\n getOlView(): View {\n const view = this.map_.getView();\n console.assert(view);\n return view;\n }\n\n getCesiumScene(): Scene {\n return this.scene_;\n }\n\n getDataSources(): DataSourceCollection {\n return this.dataSourceCollection_;\n }\n\n getDataSourceDisplay(): DataSourceDisplay {\n return this.dataSourceDisplay_;\n }\n\n getEnabled(): boolean {\n return this.enabled_;\n }\n\n /**\n * Enables/disables the Cesium.\n * This modifies the visibility style of the container element.\n */\n setEnabled(enable: boolean) {\n if (this.enabled_ === enable) {\n return;\n }\n this.enabled_ = enable;\n\n // some Cesium operations are operating with canvas.clientWidth,\n // so we can't remove it from DOM or even make display:none;\n this.container_.style.visibility = this.enabled_ ? 'visible' : 'hidden';\n let interactions;\n if (this.enabled_) {\n this.throwOnUnitializedMap_();\n if (this.isOverMap_) {\n interactions = this.map_.getInteractions();\n interactions.forEach((el, i, arr) => {\n this.pausedInteractions_.push(el);\n });\n interactions.clear();\n\n this.map_.addInteraction = interaction => this.pausedInteractions_.push(interaction);\n this.map_.removeInteraction = (interaction) => {\n let interactionRemoved = false;\n this.pausedInteractions_ = this.pausedInteractions_.filter((i) => {\n const removed = i !== interaction;\n if (!interactionRemoved) {interactionRemoved = removed;}\n return removed;\n });\n return interactionRemoved ? interaction : undefined;\n };\n\n const rootGroup = this.map_.getLayerGroup();\n if (rootGroup.getVisible()) {\n this.hiddenRootGroup_ = rootGroup;\n this.hiddenRootGroup_.setVisible(false);\n }\n\n this.map_.getOverlayContainer().classList.add('olcs-hideoverlay');\n }\n\n this.camera_.readFromView();\n this.render_();\n } else {\n if (this.isOverMap_) {\n interactions = this.map_.getInteractions();\n this.pausedInteractions_.forEach((interaction) => {\n interactions.push(interaction);\n });\n this.pausedInteractions_.length = 0;\n\n this.map_.addInteraction = interaction => this.map_.getInteractions().push(interaction);\n this.map_.removeInteraction = interaction => this.map_.getInteractions().remove(interaction);\n\n this.map_.getOverlayContainer().classList.remove('olcs-hideoverlay');\n if (this.hiddenRootGroup_) {\n this.hiddenRootGroup_.setVisible(true);\n this.hiddenRootGroup_ = null;\n }\n }\n\n this.camera_.updateView();\n }\n }\n\n /**\n * Preload Cesium so that it is ready when transitioning from 2D to 3D.\n * @param {number} height Target height of the camera\n * @param {number} timeout Milliseconds after which the warming will stop\n */\n warmUp(height: number, timeout: number) {\n if (this.enabled_) {\n // already enabled\n return;\n }\n this.throwOnUnitializedMap_();\n this.camera_.readFromView();\n const ellipsoid = this.globe_.ellipsoid;\n const csCamera = this.scene_.camera;\n const position = ellipsoid.cartesianToCartographic(csCamera.position);\n if (position.height < height) {\n position.height = height;\n csCamera.position = ellipsoid.cartographicToCartesian(position);\n }\n\n this.warmingUp_ = true;\n this.render_();\n\n setTimeout(() => {\n this.warmingUp_ = false;\n }, timeout);\n }\n\n /**\n * Block Cesium rendering to save resources.\n * @param {boolean} block True to block.\n */\n setBlockCesiumRendering(block: boolean) {\n if (this.blockCesiumRendering_ !== block) {\n this.blockCesiumRendering_ = block;\n\n // reset the render loop\n this.render_();\n }\n }\n\n /**\n * Render the globe only when necessary in order to save resources.\n * Experimental.\n */\n enableAutoRenderLoop() {\n if (!this.autoRenderLoop_) {\n this.autoRenderLoop_ = new olcsAutoRenderLoop(this);\n }\n }\n\n /**\n * Get the autorender loop.\n */\n getAutoRenderLoop(): olcsAutoRenderLoop {\n return this.autoRenderLoop_;\n }\n\n /**\n * The 3D Cesium globe is rendered in a canvas with two different dimensions:\n * clientWidth and clientHeight which are the dimension on the screen and\n * width and height which are the dimensions of the drawing buffer.\n *\n * By using a resolution scale lower than 1.0, it is possible to render the\n * globe in a buffer smaller than the canvas client dimensions and improve\n * performance, at the cost of quality.\n *\n * Pixel ratio should also be taken into account; by default, a device with\n * pixel ratio of 2.0 will have a buffer surface 4 times bigger than the client\n * surface.\n */\n setResolutionScale(value: number) {\n value = Math.max(0, value);\n if (value !== this.resolutionScale_) {\n this.resolutionScale_ = Math.max(0, value);\n this.resolutionScaleChanged_ = true;\n if (this.autoRenderLoop_) {\n this.autoRenderLoop_.restartRenderLoop();\n }\n }\n }\n\n /**\n * Set the target frame rate for the renderer. Set to `Number.POSITIVE_INFINITY`\n * to render as quickly as possible.\n * @param {number} value The frame rate, in frames per second.\n */\n setTargetFrameRate(value: number) {\n if (this.targetFrameRate_ !== value) {\n this.targetFrameRate_ = value;\n\n // reset the render loop\n this.render_();\n }\n }\n\n /**\n * Check if OpenLayers map is not properly initialized.\n */\n private throwOnUnitializedMap_() {\n const map = this.map_;\n const view = map.getView();\n const center = view.getCenter();\n if (!view.isDef() || isNaN(center[0]) || isNaN(center[1])) {\n throw new Error(`The OpenLayers map is not properly initialized: ${center} / ${view.getResolution()}`);\n }\n }\n\n get trackedFeature(): Feature {\n return this.trackedFeature_;\n }\n\n set trackedFeature(feature: Feature) {\n if (this.trackedFeature_ !== feature) {\n\n const scene = this.scene_;\n\n //Stop tracking\n if (!feature || !feature.getGeometry()) {\n this.needTrackedEntityUpdate_ = false;\n scene.screenSpaceCameraController.enableTilt = true;\n\n if (this.trackedEntity_) {\n this.dataSourceDisplay_.defaultDataSource.entities.remove(this.trackedEntity_);\n }\n this.trackedEntity_ = null;\n this.trackedFeature_ = null;\n this.entityView_ = null;\n scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);\n return;\n }\n\n this.trackedFeature_ = feature;\n\n //We can't start tracking immediately, so we set a flag and start tracking\n //when the bounding sphere is ready (most likely next frame).\n this.needTrackedEntityUpdate_ = true;\n\n const to4326Transform = this.to4326Transform_;\n const toCesiumPosition = function() {\n const geometry = feature.getGeometry();\n console.assert(geometry instanceof olGeomPoint);\n const coo = geometry instanceof olGeomPoint ? geometry.getCoordinates() : [];\n const coo4326 = to4326Transform(coo, undefined, coo.length);\n return ol4326CoordinateToCesiumCartesian(coo4326);\n };\n\n // Create an invisible point entity for tracking.\n // It is independent of the primitive/geometry created by the vector synchronizer.\n const options: Entity.ConstructorOptions = {\n // @ts-ignore according to Cesium types, not possible to pass CallbackProperty\n position: new Cesium.CallbackProperty((time, result) => toCesiumPosition(), false),\n point: {\n pixelSize: 1,\n color: Cesium.Color.TRANSPARENT\n }\n };\n\n this.trackedEntity_ = this.dataSourceDisplay_.defaultDataSource.entities.add(options);\n }\n }\n}\n","export interface RectangleOutput {\n scaling: [number, number];\n offsetX: number;\n offsetY: number;\n width: number;\n height: number;\n}\n\nexport function computeRectangle(canvas: HTMLCanvasElement, tw: number, th: number): RectangleOutput {\n\n const maskAspectRatio = tw / th;\n let maskSize;\n\n if (maskAspectRatio > 1) {\n // landscape\n maskSize = [canvas.width, canvas.width / maskAspectRatio];\n if (maskSize[1] > canvas.height) {\n maskSize = [canvas.height * maskAspectRatio, canvas.height];\n }\n }\n else {\n // portrait\n maskSize = [canvas.height * maskAspectRatio, canvas.height];\n if (maskSize[0] > canvas.width) {\n maskSize = [canvas.width, canvas.width / maskAspectRatio];\n }\n }\n\n return {\n scaling: [maskSize[0] / canvas.width, maskSize[1] / canvas.height],\n width: maskSize[0],\n height: maskSize[1],\n offsetX: (canvas.width - maskSize[0]) / 2,\n offsetY: (canvas.height - maskSize[1]) / 2,\n };\n}\n","import type {Scene} from 'cesium';\n\nlet postUnlistener: Function = null;\n\ninterface ProgramInfo {\n program: WebGLProgram,\n attribLocations: {\n vertexPosition: number\n },\n uniformLocations: {\n uScaling: WebGLUniformLocation\n }\n}\n\n\n// CC0 from https://github.com/mdn/dom-examples/tree/main/webgl-examples/tutorial/sample2\n\n\nexport class MaskDrawer {\n private programInfo: ProgramInfo;\n private positionBuffer: WebGLBuffer;\n\n constructor(private gl: WebGL2RenderingContext | WebGLRenderingContext) {\n const shaderProgram = this.initShaderProgram();\n\n this.programInfo = {\n program: shaderProgram,\n attribLocations: {\n vertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition')\n },\n uniformLocations: {\n uScaling: gl.getUniformLocation(\n shaderProgram,\n 'uScaling'\n )\n }\n };\n\n this.positionBuffer = gl.createBuffer();\n const positions = [1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0];\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n }\n\n getVertexShaderSource() {\n return `\n attribute vec4 aVertexPosition;\n uniform vec2 uScaling;\n void main() {\n gl_Position = vec4(aVertexPosition[0] * uScaling[0], aVertexPosition[1] * uScaling[1], -1.0, 1.0);\n }\n `;\n }\n\n getFragmentShaderSource() {\n return `\n precision highp float;\n void main() {\n gl_FragColor = vec4(.5, .5, .5, .6);\n }\n `;\n }\n\n /**\n *\n */\n private initShaderProgram(): WebGLProgram {\n const gl = this.gl;\n const vsSource = this.getVertexShaderSource();\n const fsSource = this.getFragmentShaderSource();\n const vertexShader = MaskDrawer.loadShader(gl, gl.VERTEX_SHADER, vsSource),\n fragmentShader = MaskDrawer.loadShader(gl, gl.FRAGMENT_SHADER, fsSource),\n shaderProgram = gl.createProgram();\n\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // If creating the shader program failed, alert\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n throw new Error(\n `Unable to initialize the shader program: ${gl.getProgramInfoLog(\n shaderProgram\n )}`\n );\n }\n\n return shaderProgram;\n }\n\n\n /**\n *\n * @param {number[]} scaling scaling\n */\n drawMask(scaling: number[]) {\n const gl = this.gl;\n const programInfo = this.programInfo;\n // Blend\n gl.enable(gl.BLEND);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.positionBuffer);\n gl.vertexAttribPointer(\n programInfo.attribLocations.vertexPosition,\n 2,\n gl.FLOAT,\n false,\n 0,\n 0\n );\n gl.enableVertexAttribArray(programInfo.attribLocations.vertexPosition);\n gl.useProgram(programInfo.program);\n\n\n // Draw a first time to fill the stencil area while keeping the destination color\n gl.enable(gl.STENCIL_TEST);\n gl.stencilFunc(\n gl.ALWAYS,\n 1,\n 0xFF\n );\n gl.stencilOp(\n gl.KEEP,\n gl.KEEP,\n gl.REPLACE\n );\n gl.uniform2fv(\n programInfo.uniformLocations.uScaling,\n scaling\n );\n gl.blendFunc(gl.ZERO, gl.ONE);\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n\n // Now draw again the whole viewport and darken the pixels that are not on the stencil\n gl.stencilFunc(\n gl.EQUAL,\n 0,\n 0xFF\n );\n gl.stencilOp(\n gl.KEEP,\n gl.KEEP,\n gl.KEEP\n );\n gl.uniform2fv(\n programInfo.uniformLocations.uScaling,\n [1, 1]\n );\n gl.blendFunc(gl.ZERO, gl.SRC_ALPHA);\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n }\n\n\n\n /**\n */\n private static loadShader(gl: WebGL2RenderingContext | WebGLRenderingContext, type: number, source: string): WebGLShader {\n const shader = gl.createShader(type);\n\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n throw new Error(\n `An error occurred compiling the shaders: ${gl.getShaderInfoLog(shader)}`\n );\n // gl.deleteShader(shader);\n }\n\n return shader;\n }\n}\n\n/**\n *\n */\nexport function autoDrawMask(scene: Scene, getScalings: () => number[]) {\n const canvas = scene.canvas;\n const ctx = canvas.getContext('webgl2') || canvas.getContext('webgl');\n\n if (getScalings) {\n if (!postUnlistener) {\n const drawer = new MaskDrawer(ctx);\n postUnlistener = scene.postRender.addEventListener(() => {\n drawer.drawMask(getScalings());\n });\n }\n }\n else if (postUnlistener) {\n postUnlistener();\n // FIXME: destroy program\n postUnlistener = null;\n }\n scene.requestRender();\n}\n","import type {Scene} from 'cesium';\n\ninterface ScreenshotOptions {\n offsetX: number;\n offsetY: number;\n width: number;\n height: number;\n}\n\n/**\n */\nexport function takeScreenshot(scene: Scene, options: ScreenshotOptions): Promise {\n return new Promise((resolve, reject) => {\n // preserveDrawingBuffers is false so we render on demand and immediately read the buffer\n const remover = scene.postRender.addEventListener(() => {\n remover();\n try {\n let url;\n\n if (options) {\n const smallerCanvas = document.createElement('canvas');\n\n smallerCanvas.width = options.width;\n smallerCanvas.height = options.height;\n smallerCanvas.getContext('2d').drawImage(\n scene.canvas,\n options.offsetX, options.offsetY, options.width, options.height,\n 0, 0, options.width, options.height);\n url = smallerCanvas.toDataURL();\n }\n else {\n url = scene.canvas.toDataURL();\n }\n resolve(url);\n }\n catch (e) {\n reject(e);\n }\n });\n\n scene.requestRender();\n });\n}\n","export default class LazyLoader {\n private promise: Promise | undefined;\n private url_: string;\n\n /**\n * @param url\n * @api\n */\n constructor(url: string) {\n this.url_ = url;\n }\n\n /**\n * Load Cesium by injecting a script tag.\n * @api\n */\n load(): Promise {\n if (!this.promise) {\n // not yet loading\n this.promise = new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.onload = () => resolve();\n script.onerror = () => reject();\n document.head.appendChild(script);\n script.src = this.url_;\n });\n }\n return this.promise;\n }\n}\n","import olcsContribLazyLoader from './LazyLoader';\nimport OLCesium from '../OLCesium';\nimport {resetToNorthZenith, rotateAroundBottomCenter, computeSignedTiltAngleOnGlobe, pickBottomPoint, setHeadingUsingBottomCenter, limitCameraToBoundingSphere} from '../core';\nimport {toRadians} from '../math';\nimport Observable from 'ol/Observable.js';\nimport type OLMap from 'ol/Map.js';\nimport type {Extent} from 'ol/extent.js';\nimport type {BoundingSphere, Matrix4, Rectangle, Scene} from 'cesium';\n\n\n/**\n * @typedef {Object} ManagerOptions\n * @property {import('ol/Map.js').default} map\n * @property {import('ol/extent.js').Extent} [cameraExtentInRadians]\n * @property {string} [cesiumIonDefaultAccessToken]\n */\n\n\nexport default class Manager extends Observable {\n private cesiumUrl_: string;\n private boundingSphere_: BoundingSphere;\n private promise_: Promise;\n private cesiumIonDefaultAccessToken_: string;\n protected map: OLMap;\n protected cameraExtentInRadians: Extent;\n protected ol3d: OLCesium;\n private cesiumInitialTilt_ = toRadians(50);\n\n protected fogDensity = 0.0001;\n\n protected fogSSEFactor = 25;\n\n protected minimumZoomDistance = 2;\n\n /**\n * Limit the maximum distance to the earth to 10'000km.\n */\n protected maximumZoomDistance: number = 10000000;\n\n // when closer to 3000m, restrict the available positions harder\n protected limitCameraToBoundingSphereRatio = (height: number) => (height > 3000 ? 9 : 3);\n\n /**\n * @param {string} cesiumUrl\n * @param {olcsx.contrib.ManagerOptions} options\n * @api\n */\n constructor(cesiumUrl: string, {map, cameraExtentInRadians, cesiumIonDefaultAccessToken}: {map: OLMap, cameraExtentInRadians?: Extent, cesiumIonDefaultAccessToken?: string}) {\n super();\n this.cesiumUrl_ = cesiumUrl;\n console.assert(map);\n this.map = map;\n this.cameraExtentInRadians = cameraExtentInRadians || null;\n this.cesiumIonDefaultAccessToken_ = cesiumIonDefaultAccessToken;\n }\n\n\n /**\n * Lazy load Cesium.\n */\n load(): Promise {\n if (!this.promise_) {\n const cesiumLazyLoader = new olcsContribLazyLoader(this.cesiumUrl_);\n this.promise_ = cesiumLazyLoader.load().then(() => this.onCesiumLoaded());\n }\n return this.promise_;\n }\n\n\n /**\n * Hook called when Cesium has been lazy loaded.\n */\n protected onCesiumLoaded(): OLCesium {\n if (this.cameraExtentInRadians) {\n const rect = new Cesium.Rectangle(...this.cameraExtentInRadians);\n // Set the fly home rectangle\n Cesium.Camera.DEFAULT_VIEW_RECTANGLE = rect;\n this.boundingSphere_ = Cesium.BoundingSphere.fromRectangle3D(rect, Cesium.Ellipsoid.WGS84, 300); // lux mean height is 300m\n }\n\n if (this.cesiumIonDefaultAccessToken_) {\n Cesium.Ion.defaultAccessToken = this.cesiumIonDefaultAccessToken_;\n }\n\n this.ol3d = this.instantiateOLCesium();\n const scene = this.ol3d.getCesiumScene();\n this.configureForUsability(scene);\n this.configureForPerformance(scene);\n this.dispatchEvent('load');\n return this.ol3d;\n }\n\n\n /**\n * Application code should override this method.\n */\n instantiateOLCesium(): OLCesium {\n const ol3d = new OLCesium({map: this.map});\n const scene = ol3d.getCesiumScene();\n // LEGACY\n if ('createWorldTerrain' in Cesium) {\n // @ts-ignore\n const terrainProvider = Cesium.createWorldTerrain();\n scene.terrainProvider = terrainProvider;\n } else {\n // v107+\n Cesium.createWorldTerrainAsync().then(tp => scene.terrainProvider = tp);\n }\n\n return ol3d;\n }\n\n\n /**\n * Override with custom performance optimization logics, if needed.\n */\n protected configureForPerformance(scene: Scene) {\n const fog = scene.fog;\n fog.enabled = true;\n fog.density = this.fogDensity;\n fog.screenSpaceErrorFactor = this.fogSSEFactor;\n }\n\n\n /**\n * Override with custom usabliity logics, id needed.\n */\n configureForUsability(scene: Scene) {\n const sscController = scene.screenSpaceCameraController;\n sscController.minimumZoomDistance = this.minimumZoomDistance;\n sscController.maximumZoomDistance = this.maximumZoomDistance;\n\n // Do not see through the terrain. Seeing through the terrain does not make\n // sense anyway, except for debugging\n scene.globe.depthTestAgainstTerrain = true;\n\n // Use white instead of the black default colour for the globe when tiles are missing\n scene.globe.baseColor = Cesium.Color.WHITE;\n scene.backgroundColor = Cesium.Color.WHITE;\n\n if (this.boundingSphere_) {\n scene.postRender.addEventListener(this.limitCameraToBoundingSphere.bind(this));\n }\n // Stop rendering Cesium when there is nothing to do. This drastically reduces CPU/GPU consumption.\n this.ol3d.enableAutoRenderLoop();\n }\n\n /**\n * Constrain the camera so that it stays close to the bounding sphere of the map extent.\n * Near the ground the allowed distance is shorter.\n */\n protected limitCameraToBoundingSphere() {\n const scene = this.ol3d.getCesiumScene();\n limitCameraToBoundingSphere(scene.camera, this.boundingSphere_, this.limitCameraToBoundingSphereRatio);\n }\n\n /**\n * Enable or disable ol3d with a default animation.\n */\n toggle3d(): Promise {\n return this.load().then((/** @const {!olcs.OLCesium} */ ol3d) => {\n const is3DCurrentlyEnabled = ol3d.getEnabled();\n const scene = ol3d.getCesiumScene();\n if (is3DCurrentlyEnabled) {\n // Disable 3D\n console.assert(this.map);\n return resetToNorthZenith(this.map, scene).then(() => {\n ol3d.setEnabled(false);\n this.dispatchEvent('toggle');\n });\n } else {\n // Enable 3D\n ol3d.setEnabled(true);\n this.dispatchEvent('toggle');\n return rotateAroundBottomCenter(scene, this.cesiumInitialTilt_);\n }\n });\n }\n\n\n /**\n * Enable ol3d with a view built from parameters.\n */\n set3dWithView(lon: number, lat: number, elevation: number, headingDeg: number, pitchDeg: number): Promise {\n return this.load().then((ol3d) => {\n const is3DCurrentlyEnabled = ol3d.getEnabled();\n const scene = ol3d.getCesiumScene();\n const camera = scene.camera;\n const destination = Cesium.Cartesian3.fromDegrees(lon, lat, elevation);\n const heading = Cesium.Math.toRadians(headingDeg);\n const pitch = Cesium.Math.toRadians(pitchDeg);\n const roll = 0;\n const orientation = {heading, pitch, roll};\n\n if (!is3DCurrentlyEnabled) {\n ol3d.setEnabled(true);\n this.dispatchEvent('toggle');\n }\n\n camera.setView({\n destination,\n orientation\n });\n });\n }\n\n\n /**\n * Whether OL-Cesium has been loaded and 3D mode is enabled.\n */\n is3dEnabled(): boolean {\n return !!this.ol3d && this.ol3d.getEnabled();\n }\n\n\n /**\n * @return {number}\n */\n getHeading(): number {\n return this.map ? this.map.getView().getRotation() || 0 : 0;\n }\n\n\n /**\n * @return {number|undefined}\n */\n getTiltOnGlobe() {\n const scene = this.ol3d.getCesiumScene();\n const tiltOnGlobe = computeSignedTiltAngleOnGlobe(scene);\n return -tiltOnGlobe;\n }\n\n\n /**\n * Set heading.\n * This assumes ol3d has been loaded.\n */\n setHeading(angle: number) {\n const scene = this.ol3d.getCesiumScene();\n const bottom = pickBottomPoint(scene);\n if (bottom) {\n setHeadingUsingBottomCenter(scene, angle, bottom);\n }\n }\n\n getOl3d(): OLCesium {\n return this.ol3d;\n }\n\n getCesiumViewMatrix(): Matrix4 {\n return this.ol3d.getCesiumScene().camera.viewMatrix;\n }\n\n getCesiumScene(): Scene {\n return this.ol3d.getCesiumScene();\n }\n\n /**\n * Fly to some rectangle.\n * This assumes ol3d has been loaded.\n */\n flyToRectangle(rectangle: Rectangle, offset = 0): Promise {\n const camera = this.getCesiumScene().camera;\n const destination = camera.getRectangleCameraCoordinates(rectangle);\n\n const mag = Cesium.Cartesian3.magnitude(destination) + offset;\n Cesium.Cartesian3.normalize(destination, destination);\n Cesium.Cartesian3.multiplyByScalar(destination, mag, destination);\n\n return new Promise((resolve, reject) => {\n if (!this.cameraExtentInRadians) {\n reject();\n return;\n }\n\n camera.flyTo({\n destination,\n complete: () => resolve(),\n cancel: () => reject(),\n endTransform: Cesium.Matrix4.IDENTITY\n });\n });\n }\n}\n","import OLCesium from './olcs/OLCesium';\nexport default OLCesium;\n\nexport {default as AbstractSynchronizer} from './olcs/AbstractSynchronizer';\nexport {default as RasterSynchronizer} from './olcs/RasterSynchronizer';\nexport {default as VectorSynchronizer} from './olcs/VectorSynchronizer';\n\nexport {default as FeatureConverter} from './olcs/FeatureConverter';\nexport {default as OLCSCamera} from './olcs/Camera';\n\n// Core api functions\nexport * from './olcs/core';\nexport {default as OLImageryProvider} from './olcs/core/OLImageryProvider';\nexport {default as VectorLayerCounterpart} from './olcs/core/VectorLayerCounterpart';\n\n// Print functions\nexport * from './olcs/print';\n\n// Contrib Manager\nexport {default as ContribManager} from './olcs/contrib/Manager';\nexport {default as ContribLazyLoader} from './olcs/contrib/LazyLoader';\n\n// Deprecated export of olcs on window\nconst olcs = window['olcs'] = {};\nolcs.OLCesium = OLCesium;\n\nimport {default as AbstractSynchronizer} from './olcs/AbstractSynchronizer';\nimport {default as RasterSynchronizer} from './olcs/RasterSynchronizer';\nimport {default as VectorSynchronizer} from './olcs/VectorSynchronizer';\nolcs.AbstractSynchronizer = AbstractSynchronizer;\nolcs.RasterSynchronizer = RasterSynchronizer;\nolcs.VectorSynchronizer = VectorSynchronizer;\n\nimport * as core from './olcs/core';\nimport {default as OLImageryProvider} from './olcs/core/OLImageryProvider';\nimport {default as VectorLayerCounterpart} from './olcs/core/VectorLayerCounterpart';\nolcs.core = core;\nolcs.core.OLImageryProvider = OLImageryProvider;\nolcs.core.VectorLayerCounterpart = VectorLayerCounterpart;\n\nolcs.contrib = {};\nimport {default as ContribManager} from './olcs/contrib/Manager';\nimport {default as ContribLazyLoader} from './olcs/contrib/LazyLoader';\nolcs.contrib.LazyLoader = ContribLazyLoader;\nolcs.contrib.Manager = ContribManager;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","ol","geom","Point","_imageRenderingPixelatedSupported","_imageRenderingValue","supportsImageRenderingPixelated","undefined","canvas","document","createElement","setAttribute","imageRenderingValue","style","imageRendering","getSourceProjection","source","getProjection","uidCounter_","getUid","olcs_uid","waitReady","object","p","readyPromise","ready","Promise","resolve","_","stopper","setInterval","clearInterval","reject","easing","layer","Tile","Image","proj","ImageStatic","ImageWMS","TileImage","TileWMS","VectorTile","createEmptyCanvas","width","height","olUseNewCoordinates","tileCoord","TileSource","projection","wrapX","getTileCoordForTileUrlFunction","OLImageryProvider","this","ready_","rectangle","rectangle_","tilingScheme","tilingScheme_","_ready","tileWidth","tileGrid","source_","getTileGrid","tileSizeAtZoom0","getTileSize","Array","isArray","tileHeight","maximumLevel","getMaxZoom","minimumLevel","tileDiscardPolicy","hasAlphaChannel","pickFeatures","x","y","level","longitude","latitude","constructor","olMap","opt_fallbackProj","emptyCanvas_","emptyCanvasPromise_","errorEvent","Cesium","Event","projection_","fallbackProj_","WebMercatorTilingScheme","map_","shouldRequestNextLevel","proxy","DefaultProxy","on","e","handleSourceChanged_","getState","options","numberOfLevelZeroTilesX","numberOfLevelZeroTilesY","forEachTileCoord","getExtent","_ref","zoom","xIndex","yIndex","getCode","GeographicTilingScheme","getTileCredits","attributionsFunction","getAttributions","extent","getView","calculateExtent","getSize","center","getCenter","attributionsFunctionToCredits","requestImage","request","tileUrlFunction","getTileUrlFunction","z_","y_","url","getURL","ImageryProvider","loadImage","format","MVT","Style","Stroke","render","util","structs","LRUCache","tilegrid","tileurlfunction","Feature","featureClass","RenderFeature","styles","stroke","color","MVTImageryProvider","minimumLevel_","urls","credit","styleFunction_","styleFunction","tileRectangle_","Rectangle","cacheSize","tileCache","featureCache","getTilegridForProjection","tileFunction_","createTileUrlFunctions","getTileFeatures","z","cacheKey","getCacheKey_","promise","containsKey","getUrl_","fetch","then","r","ok","arrayBuffer","buffer","readFeaturesFromBuffer","set","getCount","highWaterMark","canExpireCache","pop","OL_VERSION","dataProjection","featureProjection","features","readFeatures","scaleFactor","forEach","f","flatCoordinates","getFlatCoordinates","flip","i","length","tileXYToNativeRectangle","resolution","east","west","rasterizeFeatures","raiseEvent","vectorContext","toContext","getContext","size","setStyle","drawGeometry","computePixelSizeAtCoordinate","scene","target","camera","frustum","distance","Cartesian3","magnitude","subtract","position","getPixelDimensions","clientWidth","clientHeight","pixelRatio","Cartesian2","computeBoundingBoxAtTarget","amount","pixelSize","transform","Transforms","eastNorthUpToFixedFrame","bottomLeft","Matrix4","multiplyByPoint","topRight","Ellipsoid","WGS84","cartesianArrayToCartographicArray","applyHeightOffsetToGeometry","geometry","applyTransform","input","output","stride","createMatrixAtCoordinates","coordinates","rotation","translation","scale","ZERO","ol4326CoordinateToCesiumCartesian","rawMatrix","quaternion","Quaternion","fromAxisAngle","UNIT_Z","rotationMatrix","fromTranslationQuaternionRotationScale","multiply","rotateAroundAxis","angle","axis","opt_options","clamp","Math","defaultValue","duration","linearEasing","callback","lastProgress","oldTransform","start","Date","now","step","timestamp","progress","clone","stepAngle","lookAtTransform","rotate","window","requestAnimationFrame","setHeadingUsingBottomCenter","heading","bottomCenter","angleToZenith","computeAngleToZenith","right","Matrix3","fromQuaternion","vector","zenith","multiplyByVector","add","fromTranslation","pickOnTerrainOrEllipsoid","pixel","ray","getPickRay","globe","pick","pickEllipsoid","pickBottomPoint","pickCenterPoint","computeSignedTiltAngleOnGlobe","Ray","direction","ellipsoid","IntersectionTests","rayEllipsoid","getPoint","normal","geocentricSurfaceNormal","signedAngleBetween","PI","convertLongitudeRange","bottomFovRay","fovy2","fovy","matrix","first","second","b","c","normalize","cross","cosine","dot","sine","sign","atan2","pivot","fy","negate","left","extentToRectangle","ext","transformExtent","fromDegrees","sourceToImageryProvider","viewProj","olLayer","skip","provider","olSourceImageWMS","getUrl","getImageLoadFunction","defaultImageLoadFunction","sourceProps","olSourceTileWMS","attributions","params","getParams","setProperties","olSourceTileImage","isCesiumProjection","olcsCoreOLImageryProvider","olSourceImageStatic","olSourceVectorTile","VectorTileLayer","fromCode","split","map","u","replace","getStyleFunction","getExtentCenter","getImageExtent","SingleTileImageryProvider","tileLayerToImageryLayer","olLayerTile","olLayerImage","getSource","layerOptions","ImageryLayer","updateCesiumLayerProperties","olLayerWithParents","csLayer","opacity","visible","concat","parents","layerOpacity","getOpacity","layerVisible","getVisible","alpha","show","coordinate","coo","ol4326CoordinateArrayToCsCartesians","toCartesian","cartesians","push","olGeometryCloneTo4326","proj4326","properties","getProperties","convertColorToCesium","olColor","Color","byteToFloat","fromCssColorString","CanvasPattern","CanvasGradient","ctx","fillStyle","fillRect","ImageMaterialProperty","image","convertUrlToCesium","subdomains","re","match","exec","startCharCode","charCodeAt","stopCharCode","charCode","String","fromCharCode","resetToNorthZenith","currentHeading","getRotation","normalizeView","rotateAroundBottomCenter","view","getResolution","setRotation","constrainResolution","setResolution","getConstrainedResolution","is3857","is4326","viewState","html","Credit","calcDistanceForResolution","metersPerUnit","getMetersPerUnit","cos","abs","tan","calcResolutionForDistance","limitCameraToBoundingSphere","boundingSphere","ratio","blockLimiter","carto","Cartographic","fromCartesian","radius","flying","unblockLimiter","flyToBoundingSphere","complete","cancel","AutoRenderLoop","ol3d","repaintEventNames_","scene_","getCesiumScene","canvas_","_boundNotifyRepaintRequired","notifyRepaintRequired","bind","enable","requestRenderMode","maximumRenderTimeChange","repaintKey","addEventListener","getOlMap","getLayerGroup","disable","removeEventListener","un","restartRenderLoop","requestRender","Observable","toDegrees","angleInRadians","toRadians","angleInDegrees","identityProjection","opt_output","opt_dimension","dim","Camera","viewListenKey_","toLonLat_","fromLonLat_","tilt_","distance_","lastCameraViewMatrix_","viewUpdateInProgress_","cam_","setView_","destroy","olObservableUnByKey","view_","toLonLat","getTransform","fromLonLat","handleViewChangedEvent_","readFromView","setHeading","getHeading","setTilt","tilt","updateCamera_","getTilt","setDistance","updateView","getDistance","setCenter","setPosition","ll","getAltitude","setView","destination","cartographicToCartesian","getPosition","cartesianToCartographic","setAltitude","altitude","getHeight","orientation","pitch","PI_OVER_TWO","roll","moveBackward","checkCameraChange","bestTarget","positionCartographic","bestTargetCartographic","pos","targetNormal","targetToCamera","up","angleBetween","tiltAngle","acos","isNaN","opt_dontSync","old","current","viewMatrix","equalsEpsilon","Group","AbstractSynchronizer","layerMap","olLayerListenKeys","olGroupListenKeys_","olLayers","getLayers","mapLayerGroup","synchronize","destroyAll","addLayers_","orderLayers","root","fifo","splice","olLayerId","toString","cesiumObjects","LayerGroup","listenForGroupChanges_","createSingleLayerCounterparts","l","newOlLayerWithParents","layerId","layerWithParents","onLayerChange","cesiumObjs","addCesiumObjects_","cesiumObject","addCesiumObject","removeAndDestroySingleLayer_","uid","counterparts","counterpart","removeSingleCesiumObject","destroyCesiumObject","unlistenSingleGroup_","group","removeLayer_","done","uuid","listenKeyArray","contentKeys","listenAddRemove","collection","event","element","el","indexOf","objKey","removeAllCesiumObjects","BaseVector","RasterSynchronizer","olcsAbstractSynchronizer","super","cesiumLayers_","imageryLayers","ourLayers_","ImageryLayerCollection","remove","removeAll","convertLayerToCesiumImageries","result","olLayerItem","BaseVectorLayer","previousStyleFunction","currentStyleFunction","csObj","_imageryCache","ip","imageryProvider","_ip$tileCache","clear","layers","zIndices","queue","getZIndex","sublayers","unshift","getArray","sort","layer1","layer2","raiseToTop","Vector","Layer","Cluster","Icon","Polygon","SimpleGeometry","VectorLayerCounterpart","layerProjection","olListenKeys","billboards","BillboardCollection","primitives","PrimitiveCollection","rootCollection_","context","featureToCesiumMap","getRootPrimitive","FeatureConverter","boundOnRemoveOrClearFeatureListener_","onRemoveOrClearFeature_","defaultBillboardEyeOffset_","evt","cancellers","feature","id","canceller","setReferenceForPicking","primitive","olFeature","createColoredPrimitive","olGeometry","opt_lineWidth","flat","renderState","depthTest","enabled","lineWidth","instances","instance","GeometryInstance","attributes","ColorGeometryInstanceAttribute","fromColor","createInstance","getHeightReference","HeightReference","CLAMP_TO_GROUND","GroundPrimitive","geometryInstances","Primitive","dataUri","getValue","toDataURL","appearance","MaterialAppearance","material","Material","fabric","type","uniforms","translucent","shadows","extractColorFromOlStyle","outline","fillColor","getFill","getColor","strokeColor","getStroke","extractLineWidthFromOlStyle","getWidth","wrapFillAndOutlineGeometries","fillGeometry","outlineGeometry","olStyle","outlineColor","p1","p2","addTextStyle","getText","text","label","olGeometry4326TextPartToCesium","csAddBillboard","bbOptions","eyeOffset","bb","olCircleGeometryToCesium","olCenter","olPoint","slice","getRadius","point","CircleGeometry","outlinePrimitive","positions","olCreateCircularPolygon","getLinearRing","getCoordinates","op","GroundPolylinePrimitive","GroundPolylineGeometry","PolylineMaterialAppearance","olStyleToCesium","classificationType","ClassificationType","TERRAIN","_primitive","CircleOutlineGeometry","extrudedHeight","olLineStringGeometryToCesium","heightReference","PolylineGeometry","vertexFormat","olPolygonGeometryToCesium","boundingExtent","maxHeight","max","featureExtrudedHeight","RectangleGeometry","RectangleOutlineGeometry","rings","getLinearRings","hierarchy","holes","polygonHierarchy","PolygonGeometry","perPositionHeight","linePositions","polylineGeometry","PolygonOutlineGeometry","altitudeMode","NONE","RELATIVE_TO_GROUND","createBillboardFromImage","imageStyle","opt_newBillboardCallback","OLStyleIcon","load","getImage","reallyCreateBillboard","HTMLCanvasElement","HTMLImageElement","getScale","assign","anchor","getAnchor","xScale","yScale","pixelOffset","src","naturalHeight","naturalWidth","isImageLoaded","cancelled","fuid","listener","isDestroyed","olPointGeometryToCesium","modelPrimitive","olcsModelFunction","olcsModel","cesiumOptions","Model","model","fromGltf","fromGltfAsync","debugModelMatrix","DebugModelMatrixPrimitive","modelMatrix","olMultiGeometryToCesium","getType","points","getPoints","lineStrings","getLineStrings","polygons","getPolygons","labels","LabelCollection","extentCenter","olGeomSimpleGeometry","getFirstCoordinate","offsetX","getOffsetX","offsetY","getOffsetY","offset","labelStyle","horizontalOrigin","font","getFont","LabelStyle","FILL","outlineWidth","OUTLINE","FILL_AND_OUTLINE","getTextAlign","HorizontalOrigin","LEFT","RIGHT","CENTER","getTextBaseline","verticalOrigin","VerticalOrigin","TOP","BOTTOM","fill","getLineDash","fromType","horizontal","repeat","evenColor","oddColor","computePlainStyle","fallbackStyleFunction","featureStyleFunction","getGeometryFromFeature","opt_geom","geom3d","OLGeometry","geomFuncRes","getGeometryFunction","getGeometry","olFeatureToCesium","newBillboardAddedCallback","featureBb","getGeometriesArray","prims","bbs","Error","olVectorLayerToCesium","olView","featurePrimitiveMap","OLClusterSource","getFeatures","layerStyle","prim","convert","VectorSynchronizer","opt_converter","converter","olcsFeatureConverter","csAllPrimitives_","destroyPrimitives","updateLayerVisibility","csPrimitive","olLayerVector","olLayerVectorTile","olSourceCluster","csPrimitives","onAddFeature","onRemoveFeature","Billboard","Overlay","cloneNode","node","parent","nodeName","drawImage","appendChild","nodeType","Node","TEXT_NODE","dispatchEvent","MouseEvent","stopPropagation","nodes","childNodes","SynchronizedOverlay","OLOverlay","getOptions","scenePostRenderListenerRemover_","attributeObserver_","synchronizer_","synchronizer","parent_","positionWGS84_","observer_","MutationObserver","handleElementChanged","listenerKeys_","setPropertyFromEvent","setPropertyFromEvent_","handleMapChanged","observeTarget_","disconnect","observe","childList","characterData","subtree","observer","getScene","parentNode","removeChild","postRender","updatePixelPosition","container","stopEvent","getOverlayContainerStopEvent","getOverlayContainer","insertFirst","insertBefore","handlePositionChanged","sourceProjection","getMap","lastChild","removeChildren","getElement","from","clonedNode","setVisible","globeHeight","tilesLoaded","cartesian","ellipsoidBoundingSphere","BoundingSphere","Occluder","isPointVisible","computeCullingVolume","computeVisibility","pixelCartesian","cartesianToCanvasCoordinates","mapSize","updateRenderedPosition","removeNode","OverlaySynchronizer","overlayMap_","Map","overlayEvents","overlayCollection_","getOverlays","overlayContainerStopEvent_","className","name","parentElement","overlayContainer_","overlay","addOverlay","removeOverlay","cesiumOverlay","overlayId","csOverlay","delete","BoundingSphereState","OLCesium","autoRenderLoop_","resolutionScale_","canvasClientWidth_","canvasClientHeight_","resolutionScaleChanged_","enabled_","pausedInteractions_","hiddenRootGroup_","lastFrameTime_","targetFrameRate_","Number","POSITIVE_INFINITY","blockCesiumRendering_","warmingUp_","trackedFeature_","trackedEntity_","entityView_","needTrackedEntityUpdate_","boundingSphereScratch_","time_","time","JulianDate","to4326Transform_","fillArea","container_","containerAttribute","createAttribute","setAttributeNode","targetElement","getViewport","getElementById","isOverMap_","stopOpenLayersEventsPropagation","ii","canvasAttribute","oncontextmenu","onselectstart","sceneOptions","scene3DOnly","Scene","sscc","screenSpaceCameraController","tiltEventTypes","CameraEventType","LEFT_DRAG","KeyboardEventModifier","SHIFT","ALT","enableLook","constrainedAxis","camera_","olcsCamera","globe_","Globe","baseColor","WHITE","skyAtmosphere","SkyAtmosphere","firstImageryProvider","addImageryProvider","dataSourceCollection_","DataSourceCollection","dataSourceDisplay_","DataSourceDisplay","dataSourceCollection","synchronizers_","createSynchronizers","olcsRasterSynchronizer","olcsVectorSynchronizer","olcsOverlaySynchronizer","handleResize_","EventHelper","updateTrackedEntity_","cancelAnimationFrame","renderId_","_postRender","render_","onAnimationFrame_","frameTime","interval","julianDate","initializeFrame","update","trackedEntity","getBoundingSphere","state","enableTilt","bs","EntityView","mapProjection","resolutionScale","devicePixelRatio","aspectRatio","getCamera","getOlView","getDataSources","getDataSourceDisplay","getEnabled","setEnabled","interactions","visibility","throwOnUnitializedMap_","getInteractions","arr","addInteraction","interaction","removeInteraction","interactionRemoved","filter","removed","rootGroup","classList","warmUp","timeout","csCamera","setTimeout","setBlockCesiumRendering","block","enableAutoRenderLoop","olcsAutoRenderLoop","getAutoRenderLoop","setResolutionScale","setTargetFrameRate","isDef","trackedFeature","defaultDataSource","entities","IDENTITY","to4326Transform","toCesiumPosition","olGeomPoint","CallbackProperty","TRANSPARENT","computeRectangle","tw","th","maskAspectRatio","maskSize","scaling","postUnlistener","MaskDrawer","gl","shaderProgram","initShaderProgram","programInfo","program","attribLocations","vertexPosition","getAttribLocation","uniformLocations","uScaling","getUniformLocation","positionBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","getVertexShaderSource","getFragmentShaderSource","vsSource","fsSource","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","drawMask","BLEND","vertexAttribPointer","FLOAT","enableVertexAttribArray","useProgram","STENCIL_TEST","stencilFunc","ALWAYS","stencilOp","KEEP","REPLACE","uniform2fv","blendFunc","ONE","drawArrays","TRIANGLE_STRIP","EQUAL","SRC_ALPHA","shader","createShader","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","autoDrawMask","getScalings","drawer","takeScreenshot","remover","smallerCanvas","LazyLoader","url_","script","onload","onerror","head","Manager","cesiumUrl","cameraExtentInRadians","cesiumIonDefaultAccessToken","cesiumInitialTilt_","fogDensity","fogSSEFactor","minimumZoomDistance","maximumZoomDistance","limitCameraToBoundingSphereRatio","cesiumUrl_","cesiumIonDefaultAccessToken_","promise_","cesiumLazyLoader","olcsContribLazyLoader","onCesiumLoaded","rect","DEFAULT_VIEW_RECTANGLE","boundingSphere_","fromRectangle3D","Ion","defaultAccessToken","instantiateOLCesium","configureForUsability","configureForPerformance","terrainProvider","createWorldTerrain","createWorldTerrainAsync","tp","fog","density","screenSpaceErrorFactor","sscController","depthTestAgainstTerrain","backgroundColor","toggle3d","is3DCurrentlyEnabled","set3dWithView","lon","lat","elevation","headingDeg","pitchDeg","is3dEnabled","getTiltOnGlobe","bottom","getOl3d","getCesiumViewMatrix","flyToRectangle","getRectangleCameraCoordinates","mag","multiplyByScalar","flyTo","endTransform","olcs","core","contrib","ContribLazyLoader","ContribManager"],"sourceRoot":""}