{ "version": 3, "sources": ["index.js", "wms-layer/wms-layer.js", "wms-layer/utils.js", "great-circle-layer/great-circle-layer.js", "geo-cell-layer/GeoCellLayer.js", "s2-layer/s2-geometry.js", "s2-layer/s2-utils.js", "s2-layer/s2-layer.js", "quadkey-layer/quadkey-utils.js", "quadkey-layer/quadkey-layer.js", "tile-layer/tile-layer.js", "tileset-2d/tileset-2d.js", "tileset-2d/tile-2d-header.js", "tileset-2d/tile-2d-traversal.js", "tileset-2d/utils.js", "tileset-2d/memoize.js", "trips-layer/trips-layer.js", "h3-layers/h3-cluster-layer.js", "h3-layers/h3-hexagon-layer.js", "h3-layers/h3-utils.js", "tile-3d-layer/tile-3d-layer.js", "mesh-layer/mesh-layer.js", "mesh-layer/mesh-layer-vertex.glsl.js", "mesh-layer/mesh-layer-fragment.glsl.js", "terrain-layer/terrain-layer.js", "mvt-layer/mvt-layer.js", "mvt-layer/coordinate-transform.js", "mvt-layer/find-index-binary.js", "geohash-layer/geohash-utils.js", "geohash-layer/geohash-layer.js"], "sourcesContent": ["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n/* eslint-disable max-len */\nexport { WMSLayer as _WMSLayer } from \"./wms-layer/wms-layer.js\";\nexport { default as GreatCircleLayer } from \"./great-circle-layer/great-circle-layer.js\";\nexport { default as S2Layer } from \"./s2-layer/s2-layer.js\";\nexport { default as QuadkeyLayer } from \"./quadkey-layer/quadkey-layer.js\";\nexport { default as TileLayer } from \"./tile-layer/tile-layer.js\";\nexport { default as TripsLayer } from \"./trips-layer/trips-layer.js\";\nexport { default as H3ClusterLayer } from \"./h3-layers/h3-cluster-layer.js\";\nexport { default as H3HexagonLayer } from \"./h3-layers/h3-hexagon-layer.js\";\nexport { default as Tile3DLayer } from \"./tile-3d-layer/tile-3d-layer.js\";\nexport { default as TerrainLayer } from \"./terrain-layer/terrain-layer.js\";\nexport { default as MVTLayer } from \"./mvt-layer/mvt-layer.js\";\nexport { default as GeohashLayer } from \"./geohash-layer/geohash-layer.js\";\nexport { default as _GeoCellLayer } from \"./geo-cell-layer/GeoCellLayer.js\";\nexport { getURLFromTemplate as _getURLFromTemplate } from \"./tileset-2d/index.js\";\nexport { Tileset2D as _Tileset2D } from \"./tileset-2d/index.js\";\nexport { Tile2DHeader as _Tile2DHeader } from \"./tileset-2d/index.js\";\n", "// deck.gl, MIT license\n// Attributions:\n// Copyright 2022 Foursquare Labs, Inc.\n/* eslint-disable camelcase */ // Some WMS parameters are not in camel case\n/* global setTimeout, clearTimeout */\nimport { CompositeLayer, COORDINATE_SYSTEM, _deepEqual as deepEqual } from '@deck.gl/core';\nimport { BitmapLayer } from '@deck.gl/layers';\nimport { ImageSource, createImageSource } from '@loaders.gl/wms';\nimport { WGS84ToPseudoMercator } from \"./utils.js\";\nconst defaultProps = {\n id: 'imagery-layer',\n data: '',\n serviceType: 'auto',\n srs: 'auto',\n layers: { type: 'array', compare: true, value: [] },\n onMetadataLoad: { type: 'function', value: () => { } },\n // eslint-disable-next-line\n onMetadataLoadError: { type: 'function', value: console.error },\n onImageLoadStart: { type: 'function', value: () => { } },\n onImageLoad: { type: 'function', value: () => { } },\n onImageLoadError: {\n type: 'function',\n compare: false,\n // eslint-disable-next-line\n value: (requestId, error) => console.error(error, requestId)\n }\n};\n/**\n * The layer is used in Hex Tile layer in order to properly discard invisible elements during animation\n */\nexport class WMSLayer extends CompositeLayer {\n /** Returns true if all async resources are loaded */\n get isLoaded() {\n // Track the explicit loading done by this layer\n return this.state?.loadCounter === 0 && super.isLoaded;\n }\n /** Lets deck.gl know that we want viewport change events */\n shouldUpdateState() {\n return true;\n }\n initializeState() {\n // intentionally empty, initialization is done in updateState\n this.state._nextRequestId = 0;\n this.state.lastRequestId = -1;\n this.state.loadCounter = 0;\n }\n updateState({ changeFlags, props, oldProps }) {\n const { viewport } = this.context;\n // Check if data source has changed\n if (changeFlags.dataChanged || props.serviceType !== oldProps.serviceType) {\n this.state.imageSource = this._createImageSource(props);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._loadMetadata();\n this.debounce(() => this.loadImage(viewport, 'image source changed'), 0);\n }\n else if (!deepEqual(props.layers, oldProps.layers, 1)) {\n this.debounce(() => this.loadImage(viewport, 'layers changed'), 0);\n }\n else if (changeFlags.viewportChanged) {\n this.debounce(() => this.loadImage(viewport, 'viewport changed'));\n }\n }\n finalizeState() {\n // TODO - we could cancel outstanding requests\n }\n renderLayers() {\n // TODO - which bitmap layer is rendered should depend on the current viewport\n // Currently Studio only uses one viewport\n const { bounds, image, lastRequestParameters } = this.state;\n return (image &&\n new BitmapLayer({\n ...this.getSubLayerProps({ id: 'bitmap' }),\n _imageCoordinateSystem: lastRequestParameters.srs === 'EPSG:4326'\n ? COORDINATE_SYSTEM.LNGLAT\n : COORDINATE_SYSTEM.CARTESIAN,\n bounds,\n image\n }));\n }\n async getFeatureInfoText(x, y) {\n const { lastRequestParameters } = this.state;\n if (lastRequestParameters) {\n // @ts-expect-error Undocumented method\n const featureInfo = await this.state.imageSource.getFeatureInfoText?.({\n ...lastRequestParameters,\n query_layers: lastRequestParameters.layers,\n x,\n y,\n info_format: 'application/vnd.ogc.gml'\n });\n return featureInfo;\n }\n return '';\n }\n _createImageSource(props) {\n if (props.data instanceof ImageSource) {\n return props.data;\n }\n if (typeof props.data === 'string') {\n return createImageSource({\n url: props.data,\n loadOptions: props.loadOptions,\n type: props.serviceType\n });\n }\n throw new Error('invalid image source in props.data');\n }\n /** Run a getMetadata on the image service */\n async _loadMetadata() {\n const { imageSource } = this.state;\n try {\n this.state.loadCounter++;\n const metadata = await imageSource.getMetadata();\n // If a request takes a long time, it may no longer be expected\n if (this.state.imageSource === imageSource) {\n this.getCurrentLayer()?.props.onMetadataLoad(metadata);\n }\n }\n catch (error) {\n this.getCurrentLayer()?.props.onMetadataLoadError(error);\n }\n finally {\n this.state.loadCounter--;\n }\n }\n /** Load an image */\n async loadImage(viewport, reason) {\n const { layers, serviceType } = this.props;\n // TODO - move to ImageSource?\n if (serviceType === 'wms' && layers.length === 0) {\n return;\n }\n const bounds = viewport.getBounds();\n const { width, height } = viewport;\n const requestId = this.getRequestId();\n let { srs } = this.props;\n if (srs === 'auto') {\n // BitmapLayer only supports LNGLAT or CARTESIAN (Web-Mercator)\n srs = viewport.resolution ? 'EPSG:4326' : 'EPSG:3857';\n }\n const requestParams = {\n width,\n height,\n boundingBox: [\n [bounds[0], bounds[1]],\n [bounds[2], bounds[3]]\n ],\n layers,\n crs: srs\n };\n if (srs === 'EPSG:3857') {\n const min = WGS84ToPseudoMercator([bounds[0], bounds[1]]);\n const max = WGS84ToPseudoMercator([bounds[2], bounds[3]]);\n requestParams.boundingBox = [min, max];\n }\n try {\n this.state.loadCounter++;\n this.props.onImageLoadStart(requestId);\n const image = await this.state.imageSource.getImage(requestParams);\n // If a request takes a long time, later requests may have already loaded.\n if (this.state.lastRequestId < requestId) {\n this.getCurrentLayer()?.props.onImageLoad(requestId);\n // Not type safe...\n this.setState({\n image,\n bounds,\n lastRequestParameters: requestParams,\n lastRequestId: requestId\n });\n }\n }\n catch (error) {\n this.raiseError(error, 'Load image');\n this.getCurrentLayer()?.props.onImageLoadError(requestId, error);\n }\n finally {\n this.state.loadCounter--;\n }\n }\n // HELPERS\n /** Global counter for issuing unique request ids */\n getRequestId() {\n return this.state._nextRequestId++;\n }\n /** Runs an action in the future, cancels it if the new action is issued before it executes */\n debounce(fn, ms = 500) {\n clearTimeout(this.state._timeoutId);\n this.state._timeoutId = setTimeout(() => fn(), ms);\n }\n}\nWMSLayer.layerName = 'WMSLayer';\nWMSLayer.defaultProps = defaultProps;\n", "import { lngLatToWorld } from '@math.gl/web-mercator';\n// https://epsg.io/3857\n// +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs\nconst HALF_EARTH_CIRCUMFERENCE = 6378137 * Math.PI;\n/** Projects EPSG:4326 to EPSG:3857\n * This is a lightweight replacement of proj4. Use tests to ensure conformance.\n */\nexport function WGS84ToPseudoMercator(coord) {\n const mercator = lngLatToWorld(coord);\n mercator[0] = (mercator[0] / 256 - 1) * HALF_EARTH_CIRCUMFERENCE;\n mercator[1] = (mercator[1] / 256 - 1) * HALF_EARTH_CIRCUMFERENCE;\n return mercator;\n}\n", "import { ArcLayer } from '@deck.gl/layers';\nconst defaultProps = {\n getHeight: { type: 'accessor', value: 0 },\n greatCircle: true\n};\n// This layer has been merged into the core ArcLayer\n// Keeping for backward-compatibility\n/** @deprecated Use ArcLayer with `greatCircle: true` instead */\nclass GreatCircleLayer extends ArcLayer {\n}\nGreatCircleLayer.layerName = 'GreatCircleLayer';\nGreatCircleLayer.defaultProps = defaultProps;\nexport default GreatCircleLayer;\n", "import { CompositeLayer } from '@deck.gl/core';\nimport { PolygonLayer } from '@deck.gl/layers';\nconst defaultProps = {\n ...PolygonLayer.defaultProps\n};\nclass GeoCellLayer extends CompositeLayer {\n /** Implement to generate props to create geometry. */\n indexToBounds() {\n return null;\n }\n renderLayers() {\n // Rendering props underlying layer\n const { elevationScale, extruded, wireframe, filled, stroked, lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels, lineJointRounded, lineMiterLimit, lineDashJustified, getElevation, getFillColor, getLineColor, getLineWidth } = this.props;\n // Accessor props for underlying layers\n const { updateTriggers, material, transitions } = this.props;\n // Filled Polygon Layer\n const CellLayer = this.getSubLayerClass('cell', PolygonLayer);\n const { updateTriggers: boundsUpdateTriggers, ...boundsProps } = this.indexToBounds() || {};\n return new CellLayer({\n filled,\n wireframe,\n extruded,\n elevationScale,\n stroked,\n lineWidthUnits,\n lineWidthScale,\n lineWidthMinPixels,\n lineWidthMaxPixels,\n lineJointRounded,\n lineMiterLimit,\n lineDashJustified,\n material,\n transitions,\n getElevation,\n getFillColor,\n getLineColor,\n getLineWidth\n }, this.getSubLayerProps({\n id: 'cell',\n updateTriggers: updateTriggers && {\n ...boundsUpdateTriggers,\n getElevation: updateTriggers.getElevation,\n getFillColor: updateTriggers.getFillColor,\n getLineColor: updateTriggers.getLineColor,\n getLineWidth: updateTriggers.getLineWidth\n }\n }), boundsProps);\n }\n}\nGeoCellLayer.layerName = 'GeoCellLayer';\nGeoCellLayer.defaultProps = defaultProps;\nexport default GeoCellLayer;\n", "/*\nAdapted from s2-geometry\n\nISC License (ISC)\n\nCopyright (c) 2012-2016, Jon Atkins \nCopyright (c) 2016, AJ ONeal \n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\nimport Long from 'long';\n//\n// Functional Style\n//\nconst FACE_BITS = 3;\nconst MAX_LEVEL = 30;\nconst POS_BITS = 2 * MAX_LEVEL + 1; // 61 (60 bits of data, 1 bit lsb marker)\nconst RADIAN_TO_DEGREE = 180 / Math.PI;\nexport function IJToST(ij, order, offsets) {\n const maxSize = 1 << order;\n return [(ij[0] + offsets[0]) / maxSize, (ij[1] + offsets[1]) / maxSize];\n}\nfunction singleSTtoUV(st) {\n if (st >= 0.5) {\n return (1 / 3.0) * (4 * st * st - 1);\n }\n return (1 / 3.0) * (1 - 4 * (1 - st) * (1 - st));\n}\nexport function STToUV(st) {\n return [singleSTtoUV(st[0]), singleSTtoUV(st[1])];\n}\nexport function FaceUVToXYZ(face, [u, v]) {\n switch (face) {\n case 0:\n return [1, u, v];\n case 1:\n return [-u, 1, v];\n case 2:\n return [-u, -v, 1];\n case 3:\n return [-1, -v, -u];\n case 4:\n return [v, -1, -u];\n case 5:\n return [v, u, -1];\n default:\n throw new Error('Invalid face');\n }\n}\nexport function XYZToLngLat([x, y, z]) {\n const lat = Math.atan2(z, Math.sqrt(x * x + y * y));\n const lng = Math.atan2(y, x);\n return [lng * RADIAN_TO_DEGREE, lat * RADIAN_TO_DEGREE];\n}\nexport function toHilbertQuadkey(idS) {\n let bin = Long.fromString(idS, true, 10).toString(2);\n while (bin.length < FACE_BITS + POS_BITS) {\n // eslint-disable-next-line prefer-template\n bin = '0' + bin;\n }\n // MUST come AFTER binstr has been left-padded with '0's\n const lsbIndex = bin.lastIndexOf('1');\n // substr(start, len)\n // substring(start, end) // includes start, does not include end\n const faceB = bin.substring(0, 3);\n // posB will always be a multiple of 2 (or it's invalid)\n const posB = bin.substring(3, lsbIndex);\n const levelN = posB.length / 2;\n const faceS = Long.fromString(faceB, true, 2).toString(10);\n let posS = Long.fromString(posB, true, 2).toString(4);\n while (posS.length < levelN) {\n // eslint-disable-next-line prefer-template\n posS = '0' + posS;\n }\n return `${faceS}/${posS}`;\n}\nfunction rotateAndFlipQuadrant(n, point, rx, ry) {\n if (ry === 0) {\n if (rx === 1) {\n point[0] = n - 1 - point[0];\n point[1] = n - 1 - point[1];\n }\n const x = point[0];\n point[0] = point[1];\n point[1] = x;\n }\n}\nexport function FromHilbertQuadKey(hilbertQuadkey) {\n const parts = hilbertQuadkey.split('/');\n const face = parseInt(parts[0], 10);\n const position = parts[1];\n const maxLevel = position.length;\n const point = [0, 0];\n let level;\n for (let i = maxLevel - 1; i >= 0; i--) {\n level = maxLevel - i;\n const bit = position[i];\n let rx = 0;\n let ry = 0;\n if (bit === '1') {\n ry = 1;\n }\n else if (bit === '2') {\n rx = 1;\n ry = 1;\n }\n else if (bit === '3') {\n rx = 1;\n }\n const val = Math.pow(2, level - 1);\n rotateAndFlipQuadrant(val, point, rx, ry);\n point[0] += val * rx;\n point[1] += val * ry;\n }\n if (face % 2 === 1) {\n const t = point[0];\n point[0] = point[1];\n point[1] = t;\n }\n return { face, ij: point, level };\n}\n", "// s2-geometry is a pure JavaScript port of Google/Niantic's S2 Geometry library\n// which is perfect since it works in the browser.\nimport { toHilbertQuadkey, FromHilbertQuadKey, IJToST, STToUV, FaceUVToXYZ, XYZToLngLat } from \"./s2-geometry.js\";\nimport Long from 'long';\n/**\n * Given an S2 token this function convert the token to 64 bit id\n https://github.com/google/s2-geometry-library-java/blob/c04b68bf3197a9c34082327eeb3aec7ab7c85da1/src/com/google/common/geometry/S2CellId.java#L439\n * */\nfunction getIdFromToken(token) {\n // pad token with zeros to make the length 16\n const paddedToken = token.padEnd(16, '0');\n return Long.fromString(paddedToken, 16);\n}\nconst MAX_RESOLUTION = 100;\n/* Adapted from s2-geometry's S2Cell.getCornerLatLngs */\n/* eslint-disable max-statements */\nfunction getGeoBounds({ face, ij, level }) {\n const offsets = [\n [0, 0],\n [0, 1],\n [1, 1],\n [1, 0],\n [0, 0]\n ];\n // The S2 cell edge is curved: http://s2geometry.io/\n // This is more prominent at lower levels\n // resolution is the number of segments to generate per edge.\n // We exponentially reduce resolution as level increases so it doesn't affect perf\n // when there are a large number of cells\n const resolution = Math.max(1, Math.ceil(MAX_RESOLUTION * Math.pow(2, -level)));\n const result = new Float64Array(4 * resolution * 2 + 2);\n let ptIndex = 0;\n let prevLng = 0;\n for (let i = 0; i < 4; i++) {\n const offset = offsets[i].slice(0);\n const nextOffset = offsets[i + 1];\n const stepI = (nextOffset[0] - offset[0]) / resolution;\n const stepJ = (nextOffset[1] - offset[1]) / resolution;\n for (let j = 0; j < resolution; j++) {\n offset[0] += stepI;\n offset[1] += stepJ;\n // Cell can be represented by coordinates IJ, ST, UV, XYZ\n // http://s2geometry.io/devguide/s2cell_hierarchy#coordinate-systems\n const st = IJToST(ij, level, offset);\n const uv = STToUV(st);\n const xyz = FaceUVToXYZ(face, uv);\n const lngLat = XYZToLngLat(xyz);\n // Adjust longitude for Web Mercator projection\n if (Math.abs(lngLat[1]) > 89.999) {\n lngLat[0] = prevLng;\n }\n const deltaLng = lngLat[0] - prevLng;\n lngLat[0] += deltaLng > 180 ? -360 : deltaLng < -180 ? 360 : 0;\n result[ptIndex++] = lngLat[0];\n result[ptIndex++] = lngLat[1];\n prevLng = lngLat[0];\n }\n }\n // close the loop\n result[ptIndex++] = result[0];\n result[ptIndex++] = result[1];\n return result;\n}\n/* eslint-enable max-statements */\nexport function getS2QuadKey(token) {\n if (typeof token === 'string') {\n if (token.indexOf('/') > 0) {\n // is Hilbert quad key\n return token;\n }\n // is S2 token\n token = getIdFromToken(token);\n }\n // is Long id\n return toHilbertQuadkey(token.toString());\n}\n/**\n * Get a polygon with corner coordinates for an s2 cell\n * @param {*} cell - This can be an S2 key or token\n * @return {Float64Array} - a simple polygon in flat array format: [lng0, lat0, lng1, lat1, ...]\n * - the polygon is closed, i.e. last coordinate is a copy of the first coordinate\n */\nexport function getS2Polygon(token) {\n const key = getS2QuadKey(token);\n const s2cell = FromHilbertQuadKey(key);\n return getGeoBounds(s2cell);\n}\n", "// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport GeoCellLayer from \"../geo-cell-layer/GeoCellLayer.js\";\nimport { getS2Polygon } from \"./s2-utils.js\";\nconst defaultProps = {\n getS2Token: { type: 'accessor', value: (d) => d.token }\n};\n/** Render filled and/or stroked polygons based on the [S2](http://s2geometry.io/) geospatial indexing system. */\nclass S2Layer extends GeoCellLayer {\n indexToBounds() {\n const { data, getS2Token } = this.props;\n return {\n data,\n _normalize: false,\n positionFormat: 'XY',\n getPolygon: (x, objectInfo) => getS2Polygon(getS2Token(x, objectInfo))\n };\n }\n}\nS2Layer.layerName = 'S2Layer';\nS2Layer.defaultProps = defaultProps;\nexport default S2Layer;\n", "import { worldToLngLat } from '@math.gl/web-mercator';\nconst TILE_SIZE = 512;\nexport function quadkeyToWorldBounds(quadkey, coverage) {\n let x = 0;\n let y = 0;\n let mask = 1 << quadkey.length;\n const scale = mask / TILE_SIZE;\n for (let i = 0; i < quadkey.length; i++) {\n mask >>= 1;\n const q = parseInt(quadkey[i]);\n if (q % 2)\n x |= mask;\n if (q > 1)\n y |= mask;\n }\n return [\n [x / scale, TILE_SIZE - y / scale],\n [(x + coverage) / scale, TILE_SIZE - (y + coverage) / scale]\n ];\n}\nexport function getQuadkeyPolygon(quadkey, coverage = 1) {\n const [topLeft, bottomRight] = quadkeyToWorldBounds(quadkey, coverage);\n const [w, n] = worldToLngLat(topLeft);\n const [e, s] = worldToLngLat(bottomRight);\n return [e, n, e, s, w, s, w, n, e, n];\n}\n", "import GeoCellLayer from \"../geo-cell-layer/GeoCellLayer.js\";\nimport { getQuadkeyPolygon } from \"./quadkey-utils.js\";\nconst defaultProps = {\n getQuadkey: { type: 'accessor', value: (d) => d.quadkey }\n};\n/** Render filled and/or stroked polygons based on the [Quadkey](https://towardsdatascience.com/geospatial-indexing-with-quadkeys-d933dff01496) geospatial indexing system. */\nclass QuadkeyLayer extends GeoCellLayer {\n indexToBounds() {\n const { data, extruded, getQuadkey } = this.props;\n // To avoid z-fighting reduce polygon footprint when extruding\n const coverage = extruded ? 0.99 : 1;\n return {\n data,\n _normalize: false,\n positionFormat: 'XY',\n getPolygon: (x, objectInfo) => getQuadkeyPolygon(getQuadkey(x, objectInfo), coverage),\n updateTriggers: { getPolygon: coverage }\n };\n }\n}\nQuadkeyLayer.layerName = 'QuadkeyLayer';\nQuadkeyLayer.defaultProps = defaultProps;\nexport default QuadkeyLayer;\n", "import { CompositeLayer, _flatten as flatten } from '@deck.gl/core';\nimport { GeoJsonLayer } from '@deck.gl/layers';\nimport { Tileset2D, STRATEGY_DEFAULT } from \"../tileset-2d/index.js\";\nimport { urlType, getURLFromTemplate } from \"../tileset-2d/index.js\";\nconst defaultProps = {\n TilesetClass: Tileset2D,\n data: { type: 'data', value: [] },\n dataComparator: urlType.equal,\n renderSubLayers: { type: 'function', value: (props) => new GeoJsonLayer(props) },\n getTileData: { type: 'function', optional: true, value: null },\n // TODO - change to onViewportLoad to align with Tile3DLayer\n onViewportLoad: { type: 'function', optional: true, value: null },\n onTileLoad: { type: 'function', value: tile => { } },\n onTileUnload: { type: 'function', value: tile => { } },\n // eslint-disable-next-line\n onTileError: { type: 'function', value: err => console.error(err) },\n extent: { type: 'array', optional: true, value: null, compare: true },\n tileSize: 512,\n maxZoom: null,\n minZoom: 0,\n maxCacheSize: null,\n maxCacheByteSize: null,\n refinementStrategy: STRATEGY_DEFAULT,\n zRange: null,\n maxRequests: 6,\n debounceTime: 0,\n zoomOffset: 0\n};\n/**\n * The TileLayer is a composite layer that makes it possible to visualize very large datasets.\n *\n * Instead of fetching the entire dataset, it only loads and renders what's visible in the current viewport.\n */\nclass TileLayer extends CompositeLayer {\n initializeState() {\n this.state = {\n tileset: null,\n isLoaded: false\n };\n }\n finalizeState() {\n this.state?.tileset?.finalize();\n }\n get isLoaded() {\n return Boolean(this.state?.tileset?.selectedTiles?.every(tile => tile.isLoaded && tile.layers && tile.layers.every(layer => layer.isLoaded)));\n }\n shouldUpdateState({ changeFlags }) {\n return changeFlags.somethingChanged;\n }\n updateState({ changeFlags }) {\n let { tileset } = this.state;\n const propsChanged = changeFlags.propsOrDataChanged || changeFlags.updateTriggersChanged;\n const dataChanged = changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getTileData));\n if (!tileset) {\n tileset = new this.props.TilesetClass(this._getTilesetOptions());\n this.setState({ tileset });\n }\n else if (propsChanged) {\n tileset.setOptions(this._getTilesetOptions());\n if (dataChanged) {\n // reload all tiles\n // use cached layers until new content is loaded\n tileset.reloadAll();\n }\n else {\n // some render options changed, regenerate sub layers now\n tileset.tiles.forEach(tile => {\n tile.layers = null;\n });\n }\n }\n this._updateTileset();\n }\n _getTilesetOptions() {\n const { tileSize, maxCacheSize, maxCacheByteSize, refinementStrategy, extent, maxZoom, minZoom, maxRequests, debounceTime, zoomOffset } = this.props;\n return {\n maxCacheSize,\n maxCacheByteSize,\n maxZoom,\n minZoom,\n tileSize,\n refinementStrategy,\n extent,\n maxRequests,\n debounceTime,\n zoomOffset,\n getTileData: this.getTileData.bind(this),\n onTileLoad: this._onTileLoad.bind(this),\n onTileError: this._onTileError.bind(this),\n onTileUnload: this._onTileUnload.bind(this)\n };\n }\n _updateTileset() {\n const tileset = this.state.tileset;\n const { zRange, modelMatrix } = this.props;\n const frameNumber = tileset.update(this.context.viewport, { zRange, modelMatrix });\n const { isLoaded } = tileset;\n const loadingStateChanged = this.state.isLoaded !== isLoaded;\n const tilesetChanged = this.state.frameNumber !== frameNumber;\n if (isLoaded && (loadingStateChanged || tilesetChanged)) {\n this._onViewportLoad();\n }\n if (tilesetChanged) {\n // Save the tileset frame number - trigger a rerender\n this.setState({ frameNumber });\n }\n // Save the loaded state - should not trigger a rerender\n this.state.isLoaded = isLoaded;\n }\n _onViewportLoad() {\n const { tileset } = this.state;\n const { onViewportLoad } = this.props;\n if (onViewportLoad) {\n // This method can only be called when tileset is defined and updated\n onViewportLoad(tileset.selectedTiles);\n }\n }\n _onTileLoad(tile) {\n this.props.onTileLoad(tile);\n tile.layers = null;\n this.setNeedsUpdate();\n }\n _onTileError(error, tile) {\n this.props.onTileError(error);\n tile.layers = null;\n this.setNeedsUpdate();\n }\n _onTileUnload(tile) {\n this.props.onTileUnload(tile);\n }\n // Methods for subclass to override\n getTileData(tile) {\n const { data, getTileData, fetch } = this.props;\n const { signal } = tile;\n tile.url =\n typeof data === 'string' || Array.isArray(data) ? getURLFromTemplate(data, tile) : null;\n if (getTileData) {\n return getTileData(tile);\n }\n if (fetch && tile.url) {\n return fetch(tile.url, { propName: 'data', layer: this, signal });\n }\n return null;\n }\n renderSubLayers(props) {\n return this.props.renderSubLayers(props);\n }\n getSubLayerPropsByTile(tile) {\n return null;\n }\n getPickingInfo(params) {\n // TileLayer does not directly render anything, sourceLayer cannot be null\n const sourceLayer = params.sourceLayer;\n const sourceTile = sourceLayer.props.tile;\n const info = params.info;\n if (info.picked) {\n info.tile = sourceTile;\n }\n info.sourceTile = sourceTile;\n info.sourceTileSubLayer = sourceLayer;\n return info;\n }\n _updateAutoHighlight(info) {\n info.sourceTileSubLayer.updateAutoHighlight(info);\n }\n renderLayers() {\n return this.state.tileset.tiles.map((tile) => {\n const subLayerProps = this.getSubLayerPropsByTile(tile);\n // cache the rendered layer in the tile\n if (!tile.isLoaded && !tile.content) {\n // nothing to show\n }\n else if (!tile.layers) {\n const layers = this.renderSubLayers({\n ...this.props,\n ...this.getSubLayerProps({\n id: tile.id,\n updateTriggers: this.props.updateTriggers\n }),\n data: tile.content,\n _offset: 0,\n tile\n });\n tile.layers = flatten(layers, Boolean).map(layer => layer.clone({\n tile,\n ...subLayerProps\n }));\n }\n else if (subLayerProps &&\n tile.layers[0] &&\n Object.keys(subLayerProps).some(propName => tile.layers[0].props[propName] !== subLayerProps[propName])) {\n tile.layers = tile.layers.map(layer => layer.clone(subLayerProps));\n }\n return tile.layers;\n });\n }\n filterSubLayer({ layer, cullRect }) {\n const { tile } = layer.props;\n return this.state.tileset.isTileVisible(tile, cullRect);\n }\n}\nTileLayer.defaultProps = defaultProps;\nTileLayer.layerName = 'TileLayer';\nexport default TileLayer;\n", "import { RequestScheduler } from '@loaders.gl/loader-utils';\nimport { Matrix4, equals } from '@math.gl/core';\nimport { Tile2DHeader } from \"./tile-2d-header.js\";\nimport { getTileIndices, tileToBoundingBox, getCullBounds } from \"./utils.js\";\nimport { memoize } from \"./memoize.js\";\n// bit masks\nconst TILE_STATE_VISITED = 1;\nconst TILE_STATE_VISIBLE = 2;\n/*\n show cached parent tile if children are loading\n +-----------+ +-----+ +-----+-----+\n | | | | | | |\n | | | | | | |\n | | --> +-----+-----+ -> +-----+-----+\n | | | | | | |\n | | | | | | |\n +-----------+ +-----+ +-----+-----+\n\n show cached children tiles when parent is loading\n +-------+---- +------------\n | | |\n | | |\n | | |\n +-------+---- --> |\n | | |\n */\nexport const STRATEGY_NEVER = 'never';\nexport const STRATEGY_REPLACE = 'no-overlap';\nexport const STRATEGY_DEFAULT = 'best-available';\nconst DEFAULT_CACHE_SCALE = 5;\nconst STRATEGIES = {\n [STRATEGY_DEFAULT]: updateTileStateDefault,\n [STRATEGY_REPLACE]: updateTileStateReplace,\n [STRATEGY_NEVER]: () => { }\n};\nexport const DEFAULT_TILESET2D_PROPS = {\n extent: null,\n tileSize: 512,\n maxZoom: null,\n minZoom: null,\n maxCacheSize: null,\n maxCacheByteSize: null,\n refinementStrategy: 'best-available',\n zRange: null,\n maxRequests: 6,\n debounceTime: 0,\n zoomOffset: 0,\n // onTileLoad: (tile: Tile2DHeader) => void, // onTileUnload: (tile: Tile2DHeader) => void, // onTileError: (error: any, tile: Tile2DHeader) => void, /** Called when all tiles in the current viewport are loaded. */\n // onViewportLoad: ((tiles: Tile2DHeader[]) => void) | null,\n onTileLoad: () => { },\n onTileUnload: () => { },\n onTileError: () => { }\n};\n/**\n * Manages loading and purging of tile data. This class caches recently visited tiles\n * and only creates new tiles if they are present.\n */\nexport class Tileset2D {\n /**\n * Takes in a function that returns tile data, a cache size, and a max and a min zoom level.\n * Cache size defaults to 5 * number of tiles in the current viewport\n */\n constructor(opts) {\n /* Private methods */\n this._getCullBounds = memoize(getCullBounds);\n this.opts = { ...DEFAULT_TILESET2D_PROPS, ...opts };\n this.setOptions(this.opts);\n this.onTileLoad = tile => {\n this.opts.onTileLoad?.(tile);\n if (this.opts.maxCacheByteSize != null) {\n this._cacheByteSize += tile.byteLength;\n this._resizeCache();\n }\n };\n this._requestScheduler = new RequestScheduler({\n throttleRequests: this.opts.maxRequests > 0 || this.opts.debounceTime > 0,\n maxRequests: this.opts.maxRequests,\n debounceTime: this.opts.debounceTime\n });\n // Maps tile id in string {z}-{x}-{y} to a Tile object\n this._cache = new Map();\n this._tiles = [];\n this._dirty = false;\n this._cacheByteSize = 0;\n // Cache the last processed viewport\n this._viewport = null;\n this._zRange = null;\n this._selectedTiles = null;\n this._frameNumber = 0;\n this._modelMatrix = new Matrix4();\n this._modelMatrixInverse = new Matrix4();\n }\n /* Public API */\n get tiles() {\n return this._tiles;\n }\n get selectedTiles() {\n return this._selectedTiles;\n }\n get isLoaded() {\n return this._selectedTiles !== null && this._selectedTiles.every(tile => tile.isLoaded);\n }\n get needsReload() {\n return this._selectedTiles !== null && this._selectedTiles.some(tile => tile.needsReload);\n }\n setOptions(opts) {\n Object.assign(this.opts, opts);\n if (Number.isFinite(opts.maxZoom)) {\n this._maxZoom = Math.floor(opts.maxZoom);\n }\n if (Number.isFinite(opts.minZoom)) {\n this._minZoom = Math.ceil(opts.minZoom);\n }\n }\n // Clean up any outstanding tile requests.\n finalize() {\n for (const tile of this._cache.values()) {\n if (tile.isLoading) {\n tile.abort();\n }\n }\n this._cache.clear();\n this._tiles = [];\n this._selectedTiles = null;\n }\n reloadAll() {\n for (const id of this._cache.keys()) {\n const tile = this._cache.get(id);\n if (!this._selectedTiles || !this._selectedTiles.includes(tile)) {\n this._cache.delete(id);\n }\n else {\n tile.setNeedsReload();\n }\n }\n }\n /**\n * Update the cache with the given viewport and model matrix and triggers callback onUpdate.\n */\n update(viewport, { zRange, modelMatrix } = {\n zRange: null,\n modelMatrix: null\n }) {\n const modelMatrixAsMatrix4 = modelMatrix ? new Matrix4(modelMatrix) : new Matrix4();\n const isModelMatrixNew = !modelMatrixAsMatrix4.equals(this._modelMatrix);\n if (!this._viewport ||\n !viewport.equals(this._viewport) ||\n !equals(this._zRange, zRange) ||\n isModelMatrixNew) {\n if (isModelMatrixNew) {\n this._modelMatrixInverse = modelMatrixAsMatrix4.clone().invert();\n this._modelMatrix = modelMatrixAsMatrix4;\n }\n this._viewport = viewport;\n this._zRange = zRange;\n const tileIndices = this.getTileIndices({\n viewport,\n maxZoom: this._maxZoom,\n minZoom: this._minZoom,\n zRange,\n modelMatrix: this._modelMatrix,\n modelMatrixInverse: this._modelMatrixInverse\n });\n this._selectedTiles = tileIndices.map(index => this._getTile(index, true));\n if (this._dirty) {\n // Some new tiles are added\n this._rebuildTree();\n }\n // Check for needed reloads explicitly even if the view/matrix has not changed.\n }\n else if (this.needsReload) {\n this._selectedTiles = this._selectedTiles.map(tile => this._getTile(tile.index, true));\n }\n // Update tile states\n const changed = this.updateTileStates();\n this._pruneRequests();\n if (this._dirty) {\n // cache size is either the user defined maxSize or 5 * number of current tiles in the viewport.\n this._resizeCache();\n }\n if (changed) {\n this._frameNumber++;\n }\n return this._frameNumber;\n }\n // eslint-disable-next-line complexity\n isTileVisible(tile, cullRect) {\n if (!tile.isVisible) {\n return false;\n }\n if (cullRect && this._viewport) {\n const boundsArr = this._getCullBounds({\n viewport: this._viewport,\n z: this._zRange,\n cullRect\n });\n const { bbox } = tile;\n for (const [minX, minY, maxX, maxY] of boundsArr) {\n let overlaps;\n if ('west' in bbox) {\n overlaps = bbox.west < maxX && bbox.east > minX && bbox.south < maxY && bbox.north > minY;\n }\n else {\n // top/bottom could be swapped depending on the indexing system\n const y0 = Math.min(bbox.top, bbox.bottom);\n const y1 = Math.max(bbox.top, bbox.bottom);\n overlaps = bbox.left < maxX && bbox.right > minX && y0 < maxY && y1 > minY;\n }\n if (overlaps) {\n return true;\n }\n }\n return false;\n }\n return true;\n }\n /* Public interface for subclassing */\n /** Returns array of tile indices in the current viewport */\n getTileIndices({ viewport, maxZoom, minZoom, zRange, modelMatrix, modelMatrixInverse }) {\n const { tileSize, extent, zoomOffset } = this.opts;\n return getTileIndices({\n viewport,\n maxZoom,\n minZoom,\n zRange,\n tileSize,\n extent: extent,\n modelMatrix,\n modelMatrixInverse,\n zoomOffset\n });\n }\n /** Returns unique string key for a tile index */\n getTileId(index) {\n return `${index.x}-${index.y}-${index.z}`;\n }\n /** Returns a zoom level for a tile index */\n getTileZoom(index) {\n return index.z;\n }\n /** Returns additional metadata to add to tile, bbox by default */\n getTileMetadata(index) {\n const { tileSize } = this.opts;\n return { bbox: tileToBoundingBox(this._viewport, index.x, index.y, index.z, tileSize) };\n }\n /** Returns index of the parent tile */\n getParentIndex(index) {\n const x = Math.floor(index.x / 2);\n const y = Math.floor(index.y / 2);\n const z = index.z - 1;\n return { x, y, z };\n }\n // Returns true if any tile's visibility changed\n updateTileStates() {\n const refinementStrategy = this.opts.refinementStrategy || STRATEGY_DEFAULT;\n const visibilities = new Array(this._cache.size);\n let i = 0;\n // Reset state\n for (const tile of this._cache.values()) {\n // save previous state\n visibilities[i++] = tile.isVisible;\n tile.isSelected = false;\n tile.isVisible = false;\n }\n // @ts-expect-error called only when _selectedTiles is already defined\n for (const tile of this._selectedTiles) {\n tile.isSelected = true;\n tile.isVisible = true;\n }\n // Strategy-specific state logic\n (typeof refinementStrategy === 'function'\n ? refinementStrategy\n : STRATEGIES[refinementStrategy])(Array.from(this._cache.values()));\n i = 0;\n // Check if any visibility has changed\n for (const tile of this._cache.values()) {\n if (visibilities[i++] !== tile.isVisible) {\n return true;\n }\n }\n return false;\n }\n _pruneRequests() {\n const { maxRequests = 0 } = this.opts;\n const abortCandidates = [];\n let ongoingRequestCount = 0;\n for (const tile of this._cache.values()) {\n // Keep track of all the ongoing requests\n if (tile.isLoading) {\n ongoingRequestCount++;\n if (!tile.isSelected && !tile.isVisible) {\n abortCandidates.push(tile);\n }\n }\n }\n while (maxRequests > 0 && ongoingRequestCount > maxRequests && abortCandidates.length > 0) {\n // There are too many ongoing requests, so abort some that are unselected\n const tile = abortCandidates.shift();\n tile.abort();\n ongoingRequestCount--;\n }\n }\n // This needs to be called every time some tiles have been added/removed from cache\n _rebuildTree() {\n const { _cache } = this;\n // Reset states\n for (const tile of _cache.values()) {\n tile.parent = null;\n if (tile.children) {\n tile.children.length = 0;\n }\n }\n // Rebuild tree\n for (const tile of _cache.values()) {\n const parent = this._getNearestAncestor(tile);\n tile.parent = parent;\n if (parent?.children) {\n parent.children.push(tile);\n }\n }\n }\n /**\n * Clear tiles that are not visible when the cache is full\n */\n /* eslint-disable complexity */\n _resizeCache() {\n const { _cache, opts } = this;\n const maxCacheSize = opts.maxCacheSize ??\n // @ts-expect-error called only when selectedTiles is initialized\n (opts.maxCacheByteSize != null ? Infinity : DEFAULT_CACHE_SCALE * this.selectedTiles.length);\n const maxCacheByteSize = opts.maxCacheByteSize ?? Infinity;\n const overflown = _cache.size > maxCacheSize || this._cacheByteSize > maxCacheByteSize;\n if (overflown) {\n for (const [id, tile] of _cache) {\n if (!tile.isVisible && !tile.isSelected) {\n // delete tile\n this._cacheByteSize -= opts.maxCacheByteSize != null ? tile.byteLength : 0;\n _cache.delete(id);\n this.opts.onTileUnload?.(tile);\n }\n if (_cache.size <= maxCacheSize && this._cacheByteSize <= maxCacheByteSize) {\n break;\n }\n }\n this._rebuildTree();\n this._dirty = true;\n }\n if (this._dirty) {\n // sort by zoom level so that smaller tiles are displayed on top\n this._tiles = Array.from(this._cache.values()).sort((t1, t2) => t1.zoom - t2.zoom);\n this._dirty = false;\n }\n }\n _getTile(index, create) {\n const id = this.getTileId(index);\n let tile = this._cache.get(id);\n let needsReload = false;\n if (!tile && create) {\n tile = new Tile2DHeader(index);\n Object.assign(tile, this.getTileMetadata(tile.index));\n Object.assign(tile, { id, zoom: this.getTileZoom(tile.index) });\n needsReload = true;\n this._cache.set(id, tile);\n this._dirty = true;\n }\n else if (tile && tile.needsReload) {\n needsReload = true;\n }\n if (tile && needsReload) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n tile.loadData({\n getData: this.opts.getTileData,\n requestScheduler: this._requestScheduler,\n onLoad: this.onTileLoad,\n onError: this.opts.onTileError\n });\n }\n return tile;\n }\n _getNearestAncestor(tile) {\n const { _minZoom = 0 } = this;\n let index = tile.index;\n while (this.getTileZoom(index) > _minZoom) {\n index = this.getParentIndex(index);\n const parent = this._getTile(index);\n if (parent) {\n return parent;\n }\n }\n return null;\n }\n}\n/* -- Refinement strategies --*/\n/* eslint-disable max-depth */\n// For all the selected && pending tiles:\n// - pick the closest ancestor as placeholder\n// - if no ancestor is visible, pick the closest children as placeholder\nfunction updateTileStateDefault(allTiles) {\n for (const tile of allTiles) {\n tile.state = 0;\n }\n for (const tile of allTiles) {\n if (tile.isSelected && !getPlaceholderInAncestors(tile)) {\n getPlaceholderInChildren(tile);\n }\n }\n for (const tile of allTiles) {\n tile.isVisible = Boolean(tile.state & TILE_STATE_VISIBLE);\n }\n}\n// Until a selected tile and all its selected siblings are loaded, use the closest ancestor as placeholder\nfunction updateTileStateReplace(allTiles) {\n for (const tile of allTiles) {\n tile.state = 0;\n }\n for (const tile of allTiles) {\n if (tile.isSelected) {\n getPlaceholderInAncestors(tile);\n }\n }\n // Always process parents first\n const sortedTiles = Array.from(allTiles).sort((t1, t2) => t1.zoom - t2.zoom);\n for (const tile of sortedTiles) {\n tile.isVisible = Boolean(tile.state & TILE_STATE_VISIBLE);\n if (tile.children && (tile.isVisible || tile.state & TILE_STATE_VISITED)) {\n // If the tile is rendered, or if the tile has been explicitly hidden, hide all of its children\n for (const child of tile.children) {\n child.state = TILE_STATE_VISITED;\n }\n }\n else if (tile.isSelected) {\n getPlaceholderInChildren(tile);\n }\n }\n}\n// Walk up the tree until we find one ancestor that is loaded. Returns true if successful.\nfunction getPlaceholderInAncestors(startTile) {\n let tile = startTile;\n while (tile) {\n if (tile.isLoaded || tile.content) {\n tile.state |= TILE_STATE_VISIBLE;\n return true;\n }\n tile = tile.parent;\n }\n return false;\n}\n// Recursively set children as placeholder\nfunction getPlaceholderInChildren(tile) {\n for (const child of tile.children) {\n if (child.isLoaded || child.content) {\n child.state |= TILE_STATE_VISIBLE;\n }\n else {\n getPlaceholderInChildren(child);\n }\n }\n}\n", "export class Tile2DHeader {\n constructor(index) {\n this.index = index;\n this.isVisible = false;\n this.isSelected = false;\n this.parent = null;\n this.children = [];\n this.content = null;\n this._loader = undefined;\n this._abortController = null;\n this._loaderId = 0;\n this._isLoaded = false;\n this._isCancelled = false;\n this._needsReload = false;\n }\n /** @deprecated use `boundingBox` instead */\n get bbox() {\n return this._bbox;\n }\n // TODO - remove in v9\n set bbox(value) {\n // Only set once from `Tileset2D.getTileMetadata`\n if (this._bbox)\n return;\n this._bbox = value;\n if ('west' in value) {\n this.boundingBox = [\n [value.west, value.south],\n [value.east, value.north]\n ];\n }\n else {\n this.boundingBox = [\n [value.left, value.top],\n [value.right, value.bottom]\n ];\n }\n }\n get data() {\n return this.isLoading && this._loader ? this._loader.then(() => this.data) : this.content;\n }\n get isLoaded() {\n return this._isLoaded && !this._needsReload;\n }\n get isLoading() {\n return Boolean(this._loader) && !this._isCancelled;\n }\n get needsReload() {\n return this._needsReload || this._isCancelled;\n }\n get byteLength() {\n const result = this.content ? this.content.byteLength : 0;\n if (!Number.isFinite(result)) {\n // eslint-disable-next-line no-console\n console.error('byteLength not defined in tile data');\n }\n return result;\n }\n /* eslint-disable max-statements */\n async _loadData({ getData, requestScheduler, onLoad, onError }) {\n const { index, id, bbox, userData, zoom } = this;\n const loaderId = this._loaderId;\n this._abortController = new AbortController();\n const { signal } = this._abortController;\n // @ts-expect-error (2345) Argument of type '(tile: any) => 1 | -1' is not assignable ...\n const requestToken = await requestScheduler.scheduleRequest(this, tile => {\n return tile.isSelected ? 1 : -1;\n });\n if (!requestToken) {\n this._isCancelled = true;\n return;\n }\n // A tile can be cancelled while being scheduled\n if (this._isCancelled) {\n requestToken.done();\n return;\n }\n let tileData = null;\n let error;\n try {\n tileData = await getData({ index, id, bbox, userData, zoom, signal });\n }\n catch (err) {\n error = err || true;\n }\n finally {\n requestToken.done();\n }\n // If loadData has been called with a newer version, discard the result from this operation\n if (loaderId !== this._loaderId) {\n return;\n }\n // Clear the `isLoading` flag\n this._loader = undefined;\n // Rewrite tile content with the result of getTileData if successful, or `null` in case of\n // error or cancellation\n this.content = tileData;\n // If cancelled, do not invoke the callbacks\n // Consider it loaded if we tried to cancel but `getTileData` still returned data\n if (this._isCancelled && !tileData) {\n this._isLoaded = false;\n return;\n }\n this._isLoaded = true;\n this._isCancelled = false;\n if (error) {\n onError(error, this);\n }\n else {\n onLoad(this);\n }\n }\n loadData(opts) {\n this._isLoaded = false;\n this._isCancelled = false;\n this._needsReload = false;\n this._loaderId++;\n this._loader = this._loadData(opts);\n return this._loader;\n }\n setNeedsReload() {\n if (this.isLoading) {\n this.abort();\n this._loader = undefined;\n }\n this._needsReload = true;\n }\n abort() {\n if (this.isLoaded) {\n return;\n }\n this._isCancelled = true;\n this._abortController?.abort();\n }\n}\n", "import { WebMercatorViewport, _GlobeViewport } from '@deck.gl/core';\nimport { CullingVolume, Plane, AxisAlignedBoundingBox, makeOrientedBoundingBoxFromPoints } from '@math.gl/culling';\nimport { lngLatToWorld } from '@math.gl/web-mercator';\nimport { osmTile2lngLat } from \"./utils.js\";\nconst TILE_SIZE = 512;\n// number of world copies to check\nconst MAX_MAPS = 3;\n// for calculating bounding volume of a tile in a non-web-mercator viewport\nconst REF_POINTS_5 = [\n [0.5, 0.5],\n [0, 0],\n [0, 1],\n [1, 0],\n [1, 1]\n]; // 4 corners and center\nconst REF_POINTS_9 = REF_POINTS_5.concat([\n [0, 0.5],\n [0.5, 0],\n [1, 0.5],\n [0.5, 1]\n]); // 4 corners, center and 4 mid points\nconst REF_POINTS_11 = REF_POINTS_9.concat([\n [0.25, 0.5],\n [0.75, 0.5]\n]); // 2 additional points on equator for top tile\nclass OSMNode {\n constructor(x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }\n get children() {\n if (!this._children) {\n const x = this.x * 2;\n const y = this.y * 2;\n const z = this.z + 1;\n this._children = [\n new OSMNode(x, y, z),\n new OSMNode(x, y + 1, z),\n new OSMNode(x + 1, y, z),\n new OSMNode(x + 1, y + 1, z)\n ];\n }\n return this._children;\n }\n // eslint-disable-next-line complexity\n update(params) {\n const { viewport, cullingVolume, elevationBounds, minZ, maxZ, bounds, offset, project } = params;\n const boundingVolume = this.getBoundingVolume(elevationBounds, offset, project);\n // First, check if this tile is visible\n if (bounds && !this.insideBounds(bounds)) {\n return false;\n }\n const isInside = cullingVolume.computeVisibility(boundingVolume);\n if (isInside < 0) {\n return false;\n }\n // Avoid loading overlapping tiles - if a descendant is requested, do not request the ancester\n if (!this.childVisible) {\n let { z } = this;\n if (z < maxZ && z >= minZ) {\n // Adjust LOD\n // If the tile is far enough from the camera, accept a lower zoom level\n const distance = (boundingVolume.distanceTo(viewport.cameraPosition) * viewport.scale) / viewport.height;\n z += Math.floor(Math.log2(distance));\n }\n if (z >= maxZ) {\n // LOD is acceptable\n this.selected = true;\n return true;\n }\n }\n // LOD is not enough, recursively test child tiles\n this.selected = false;\n this.childVisible = true;\n for (const child of this.children) {\n child.update(params);\n }\n return true;\n }\n getSelected(result = []) {\n if (this.selected) {\n result.push(this);\n }\n if (this._children) {\n for (const node of this._children) {\n node.getSelected(result);\n }\n }\n return result;\n }\n insideBounds([minX, minY, maxX, maxY]) {\n const scale = Math.pow(2, this.z);\n const extent = TILE_SIZE / scale;\n return (this.x * extent < maxX &&\n this.y * extent < maxY &&\n (this.x + 1) * extent > minX &&\n (this.y + 1) * extent > minY);\n }\n getBoundingVolume(zRange, worldOffset, project) {\n if (project) {\n // Custom projection\n // Estimate bounding box from sample points\n // At low zoom level we need more samples to calculate the bounding volume correctly\n const refPoints = this.z < 1 ? REF_POINTS_11 : this.z < 2 ? REF_POINTS_9 : REF_POINTS_5;\n // Convert from tile-relative coordinates to common space\n const refPointPositions = [];\n for (const p of refPoints) {\n const lngLat = osmTile2lngLat(this.x + p[0], this.y + p[1], this.z);\n lngLat[2] = zRange[0];\n refPointPositions.push(project(lngLat));\n if (zRange[0] !== zRange[1]) {\n // Account for the elevation volume\n lngLat[2] = zRange[1];\n refPointPositions.push(project(lngLat));\n }\n }\n return makeOrientedBoundingBoxFromPoints(refPointPositions);\n }\n // Use WebMercator projection\n const scale = Math.pow(2, this.z);\n const extent = TILE_SIZE / scale;\n const originX = this.x * extent + worldOffset * TILE_SIZE;\n // deck's common space is y-flipped\n const originY = TILE_SIZE - (this.y + 1) * extent;\n return new AxisAlignedBoundingBox([originX, originY, zRange[0]], [originX + extent, originY + extent, zRange[1]]);\n }\n}\n// eslint-disable-next-line complexity\nexport function getOSMTileIndices(viewport, maxZ, zRange, bounds) {\n const project = viewport instanceof _GlobeViewport && viewport.resolution\n ? // eslint-disable-next-line @typescript-eslint/unbound-method\n viewport.projectPosition\n : null;\n // Get the culling volume of the current camera\n const planes = Object.values(viewport.getFrustumPlanes()).map(({ normal, distance }) => new Plane(normal.clone().negate(), distance));\n const cullingVolume = new CullingVolume(planes);\n // Project zRange from meters to common space\n const unitsPerMeter = viewport.distanceScales.unitsPerMeter[2];\n const elevationMin = (zRange && zRange[0] * unitsPerMeter) || 0;\n const elevationMax = (zRange && zRange[1] * unitsPerMeter) || 0;\n // Always load at the current zoom level if pitch is small\n const minZ = viewport instanceof WebMercatorViewport && viewport.pitch <= 60 ? maxZ : 0;\n // Map extent to OSM position\n if (bounds) {\n const [minLng, minLat, maxLng, maxLat] = bounds;\n const topLeft = lngLatToWorld([minLng, maxLat]);\n const bottomRight = lngLatToWorld([maxLng, minLat]);\n bounds = [topLeft[0], TILE_SIZE - topLeft[1], bottomRight[0], TILE_SIZE - bottomRight[1]];\n }\n const root = new OSMNode(0, 0, 0);\n const traversalParams = {\n viewport,\n project,\n cullingVolume,\n elevationBounds: [elevationMin, elevationMax],\n minZ,\n maxZ,\n bounds,\n // num. of worlds from the center. For repeated maps\n offset: 0\n };\n root.update(traversalParams);\n if (viewport instanceof WebMercatorViewport &&\n viewport.subViewports &&\n viewport.subViewports.length > 1) {\n // Check worlds in repeated maps\n traversalParams.offset = -1;\n while (root.update(traversalParams)) {\n if (--traversalParams.offset < -MAX_MAPS) {\n break;\n }\n }\n traversalParams.offset = 1;\n while (root.update(traversalParams)) {\n if (++traversalParams.offset > MAX_MAPS) {\n break;\n }\n }\n }\n return root.getSelected();\n}\n", "import { getOSMTileIndices } from \"./tile-2d-traversal.js\";\nconst TILE_SIZE = 512;\nconst DEFAULT_EXTENT = [-Infinity, -Infinity, Infinity, Infinity];\nexport const urlType = {\n type: 'object',\n value: null,\n validate: (value, propType) => (propType.optional && value === null) ||\n typeof value === 'string' ||\n (Array.isArray(value) && value.every(url => typeof url === 'string')),\n equal: (value1, value2) => {\n if (value1 === value2) {\n return true;\n }\n if (!Array.isArray(value1) || !Array.isArray(value2)) {\n return false;\n }\n const len = value1.length;\n if (len !== value2.length) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n if (value1[i] !== value2[i]) {\n return false;\n }\n }\n return true;\n }\n};\nfunction transformBox(bbox, modelMatrix) {\n const transformedCoords = [\n // top-left\n modelMatrix.transformAsPoint([bbox[0], bbox[1]]),\n // top-right\n modelMatrix.transformAsPoint([bbox[2], bbox[1]]),\n // bottom-left\n modelMatrix.transformAsPoint([bbox[0], bbox[3]]),\n // bottom-right\n modelMatrix.transformAsPoint([bbox[2], bbox[3]])\n ];\n const transformedBox = [\n // Minimum x coord\n Math.min(...transformedCoords.map(i => i[0])),\n // Minimum y coord\n Math.min(...transformedCoords.map(i => i[1])),\n // Max x coord\n Math.max(...transformedCoords.map(i => i[0])),\n // Max y coord\n Math.max(...transformedCoords.map(i => i[1]))\n ];\n return transformedBox;\n}\nfunction stringHash(s) {\n return Math.abs(s.split('').reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0));\n}\nexport function getURLFromTemplate(template, tile) {\n if (!template || !template.length) {\n return null;\n }\n const { index, id } = tile;\n if (Array.isArray(template)) {\n const i = stringHash(id) % template.length;\n template = template[i];\n }\n let url = template;\n for (const key of Object.keys(index)) {\n const regex = new RegExp(`{${key}}`, 'g');\n url = url.replace(regex, String(index[key]));\n }\n // Back-compatible support for {-y}\n if (Number.isInteger(index.y) && Number.isInteger(index.z)) {\n url = url.replace(/\\{-y\\}/g, String(Math.pow(2, index.z) - index.y - 1));\n }\n return url;\n}\n/**\n * gets the bounding box of a viewport\n */\nfunction getBoundingBox(viewport, zRange, extent) {\n let bounds;\n if (zRange && zRange.length === 2) {\n const [minZ, maxZ] = zRange;\n const bounds0 = viewport.getBounds({ z: minZ });\n const bounds1 = viewport.getBounds({ z: maxZ });\n bounds = [\n Math.min(bounds0[0], bounds1[0]),\n Math.min(bounds0[1], bounds1[1]),\n Math.max(bounds0[2], bounds1[2]),\n Math.max(bounds0[3], bounds1[3])\n ];\n }\n else {\n bounds = viewport.getBounds();\n }\n if (!viewport.isGeospatial) {\n return [\n // Top corner should not be more then bottom corner in either direction\n Math.max(Math.min(bounds[0], extent[2]), extent[0]),\n Math.max(Math.min(bounds[1], extent[3]), extent[1]),\n // Bottom corner should not be less then top corner in either direction\n Math.min(Math.max(bounds[2], extent[0]), extent[2]),\n Math.min(Math.max(bounds[3], extent[1]), extent[3])\n ];\n }\n return [\n Math.max(bounds[0], extent[0]),\n Math.max(bounds[1], extent[1]),\n Math.min(bounds[2], extent[2]),\n Math.min(bounds[3], extent[3])\n ];\n}\n/** Get culling bounds in world space */\nexport function getCullBounds({ viewport, z, cullRect }) {\n const subViewports = viewport.subViewports || [viewport];\n return subViewports.map(v => getCullBoundsInViewport(v, z || 0, cullRect));\n}\nfunction getCullBoundsInViewport(\n/** Current viewport */\nviewport, \n/** At altitude */\nz, \n/** Culling rectangle in screen space */\ncullRect) {\n if (!Array.isArray(z)) {\n const x = cullRect.x - viewport.x;\n const y = cullRect.y - viewport.y;\n const { width, height } = cullRect;\n const unprojectOption = { targetZ: z };\n const topLeft = viewport.unproject([x, y], unprojectOption);\n const topRight = viewport.unproject([x + width, y], unprojectOption);\n const bottomLeft = viewport.unproject([x, y + height], unprojectOption);\n const bottomRight = viewport.unproject([x + width, y + height], unprojectOption);\n return [\n Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]),\n Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]),\n Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]),\n Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1])\n ];\n }\n const bounds0 = getCullBoundsInViewport(viewport, z[0], cullRect);\n const bounds1 = getCullBoundsInViewport(viewport, z[1], cullRect);\n return [\n Math.min(bounds0[0], bounds1[0]),\n Math.min(bounds0[1], bounds1[1]),\n Math.max(bounds0[2], bounds1[2]),\n Math.max(bounds0[3], bounds1[3])\n ];\n}\nfunction getIndexingCoords(bbox, scale, modelMatrixInverse) {\n if (modelMatrixInverse) {\n const transformedTileIndex = transformBox(bbox, modelMatrixInverse).map(i => (i * scale) / TILE_SIZE);\n return transformedTileIndex;\n }\n return bbox.map(i => (i * scale) / TILE_SIZE);\n}\nfunction getScale(z, tileSize) {\n return (Math.pow(2, z) * TILE_SIZE) / tileSize;\n}\n// https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Lon..2Flat._to_tile_numbers_2\nexport function osmTile2lngLat(x, y, z) {\n const scale = getScale(z, TILE_SIZE);\n const lng = (x / scale) * 360 - 180;\n const n = Math.PI - (2 * Math.PI * y) / scale;\n const lat = (180 / Math.PI) * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n return [lng, lat];\n}\nfunction tile2XY(x, y, z, tileSize) {\n const scale = getScale(z, tileSize);\n return [(x / scale) * TILE_SIZE, (y / scale) * TILE_SIZE];\n}\nexport function tileToBoundingBox(viewport, x, y, z, tileSize = TILE_SIZE) {\n if (viewport.isGeospatial) {\n const [west, north] = osmTile2lngLat(x, y, z);\n const [east, south] = osmTile2lngLat(x + 1, y + 1, z);\n return { west, north, east, south };\n }\n const [left, top] = tile2XY(x, y, z, tileSize);\n const [right, bottom] = tile2XY(x + 1, y + 1, z, tileSize);\n return { left, top, right, bottom };\n}\nfunction getIdentityTileIndices(viewport, z, tileSize, extent, modelMatrixInverse) {\n const bbox = getBoundingBox(viewport, null, extent);\n const scale = getScale(z, tileSize);\n const [minX, minY, maxX, maxY] = getIndexingCoords(bbox, scale, modelMatrixInverse);\n const indices = [];\n /*\n | TILE | TILE | TILE |\n |(minX) |(maxX)\n */\n for (let x = Math.floor(minX); x < maxX; x++) {\n for (let y = Math.floor(minY); y < maxY; y++) {\n indices.push({ x, y, z });\n }\n }\n return indices;\n}\n/**\n * Returns all tile indices in the current viewport. If the current zoom level is smaller\n * than minZoom, return an empty array. If the current zoom level is greater than maxZoom,\n * return tiles that are on maxZoom.\n */\n// eslint-disable-next-line complexity\nexport function getTileIndices({ viewport, maxZoom, minZoom, zRange, extent, tileSize = TILE_SIZE, modelMatrix, modelMatrixInverse, zoomOffset = 0 }) {\n let z = viewport.isGeospatial\n ? Math.round(viewport.zoom + Math.log2(TILE_SIZE / tileSize)) + zoomOffset\n : Math.ceil(viewport.zoom) + zoomOffset;\n if (typeof minZoom === 'number' && Number.isFinite(minZoom) && z < minZoom) {\n if (!extent) {\n return [];\n }\n z = minZoom;\n }\n if (typeof maxZoom === 'number' && Number.isFinite(maxZoom) && z > maxZoom) {\n z = maxZoom;\n }\n let transformedExtent = extent;\n if (modelMatrix && modelMatrixInverse && extent && !viewport.isGeospatial) {\n transformedExtent = transformBox(extent, modelMatrix);\n }\n return viewport.isGeospatial\n ? getOSMTileIndices(viewport, z, zRange, extent)\n : getIdentityTileIndices(viewport, z, tileSize, transformedExtent || DEFAULT_EXTENT, modelMatrixInverse);\n}\n/**\n * Returns true if s is a valid URL template\n */\nexport function isURLTemplate(s) {\n return /(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(s);\n}\nexport function isGeoBoundingBox(v) {\n return (Number.isFinite(v.west) &&\n Number.isFinite(v.north) &&\n Number.isFinite(v.east) &&\n Number.isFinite(v.south));\n}\n", "// deck.gl, MIT license\n// @note - this is a duplicate of the deck.gl core export (because Tileset2D should be deck.gl independent)\n/**\n * Speed up consecutive function calls by caching the result of calls with identical input\n * https://en.wikipedia.org/wiki/Memoization\n * @param compute - the function to be memoized\n */\nexport function memoize(compute) {\n let cachedArgs = {};\n let cachedResult;\n return (args) => {\n for (const key in args) {\n if (!isEqual(args[key], cachedArgs[key])) {\n cachedResult = compute(args);\n cachedArgs = args;\n break;\n }\n }\n return cachedResult;\n };\n}\nfunction isEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (Array.isArray(a)) {\n // Special treatment for arrays: compare 1-level deep\n // This is to support equality of matrix/coordinate props\n const len = a.length;\n if (!b || b.length !== len) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n", "// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport { PathLayer } from '@deck.gl/layers';\nconst defaultProps = {\n fadeTrail: true,\n trailLength: { type: 'number', value: 120, min: 0 },\n currentTime: { type: 'number', value: 0, min: 0 },\n getTimestamps: { type: 'accessor', value: (d) => d.timestamps }\n};\n/** Render animated paths that represent vehicle trips. */\nclass TripsLayer extends PathLayer {\n getShaders() {\n const shaders = super.getShaders();\n shaders.inject = {\n 'vs:#decl': `\\\nuniform float trailLength;\nin float instanceTimestamps;\nin float instanceNextTimestamps;\nout float vTime;\n`,\n // Timestamp of the vertex\n 'vs:#main-end': `\\\nvTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n`,\n 'fs:#decl': `\\\nuniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nin float vTime;\n`,\n // Drop the segments outside of the time window\n 'fs:#main-start': `\\\nif(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n`,\n // Fade the color (currentTime - 100%, end of trail - 0%)\n 'fs:DECKGL_FILTER_COLOR': `\\\nif(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n`\n };\n return shaders;\n }\n initializeState() {\n super.initializeState();\n const attributeManager = this.getAttributeManager();\n attributeManager.addInstanced({\n timestamps: {\n size: 1,\n accessor: 'getTimestamps',\n shaderAttributes: {\n instanceTimestamps: {\n vertexOffset: 0\n },\n instanceNextTimestamps: {\n vertexOffset: 1\n }\n }\n }\n });\n }\n draw(params) {\n const { fadeTrail, trailLength, currentTime } = this.props;\n params.uniforms = {\n ...params.uniforms,\n fadeTrail,\n trailLength,\n currentTime\n };\n super.draw(params);\n }\n}\nTripsLayer.layerName = 'TripsLayer';\nTripsLayer.defaultProps = defaultProps;\nexport default TripsLayer;\n", "import { cellsToMultiPolygon } from 'h3-js';\nimport { createIterable } from '@deck.gl/core';\nimport { default as H3HexagonLayer } from \"./h3-hexagon-layer.js\";\nimport GeoCellLayer from \"../geo-cell-layer/GeoCellLayer.js\";\nimport { normalizeLongitudes } from \"./h3-utils.js\";\nconst defaultProps = {\n getHexagons: { type: 'accessor', value: (d) => d.hexagons }\n};\nclass H3ClusterLayer extends GeoCellLayer {\n initializeState() {\n H3HexagonLayer._checkH3Lib();\n }\n updateState({ props, changeFlags }) {\n if (changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged && changeFlags.updateTriggersChanged.getHexagons)) {\n const { data, getHexagons } = props;\n const polygons = [];\n const { iterable, objectInfo } = createIterable(data);\n for (const object of iterable) {\n objectInfo.index++;\n const hexagons = getHexagons(object, objectInfo);\n const multiPolygon = cellsToMultiPolygon(hexagons, true);\n for (const polygon of multiPolygon) {\n // Normalize polygons to prevent wrapping over the anti-meridian\n for (const ring of polygon) {\n normalizeLongitudes(ring);\n }\n polygons.push(this.getSubLayerRow({ polygon }, object, objectInfo.index));\n }\n }\n this.setState({ polygons });\n }\n }\n indexToBounds() {\n const { getElevation, getFillColor, getLineColor, getLineWidth } = this.props;\n return {\n data: this.state.polygons,\n getPolygon: d => d.polygon,\n getElevation: this.getSubLayerAccessor(getElevation),\n getFillColor: this.getSubLayerAccessor(getFillColor),\n getLineColor: this.getSubLayerAccessor(getLineColor),\n getLineWidth: this.getSubLayerAccessor(getLineWidth)\n };\n }\n}\nH3ClusterLayer.layerName = 'H3ClusterLayer';\nH3ClusterLayer.defaultProps = defaultProps;\nexport default H3ClusterLayer;\n", "import { getResolution, cellToLatLng, latLngToCell, isPentagon, gridDistance, getHexagonEdgeLengthAvg } from 'h3-js';\nimport { CompositeLayer, createIterable } from '@deck.gl/core';\nimport { ColumnLayer, PolygonLayer } from '@deck.gl/layers';\nimport { flattenPolygon, getHexagonCentroid, h3ToPolygon } from \"./h3-utils.js\";\n// There is a cost to updating the instanced geometries when using highPrecision: false\n// This constant defines the distance between two hexagons that leads to \"significant\n// distortion.\" Smaller value makes the column layer more sensitive to viewport change.\nconst UPDATE_THRESHOLD_KM = 10;\nfunction mergeTriggers(getHexagon, coverage) {\n let trigger;\n if (getHexagon === undefined || getHexagon === null) {\n trigger = coverage;\n }\n else if (typeof getHexagon === 'object') {\n trigger = { ...getHexagon, coverage };\n }\n else {\n trigger = { getHexagon, coverage };\n }\n return trigger;\n}\nconst defaultProps = {\n ...PolygonLayer.defaultProps,\n highPrecision: 'auto',\n coverage: { type: 'number', min: 0, max: 1, value: 1 },\n centerHexagon: null,\n getHexagon: { type: 'accessor', value: (x) => x.hexagon },\n extruded: true\n};\n/**\n * Render hexagons from the [H3](https://h3geo.org/) geospatial indexing system.\n */\nclass H3HexagonLayer extends CompositeLayer {\n initializeState() {\n H3HexagonLayer._checkH3Lib();\n this.state = {\n edgeLengthKM: 0,\n resolution: -1\n };\n }\n shouldUpdateState({ changeFlags }) {\n return this._shouldUseHighPrecision()\n ? changeFlags.propsOrDataChanged\n : changeFlags.somethingChanged;\n }\n updateState({ props, changeFlags }) {\n if (props.highPrecision !== true &&\n (changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged && changeFlags.updateTriggersChanged.getHexagon))) {\n const dataProps = this._calculateH3DataProps();\n this.setState(dataProps);\n }\n this._updateVertices(this.context.viewport);\n }\n _calculateH3DataProps() {\n let resolution = -1;\n let hasPentagon = false;\n let hasMultipleRes = false;\n const { iterable, objectInfo } = createIterable(this.props.data);\n for (const object of iterable) {\n objectInfo.index++;\n const hexId = this.props.getHexagon(object, objectInfo);\n // Take the resolution of the first hex\n const hexResolution = getResolution(hexId);\n if (resolution < 0) {\n resolution = hexResolution;\n if (!this.props.highPrecision)\n break;\n }\n else if (resolution !== hexResolution) {\n hasMultipleRes = true;\n break;\n }\n if (isPentagon(hexId)) {\n hasPentagon = true;\n break;\n }\n }\n return {\n resolution,\n edgeLengthKM: resolution >= 0 ? getHexagonEdgeLengthAvg(resolution, 'km') : 0,\n hasMultipleRes,\n hasPentagon\n };\n }\n _shouldUseHighPrecision() {\n if (this.props.highPrecision === 'auto') {\n const { resolution, hasPentagon, hasMultipleRes } = this.state;\n const { viewport } = this.context;\n return (Boolean(viewport?.resolution) ||\n hasMultipleRes ||\n hasPentagon ||\n (resolution >= 0 && resolution <= 5));\n }\n return this.props.highPrecision;\n }\n _updateVertices(viewport) {\n if (this._shouldUseHighPrecision()) {\n return;\n }\n const { resolution, edgeLengthKM, centerHex } = this.state;\n if (resolution < 0) {\n return;\n }\n const hex = this.props.centerHexagon || latLngToCell(viewport.latitude, viewport.longitude, resolution);\n if (centerHex === hex) {\n return;\n }\n if (centerHex) {\n try {\n const distance = gridDistance(centerHex, hex);\n if (distance * edgeLengthKM < UPDATE_THRESHOLD_KM) {\n return;\n }\n }\n catch {\n // gridDistance throws if the distance could not be computed\n // due to the two indexes very far apart or on opposite sides of a pentagon.\n }\n }\n const { unitsPerMeter } = viewport.distanceScales;\n let vertices = h3ToPolygon(hex);\n const [centerLat, centerLng] = cellToLatLng(hex);\n const [centerX, centerY] = viewport.projectFlat([centerLng, centerLat]);\n vertices = vertices.map(p => {\n const worldPosition = viewport.projectFlat(p);\n return [\n (worldPosition[0] - centerX) / unitsPerMeter[0],\n (worldPosition[1] - centerY) / unitsPerMeter[1]\n ];\n });\n this.setState({ centerHex: hex, vertices });\n }\n renderLayers() {\n return this._shouldUseHighPrecision() ? this._renderPolygonLayer() : this._renderColumnLayer();\n }\n _getForwardProps() {\n const { elevationScale, material, coverage, extruded, wireframe, stroked, filled, lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels, getFillColor, getElevation, getLineColor, getLineWidth, transitions, updateTriggers } = this.props;\n return {\n elevationScale,\n extruded,\n coverage,\n wireframe,\n stroked,\n filled,\n lineWidthUnits,\n lineWidthScale,\n lineWidthMinPixels,\n lineWidthMaxPixels,\n material,\n getElevation,\n getFillColor,\n getLineColor,\n getLineWidth,\n transitions,\n updateTriggers: {\n getFillColor: updateTriggers.getFillColor,\n getElevation: updateTriggers.getElevation,\n getLineColor: updateTriggers.getLineColor,\n getLineWidth: updateTriggers.getLineWidth\n }\n };\n }\n _renderPolygonLayer() {\n const { data, getHexagon, updateTriggers, coverage } = this.props;\n const SubLayerClass = this.getSubLayerClass('hexagon-cell-hifi', PolygonLayer);\n const forwardProps = this._getForwardProps();\n forwardProps.updateTriggers.getPolygon = mergeTriggers(updateTriggers.getHexagon, coverage);\n return new SubLayerClass(forwardProps, this.getSubLayerProps({\n id: 'hexagon-cell-hifi',\n updateTriggers: forwardProps.updateTriggers\n }), {\n data,\n _normalize: false,\n _windingOrder: 'CCW',\n positionFormat: 'XY',\n getPolygon: (object, objectInfo) => {\n const hexagonId = getHexagon(object, objectInfo);\n return flattenPolygon(h3ToPolygon(hexagonId, coverage));\n }\n });\n }\n _renderColumnLayer() {\n const { data, getHexagon, updateTriggers } = this.props;\n const SubLayerClass = this.getSubLayerClass('hexagon-cell', ColumnLayer);\n const forwardProps = this._getForwardProps();\n forwardProps.updateTriggers.getPosition = updateTriggers.getHexagon;\n return new SubLayerClass(forwardProps, this.getSubLayerProps({\n id: 'hexagon-cell',\n flatShading: true,\n updateTriggers: forwardProps.updateTriggers\n }), {\n data,\n diskResolution: 6, // generate an extruded hexagon as the base geometry\n radius: 1,\n vertices: this.state.vertices,\n getPosition: getHexagonCentroid.bind(null, getHexagon)\n });\n }\n}\nH3HexagonLayer.defaultProps = defaultProps;\nH3HexagonLayer.layerName = 'H3HexagonLayer';\n// See `main/bundle.ts`\nH3HexagonLayer._checkH3Lib = () => { };\nexport default H3HexagonLayer;\n", "import { cellToBoundary, cellToLatLng } from 'h3-js';\nimport { lerp } from '@math.gl/core';\n// normalize longitudes w.r.t center (refLng), when not provided first vertex\nexport function normalizeLongitudes(vertices, refLng) {\n refLng = refLng === undefined ? vertices[0][0] : refLng;\n for (const pt of vertices) {\n const deltaLng = pt[0] - refLng;\n if (deltaLng > 180) {\n pt[0] -= 360;\n }\n else if (deltaLng < -180) {\n pt[0] += 360;\n }\n }\n}\n// scale polygon vertices w.r.t center (hexId)\nexport function scalePolygon(hexId, vertices, factor) {\n const [lat, lng] = cellToLatLng(hexId);\n const actualCount = vertices.length;\n // normalize with respect to center\n normalizeLongitudes(vertices, lng);\n // `cellToBoundary` returns same array object for first and last vertex (closed polygon),\n // if so skip scaling the last vertex\n const vertexCount = vertices[0] === vertices[actualCount - 1] ? actualCount - 1 : actualCount;\n for (let i = 0; i < vertexCount; i++) {\n vertices[i][0] = lerp(lng, vertices[i][0], factor);\n vertices[i][1] = lerp(lat, vertices[i][1], factor);\n }\n}\n// gets hexagon centroid\nexport function getHexagonCentroid(getHexagon, object, objectInfo) {\n const hexagonId = getHexagon(object, objectInfo);\n const [lat, lng] = cellToLatLng(hexagonId);\n return [lng, lat];\n}\nexport function h3ToPolygon(hexId, coverage = 1) {\n const vertices = cellToBoundary(hexId, true);\n if (coverage !== 1) {\n // scale and normalize vertices w.r.t to center\n scalePolygon(hexId, vertices, coverage);\n }\n else {\n // normalize w.r.t to start vertex\n normalizeLongitudes(vertices);\n }\n return vertices;\n}\nexport function flattenPolygon(vertices) {\n const positions = new Float64Array(vertices.length * 2);\n let i = 0;\n for (const pt of vertices) {\n positions[i++] = pt[0];\n positions[i++] = pt[1];\n }\n return positions;\n}\n", "import { Geometry } from '@luma.gl/engine';\nimport { CompositeLayer, COORDINATE_SYSTEM, log } from '@deck.gl/core';\nimport { PointCloudLayer } from '@deck.gl/layers';\nimport { ScenegraphLayer } from '@deck.gl/mesh-layers';\nimport { default as MeshLayer } from \"../mesh-layer/mesh-layer.js\";\nimport { load } from '@loaders.gl/core';\nimport { Tileset3D, TILE_TYPE } from '@loaders.gl/tiles';\nimport { Tiles3DLoader } from '@loaders.gl/3d-tiles';\nconst SINGLE_DATA = [0];\nconst defaultProps = {\n getPointColor: { type: 'accessor', value: [0, 0, 0, 255] },\n pointSize: 1.0,\n // Disable async data loading (handling it in _loadTileSet)\n data: '',\n loader: Tiles3DLoader,\n onTilesetLoad: { type: 'function', value: tileset3d => { } },\n onTileLoad: { type: 'function', value: tileHeader => { } },\n onTileUnload: { type: 'function', value: tileHeader => { } },\n onTileError: { type: 'function', value: (tile, message, url) => { } },\n _getMeshColor: { type: 'function', value: tileHeader => [255, 255, 255] }\n};\n/** Render 3d tiles data formatted according to the [3D Tiles Specification](https://www.opengeospatial.org/standards/3DTiles) and [`ESRI I3S`](https://github.com/Esri/i3s-spec) */\nclass Tile3DLayer extends CompositeLayer {\n initializeState() {\n if ('onTileLoadFail' in this.props) {\n log.removed('onTileLoadFail', 'onTileError')();\n }\n // prop verification\n this.state = {\n layerMap: {},\n tileset3d: null,\n activeViewports: {},\n lastUpdatedViewports: null\n };\n }\n get isLoaded() {\n return Boolean(this.state?.tileset3d?.isLoaded() && super.isLoaded);\n }\n shouldUpdateState({ changeFlags }) {\n return changeFlags.somethingChanged;\n }\n updateState({ props, oldProps, changeFlags }) {\n if (props.data && props.data !== oldProps.data) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._loadTileset(props.data);\n }\n if (changeFlags.viewportChanged) {\n const { activeViewports } = this.state;\n const viewportsNumber = Object.keys(activeViewports).length;\n if (viewportsNumber) {\n this._updateTileset(activeViewports);\n this.state.lastUpdatedViewports = activeViewports;\n this.state.activeViewports = {};\n }\n }\n if (changeFlags.propsChanged) {\n const { layerMap } = this.state;\n for (const key in layerMap) {\n layerMap[key].needsUpdate = true;\n }\n }\n }\n activateViewport(viewport) {\n const { activeViewports, lastUpdatedViewports } = this.state;\n this.internalState.viewport = viewport;\n activeViewports[viewport.id] = viewport;\n const lastViewport = lastUpdatedViewports?.[viewport.id];\n if (!lastViewport || !viewport.equals(lastViewport)) {\n this.setChangeFlags({ viewportChanged: true });\n this.setNeedsUpdate();\n }\n }\n getPickingInfo({ info, sourceLayer }) {\n const sourceTile = sourceLayer && sourceLayer.props.tile;\n if (info.picked) {\n info.object = sourceTile;\n }\n info.sourceTile = sourceTile;\n return info;\n }\n filterSubLayer({ layer, viewport }) {\n // All sublayers will have a tile prop\n const { tile } = layer.props;\n const { id: viewportId } = viewport;\n return tile.selected && tile.viewportIds.includes(viewportId);\n }\n _updateAutoHighlight(info) {\n const sourceTile = info.sourceTile;\n const layerCache = this.state.layerMap[sourceTile?.id];\n if (layerCache && layerCache.layer) {\n layerCache.layer.updateAutoHighlight(info);\n }\n }\n async _loadTileset(tilesetUrl) {\n const { loadOptions = {} } = this.props;\n // TODO: deprecate `loader` in v9.0\n // @ts-ignore\n const loaders = this.props.loader || this.props.loaders;\n const loader = Array.isArray(loaders) ? loaders[0] : loaders;\n const options = { loadOptions: { ...loadOptions } };\n let actualTilesetUrl = tilesetUrl;\n if (loader.preload) {\n const preloadOptions = await loader.preload(tilesetUrl, loadOptions);\n if (preloadOptions.url) {\n actualTilesetUrl = preloadOptions.url;\n }\n if (preloadOptions.headers) {\n options.loadOptions.fetch = {\n ...options.loadOptions.fetch,\n headers: preloadOptions.headers\n };\n }\n Object.assign(options, preloadOptions);\n }\n const tilesetJson = await load(actualTilesetUrl, loader, options.loadOptions);\n const tileset3d = new Tileset3D(tilesetJson, {\n onTileLoad: this._onTileLoad.bind(this),\n onTileUnload: this._onTileUnload.bind(this),\n onTileError: this.props.onTileError,\n ...options\n });\n this.setState({\n tileset3d,\n layerMap: {}\n });\n this._updateTileset(this.state.activeViewports);\n this.props.onTilesetLoad(tileset3d);\n }\n _onTileLoad(tileHeader) {\n const { lastUpdatedViewports } = this.state;\n this.props.onTileLoad(tileHeader);\n this._updateTileset(lastUpdatedViewports);\n this.setNeedsUpdate();\n }\n _onTileUnload(tileHeader) {\n // Was cleaned up from tileset cache. We no longer need to track it.\n delete this.state.layerMap[tileHeader.id];\n this.props.onTileUnload(tileHeader);\n }\n _updateTileset(viewports) {\n if (!viewports) {\n return;\n }\n const { tileset3d } = this.state;\n const { timeline } = this.context;\n const viewportsNumber = Object.keys(viewports).length;\n if (!timeline || !viewportsNumber || !tileset3d) {\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n tileset3d.selectTiles(Object.values(viewports)).then(frameNumber => {\n const tilesetChanged = this.state.frameNumber !== frameNumber;\n if (tilesetChanged) {\n this.setState({ frameNumber });\n }\n });\n }\n _getSubLayer(tileHeader, oldLayer) {\n if (!tileHeader.content) {\n return null;\n }\n switch (tileHeader.type) {\n case TILE_TYPE.POINTCLOUD:\n return this._makePointCloudLayer(tileHeader, oldLayer);\n case TILE_TYPE.SCENEGRAPH:\n return this._make3DModelLayer(tileHeader);\n case TILE_TYPE.MESH:\n return this._makeSimpleMeshLayer(tileHeader, oldLayer);\n default:\n throw new Error(`Tile3DLayer: Failed to render layer of type ${tileHeader.content.type}`);\n }\n }\n _makePointCloudLayer(tileHeader, oldLayer) {\n const { attributes, pointCount, constantRGBA, cartographicOrigin, modelMatrix } = tileHeader.content;\n const { positions, normals, colors } = attributes;\n if (!positions) {\n return null;\n }\n const data = (oldLayer && oldLayer.props.data) || {\n header: {\n vertexCount: pointCount\n },\n attributes: {\n POSITION: positions,\n NORMAL: normals,\n COLOR_0: colors\n }\n };\n const { pointSize, getPointColor } = this.props;\n const SubLayerClass = this.getSubLayerClass('pointcloud', PointCloudLayer);\n return new SubLayerClass({\n pointSize\n }, this.getSubLayerProps({\n id: 'pointcloud'\n }), {\n id: `${this.id}-pointcloud-${tileHeader.id}`,\n tile: tileHeader,\n data,\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,\n coordinateOrigin: cartographicOrigin,\n modelMatrix,\n getColor: constantRGBA || getPointColor,\n _offset: 0\n });\n }\n _make3DModelLayer(tileHeader) {\n const { gltf, instances, cartographicOrigin, modelMatrix } = tileHeader.content;\n const SubLayerClass = this.getSubLayerClass('scenegraph', ScenegraphLayer);\n return new SubLayerClass({\n _lighting: 'pbr'\n }, this.getSubLayerProps({\n id: 'scenegraph'\n }), {\n id: `${this.id}-scenegraph-${tileHeader.id}`,\n tile: tileHeader,\n data: instances || SINGLE_DATA,\n scenegraph: gltf,\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,\n coordinateOrigin: cartographicOrigin,\n modelMatrix,\n getTransformMatrix: instance => instance.modelMatrix,\n getPosition: [0, 0, 0],\n _offset: 0\n });\n }\n _makeSimpleMeshLayer(tileHeader, oldLayer) {\n const content = tileHeader.content;\n const { attributes, indices, modelMatrix, cartographicOrigin, coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS, material, featureIds } = content;\n const { _getMeshColor } = this.props;\n const geometry = (oldLayer && oldLayer.props.mesh) ||\n new Geometry({\n topology: 'triangle-list',\n attributes: getMeshGeometry(attributes),\n indices\n });\n const SubLayerClass = this.getSubLayerClass('mesh', MeshLayer);\n return new SubLayerClass(this.getSubLayerProps({\n id: 'mesh'\n }), {\n id: `${this.id}-mesh-${tileHeader.id}`,\n tile: tileHeader,\n mesh: geometry,\n data: SINGLE_DATA,\n getColor: _getMeshColor(tileHeader),\n pbrMaterial: material,\n modelMatrix,\n coordinateOrigin: cartographicOrigin,\n coordinateSystem,\n featureIds,\n _offset: 0\n });\n }\n renderLayers() {\n const { tileset3d, layerMap } = this.state;\n if (!tileset3d) {\n return null;\n }\n // loaders.gl doesn't provide a type for tileset3d.tiles\n return tileset3d.tiles\n .map(tile => {\n const layerCache = (layerMap[tile.id] = layerMap[tile.id] || { tile });\n let { layer } = layerCache;\n if (tile.selected) {\n // render selected tiles\n if (!layer) {\n // create layer\n layer = this._getSubLayer(tile);\n }\n else if (layerCache.needsUpdate) {\n // props have changed, rerender layer\n layer = this._getSubLayer(tile, layer);\n layerCache.needsUpdate = false;\n }\n }\n layerCache.layer = layer;\n return layer;\n })\n .filter(Boolean);\n }\n}\nTile3DLayer.defaultProps = defaultProps;\nTile3DLayer.layerName = 'Tile3DLayer';\nexport default Tile3DLayer;\nfunction getMeshGeometry(contentAttributes) {\n const attributes = {};\n attributes.positions = {\n ...contentAttributes.positions,\n value: new Float32Array(contentAttributes.positions.value)\n };\n if (contentAttributes.normals) {\n attributes.normals = contentAttributes.normals;\n }\n if (contentAttributes.texCoords) {\n attributes.texCoords = contentAttributes.texCoords;\n }\n if (contentAttributes.colors) {\n attributes.colors = contentAttributes.colors;\n }\n if (contentAttributes.uvRegions) {\n attributes.uvRegions = contentAttributes.uvRegions;\n }\n return attributes;\n}\n", "import { parsePBRMaterial } from '@luma.gl/gltf';\nimport { pbr } from '@luma.gl/shadertools';\nimport { Model } from '@luma.gl/engine';\nimport { SimpleMeshLayer } from '@deck.gl/mesh-layers';\nimport vs from \"./mesh-layer-vertex.glsl.js\";\nimport fs from \"./mesh-layer-fragment.glsl.js\";\nfunction validateGeometryAttributes(attributes) {\n const positionAttribute = attributes.positions || attributes.POSITION;\n const vertexCount = positionAttribute.value.length / positionAttribute.size;\n const hasColorAttribute = attributes.COLOR_0 || attributes.colors;\n if (!hasColorAttribute) {\n attributes.colors = {\n size: 4,\n value: new Uint8Array(vertexCount * 4).fill(255),\n normalized: true\n };\n }\n}\nconst defaultProps = {\n pbrMaterial: { type: 'object', value: null },\n featureIds: { type: 'array', value: null, optional: true }\n};\nclass MeshLayer extends SimpleMeshLayer {\n getShaders() {\n const shaders = super.getShaders();\n const modules = shaders.modules;\n modules.push(pbr);\n return { ...shaders, vs, fs };\n }\n initializeState() {\n const { featureIds } = this.props;\n super.initializeState();\n const attributeManager = this.getAttributeManager();\n if (featureIds) {\n // attributeManager is always defined in a primitive layer\n attributeManager.add({\n featureIdsPickingColors: {\n type: 'uint8',\n size: 3,\n noAlloc: true,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n update: this.calculateFeatureIdsPickingColors\n }\n });\n }\n }\n updateState(params) {\n super.updateState(params);\n const { props, oldProps } = params;\n if (props.pbrMaterial !== oldProps.pbrMaterial) {\n this.updatePbrMaterialUniforms(props.pbrMaterial);\n }\n }\n draw(opts) {\n const { featureIds } = this.props;\n if (!this.state.model) {\n return;\n }\n this.state.model.setUniforms({\n // Needed for PBR (TODO: find better way to get it)\n // eslint-disable-next-line camelcase\n u_Camera: this.state.model.uniforms.project_uCameraPosition,\n pickFeatureIds: Boolean(featureIds)\n });\n super.draw(opts);\n }\n getModel(mesh) {\n const { id, pbrMaterial } = this.props;\n const parsedPBRMaterial = this.parseMaterial(pbrMaterial, mesh);\n // Keep material to explicitly remove textures\n this.setState({ parsedPBRMaterial });\n const shaders = this.getShaders();\n validateGeometryAttributes(mesh.attributes);\n const model = new Model(this.context.device, {\n ...this.getShaders(),\n id,\n geometry: mesh,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n defines: {\n ...shaders.defines,\n ...parsedPBRMaterial?.defines,\n HAS_UV_REGIONS: mesh.attributes.uvRegions ? 1 : 0\n },\n parameters: parsedPBRMaterial?.parameters,\n isInstanced: true\n });\n return model;\n }\n updatePbrMaterialUniforms(pbrMaterial) {\n const { model } = this.state;\n if (model) {\n const { mesh } = this.props;\n const parsedPBRMaterial = this.parseMaterial(pbrMaterial, mesh);\n // Keep material to explicitly remove textures\n this.setState({ parsedPBRMaterial });\n model.setBindings(parsedPBRMaterial.bindings);\n model.setUniforms(parsedPBRMaterial.uniforms);\n }\n }\n parseMaterial(pbrMaterial, mesh) {\n const unlit = Boolean(pbrMaterial.pbrMetallicRoughness && pbrMaterial.pbrMetallicRoughness.baseColorTexture);\n return parsePBRMaterial(this.context.device, { unlit, ...pbrMaterial }, { NORMAL: mesh.attributes.normals, TEXCOORD_0: mesh.attributes.texCoords }, {\n pbrDebug: false,\n lights: true,\n useTangents: false\n });\n }\n calculateFeatureIdsPickingColors(attribute) {\n // This updater is only called if featureIds is not null\n const featureIds = this.props.featureIds;\n const value = new Uint8ClampedArray(featureIds.length * attribute.size);\n const pickingColor = [];\n for (let index = 0; index < featureIds.length; index++) {\n this.encodePickingColor(featureIds[index], pickingColor);\n value[index * 3] = pickingColor[0];\n value[index * 3 + 1] = pickingColor[1];\n value[index * 3 + 2] = pickingColor[2];\n }\n attribute.value = value;\n }\n finalizeState(context) {\n super.finalizeState(context);\n this.state.parsedPBRMaterial?.generatedTextures.forEach(texture => texture.destroy());\n this.setState({ parsedPBRMaterial: null });\n }\n}\nMeshLayer.layerName = 'MeshLayer';\nMeshLayer.defaultProps = defaultProps;\nexport default MeshLayer;\n", "export default `#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\nvec2 applyUVRegion(vec2 uv) {\n#ifdef HAS_UV_REGIONS\nreturn fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n#else\nreturn uv;\n#endif\n}\nvoid main(void) {\nvec2 uv = applyUVRegion(texCoords);\ngeometry.uv = uv;\nif (pickFeatureIds) {\ngeometry.pickingColor = featureIdsPickingColors;\n} else {\ngeometry.pickingColor = instancePickingColors;\n}\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvTexCoord = uv;\ncameraPosition = project_uCameraPosition;\nvColor = vec4(colors * instanceColors.rgb, instanceColors.a);\nvec3 pos = (instanceModelMatrix * positions) * sizeScale;\nvec3 projectedPosition = project_position(positions);\nposition_commonspace = vec4(projectedPosition, 1.0);\ngl_Position = project_common_position_to_clipspace(position_commonspace);\ngeometry.position = position_commonspace;\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\ngeometry.normal = normals_commonspace;\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n#ifdef MODULE_PBR\npbr_vPosition = geometry.position.xyz;\n#ifdef HAS_NORMALS\npbr_vNormal = geometry.normal;\n#endif\n#ifdef HAS_UV\npbr_vUV = uv;\n#else\npbr_vUV = vec2(0., 0.);\n#endif\ngeometry.uv = pbr_vUV;\n#endif\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;\n", "export default `#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\nprecision highp float;\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\n#ifdef MODULE_PBR\nfragColor = vColor * pbr_filterColor(vec4(0));\ngeometry.uv = pbr_vUV;\nfragColor.a *= opacity;\n#else\ngeometry.uv = vTexCoord;\nvec3 normal;\nif (flatShading) {\nnormal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n} else {\nnormal = normals_commonspace;\n}\nvec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\nvec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\nfragColor = vec4(lightColor, color.a * opacity);\n#endif\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n", "// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport { CompositeLayer, log } from '@deck.gl/core';\nimport { SimpleMeshLayer } from '@deck.gl/mesh-layers';\nimport { COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { TerrainWorkerLoader } from '@loaders.gl/terrain';\nimport TileLayer from \"../tile-layer/tile-layer.js\";\nimport { urlType, getURLFromTemplate } from \"../tileset-2d/index.js\";\nconst DUMMY_DATA = [1];\nconst defaultProps = {\n ...TileLayer.defaultProps,\n // Image url that encodes height data\n elevationData: urlType,\n // Image url to use as texture\n texture: { ...urlType, optional: true },\n // Martini error tolerance in meters, smaller number -> more detailed mesh\n meshMaxError: { type: 'number', value: 4.0 },\n // Bounding box of the terrain image, [minX, minY, maxX, maxY] in world coordinates\n bounds: { type: 'array', value: null, optional: true, compare: true },\n // Color to use if texture is unavailable\n color: { type: 'color', value: [255, 255, 255] },\n // Object to decode height data, from (r, g, b) to height in meters\n elevationDecoder: {\n type: 'object',\n value: {\n rScaler: 1,\n gScaler: 0,\n bScaler: 0,\n offset: 0\n }\n },\n // Supply url to local terrain worker bundle. Only required if running offline and cannot access CDN.\n workerUrl: '',\n // Same as SimpleMeshLayer wireframe\n wireframe: false,\n material: true,\n loaders: [TerrainWorkerLoader]\n};\n// Turns array of templates into a single string to work around shallow change\nfunction urlTemplateToUpdateTrigger(template) {\n if (Array.isArray(template)) {\n return template.join(';');\n }\n return template || '';\n}\n/** Render mesh surfaces from height map images. */\nclass TerrainLayer extends CompositeLayer {\n updateState({ props, oldProps }) {\n const elevationDataChanged = props.elevationData !== oldProps.elevationData;\n if (elevationDataChanged) {\n const { elevationData } = props;\n const isTiled = elevationData &&\n (Array.isArray(elevationData) ||\n (elevationData.includes('{x}') && elevationData.includes('{y}')));\n this.setState({ isTiled });\n }\n // Reloading for single terrain mesh\n const shouldReload = elevationDataChanged ||\n props.meshMaxError !== oldProps.meshMaxError ||\n props.elevationDecoder !== oldProps.elevationDecoder ||\n props.bounds !== oldProps.bounds;\n if (!this.state.isTiled && shouldReload) {\n // When state.isTiled, elevationData cannot be an array\n const terrain = this.loadTerrain(props);\n this.setState({ terrain });\n }\n // TODO - remove in v9\n // @ts-ignore\n if (props.workerUrl) {\n log.removed('workerUrl', 'loadOptions.terrain.workerUrl')();\n }\n }\n loadTerrain({ elevationData, bounds, elevationDecoder, meshMaxError, signal }) {\n if (!elevationData) {\n return null;\n }\n let loadOptions = this.getLoadOptions();\n loadOptions = {\n ...loadOptions,\n terrain: {\n skirtHeight: this.state.isTiled ? meshMaxError * 2 : 0,\n ...loadOptions?.terrain,\n bounds,\n meshMaxError,\n elevationDecoder\n }\n };\n const { fetch } = this.props;\n return fetch(elevationData, { propName: 'elevationData', layer: this, loadOptions, signal });\n }\n getTiledTerrainData(tile) {\n const { elevationData, fetch, texture, elevationDecoder, meshMaxError } = this.props;\n const { viewport } = this.context;\n const dataUrl = getURLFromTemplate(elevationData, tile);\n const textureUrl = texture && getURLFromTemplate(texture, tile);\n const { signal } = tile;\n let bottomLeft = [0, 0];\n let topRight = [0, 0];\n if (viewport.isGeospatial) {\n const bbox = tile.bbox;\n bottomLeft = viewport.projectFlat([bbox.west, bbox.south]);\n topRight = viewport.projectFlat([bbox.east, bbox.north]);\n }\n else {\n const bbox = tile.bbox;\n bottomLeft = [bbox.left, bbox.bottom];\n topRight = [bbox.right, bbox.top];\n }\n const bounds = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]];\n const terrain = this.loadTerrain({\n elevationData: dataUrl,\n bounds,\n elevationDecoder,\n meshMaxError,\n signal\n });\n const surface = textureUrl\n ? // If surface image fails to load, the tile should still be displayed\n fetch(textureUrl, { propName: 'texture', layer: this, loaders: [], signal }).catch(_ => null)\n : Promise.resolve(null);\n return Promise.all([terrain, surface]);\n }\n renderSubLayers(props) {\n const SubLayerClass = this.getSubLayerClass('mesh', SimpleMeshLayer);\n const { color, wireframe, material } = this.props;\n const { data } = props;\n if (!data) {\n return null;\n }\n const [mesh, texture] = data;\n return new SubLayerClass(props, {\n data: DUMMY_DATA,\n mesh,\n texture,\n _instanced: false,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n getPosition: d => [0, 0, 0],\n getColor: color,\n wireframe,\n material\n });\n }\n // Update zRange of viewport\n onViewportLoad(tiles) {\n if (!tiles) {\n return;\n }\n const { zRange } = this.state;\n const ranges = tiles\n .map(tile => tile.content)\n .filter(Boolean)\n .map(arr => {\n // @ts-ignore\n const bounds = arr[0].header.boundingBox;\n return bounds.map(bound => bound[2]);\n });\n if (ranges.length === 0) {\n return;\n }\n const minZ = Math.min(...ranges.map(x => x[0]));\n const maxZ = Math.max(...ranges.map(x => x[1]));\n if (!zRange || minZ < zRange[0] || maxZ > zRange[1]) {\n this.setState({ zRange: [minZ, maxZ] });\n }\n }\n renderLayers() {\n const { color, material, elevationData, texture, wireframe, meshMaxError, elevationDecoder, tileSize, maxZoom, minZoom, extent, maxRequests, onTileLoad, onTileUnload, onTileError, maxCacheSize, maxCacheByteSize, refinementStrategy } = this.props;\n if (this.state.isTiled) {\n return new TileLayer(this.getSubLayerProps({\n id: 'tiles'\n }), {\n getTileData: this.getTiledTerrainData.bind(this),\n renderSubLayers: this.renderSubLayers.bind(this),\n updateTriggers: {\n getTileData: {\n elevationData: urlTemplateToUpdateTrigger(elevationData),\n texture: urlTemplateToUpdateTrigger(texture),\n meshMaxError,\n elevationDecoder\n }\n },\n onViewportLoad: this.onViewportLoad.bind(this),\n zRange: this.state.zRange || null,\n tileSize,\n maxZoom,\n minZoom,\n extent,\n maxRequests,\n onTileLoad,\n onTileUnload,\n onTileError,\n maxCacheSize,\n maxCacheByteSize,\n refinementStrategy\n });\n }\n if (!elevationData) {\n return null;\n }\n const SubLayerClass = this.getSubLayerClass('mesh', SimpleMeshLayer);\n return new SubLayerClass(this.getSubLayerProps({\n id: 'mesh'\n }), {\n data: DUMMY_DATA,\n mesh: this.state.terrain,\n texture,\n _instanced: false,\n getPosition: d => [0, 0, 0],\n getColor: color,\n material,\n wireframe\n });\n }\n}\nTerrainLayer.defaultProps = defaultProps;\nTerrainLayer.layerName = 'TerrainLayer';\nexport default TerrainLayer;\n", "import { log, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { GeoJsonLayer } from '@deck.gl/layers';\nimport { ClipExtension } from '@deck.gl/extensions';\nimport { Matrix4 } from '@math.gl/core';\nimport { MVTWorkerLoader } from '@loaders.gl/mvt';\nimport { binaryToGeojson } from '@loaders.gl/gis';\nimport { transform } from \"./coordinate-transform.js\";\nimport findIndexBinary from \"./find-index-binary.js\";\nimport TileLayer from \"../tile-layer/tile-layer.js\";\nimport { urlType, getURLFromTemplate, isGeoBoundingBox, isURLTemplate } from \"../tileset-2d/index.js\";\nconst WORLD_SIZE = 512;\nconst defaultProps = {\n ...GeoJsonLayer.defaultProps,\n data: urlType,\n onDataLoad: { type: 'function', value: null, optional: true, compare: false },\n uniqueIdProperty: '',\n highlightedFeatureId: null,\n loaders: [MVTWorkerLoader],\n binary: true\n};\n/** Render data formatted as [Mapbox Vector Tiles](https://docs.mapbox.com/vector-tiles/specification/). */\nclass MVTLayer extends TileLayer {\n initializeState() {\n super.initializeState();\n // GlobeView doesn't work well with binary data\n const binary = this.context.viewport.resolution !== undefined ? false : this.props.binary;\n this.setState({\n binary,\n data: null,\n tileJSON: null,\n hoveredFeatureId: null,\n hoveredFeatureLayerName: null\n });\n }\n get isLoaded() {\n return Boolean(this.state?.data && super.isLoaded);\n }\n updateState({ props, oldProps, context, changeFlags }) {\n if (changeFlags.dataChanged) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._updateTileData();\n }\n if (this.state?.data) {\n super.updateState({ props, oldProps, context, changeFlags });\n this._setWGS84PropertyForTiles();\n }\n const { highlightColor } = props;\n if (highlightColor !== oldProps.highlightColor && Array.isArray(highlightColor)) {\n this.setState({ highlightColor });\n }\n }\n /* eslint-disable complexity */\n async _updateTileData() {\n let data = this.props.data;\n let tileJSON = null;\n if (typeof data === 'string' && !isURLTemplate(data)) {\n const { onDataLoad, fetch } = this.props;\n this.setState({ data: null, tileJSON: null });\n try {\n tileJSON = await fetch(data, { propName: 'data', layer: this, loaders: [] });\n }\n catch (error) {\n this.raiseError(error, 'loading TileJSON');\n data = null;\n }\n if (onDataLoad) {\n onDataLoad(tileJSON, { propName: 'data', layer: this });\n }\n }\n else if (data && typeof data === 'object' && 'tilejson' in data) {\n tileJSON = data;\n }\n if (tileJSON) {\n data = tileJSON.tiles;\n }\n this.setState({ data, tileJSON });\n }\n _getTilesetOptions() {\n const opts = super._getTilesetOptions();\n const tileJSON = this.state.tileJSON;\n const { minZoom, maxZoom } = this.props;\n if (tileJSON) {\n if (Number.isFinite(tileJSON.minzoom) && tileJSON.minzoom > minZoom) {\n opts.minZoom = tileJSON.minzoom;\n }\n if (Number.isFinite(tileJSON.maxzoom) &&\n (!Number.isFinite(maxZoom) || tileJSON.maxzoom < maxZoom)) {\n opts.maxZoom = tileJSON.maxzoom;\n }\n }\n return opts;\n }\n /* eslint-disable complexity */\n renderLayers() {\n if (!this.state?.data)\n return null;\n return super.renderLayers();\n }\n getTileData(loadProps) {\n const { data, binary } = this.state;\n const { index, signal } = loadProps;\n const url = getURLFromTemplate(data, loadProps);\n if (!url) {\n return Promise.reject('Invalid URL');\n }\n let loadOptions = this.getLoadOptions();\n const { fetch } = this.props;\n loadOptions = {\n ...loadOptions,\n mimeType: 'application/x-protobuf',\n mvt: {\n ...loadOptions?.mvt,\n coordinates: this.context.viewport.resolution ? 'wgs84' : 'local',\n tileIndex: index\n // Local worker debug\n // workerUrl: `modules/mvt/dist/mvt-loader.worker.js`\n // Set worker to null to skip web workers\n // workerUrl: null\n },\n gis: binary ? { format: 'binary' } : {}\n };\n return fetch(url, { propName: 'data', layer: this, loadOptions, signal });\n }\n renderSubLayers(props) {\n const { x, y, z } = props.tile.index;\n const worldScale = Math.pow(2, z);\n const xScale = WORLD_SIZE / worldScale;\n const yScale = -xScale;\n const xOffset = (WORLD_SIZE * x) / worldScale;\n const yOffset = WORLD_SIZE * (1 - y / worldScale);\n const modelMatrix = new Matrix4().scale([xScale, yScale, 1]);\n props.autoHighlight = false;\n if (!this.context.viewport.resolution) {\n props.modelMatrix = modelMatrix;\n props.coordinateOrigin = [xOffset, yOffset, 0];\n props.coordinateSystem = COORDINATE_SYSTEM.CARTESIAN;\n props.extensions = [...(props.extensions || []), new ClipExtension()];\n }\n const subLayers = super.renderSubLayers(props);\n if (this.state.binary && !(subLayers instanceof GeoJsonLayer)) {\n log.warn('renderSubLayers() must return GeoJsonLayer when using binary:true')();\n }\n return subLayers;\n }\n _updateAutoHighlight(info) {\n const { uniqueIdProperty } = this.props;\n const { hoveredFeatureId, hoveredFeatureLayerName } = this.state;\n const hoveredFeature = info.object;\n let newHoveredFeatureId = null;\n let newHoveredFeatureLayerName = null;\n if (hoveredFeature) {\n newHoveredFeatureId = getFeatureUniqueId(hoveredFeature, uniqueIdProperty);\n newHoveredFeatureLayerName = getFeatureLayerName(hoveredFeature);\n }\n let { highlightColor } = this.props;\n if (typeof highlightColor === 'function') {\n highlightColor = highlightColor(info);\n }\n if (hoveredFeatureId !== newHoveredFeatureId ||\n hoveredFeatureLayerName !== newHoveredFeatureLayerName) {\n this.setState({\n highlightColor,\n hoveredFeatureId: newHoveredFeatureId,\n hoveredFeatureLayerName: newHoveredFeatureLayerName\n });\n }\n }\n _isWGS84() {\n return Boolean(this.context.viewport.resolution);\n }\n getPickingInfo(params) {\n const info = super.getPickingInfo(params);\n if (this.state.binary && info.index !== -1) {\n const { data } = params.sourceLayer.props;\n info.object = binaryToGeojson(data, {\n globalFeatureId: info.index\n });\n }\n if (info.object && !this._isWGS84()) {\n info.object = transformTileCoordsToWGS84(info.object, info.tile.bbox, // eslint-disable-line\n this.context.viewport);\n }\n return info;\n }\n getSubLayerPropsByTile(tile) {\n return {\n highlightedObjectIndex: this.getHighlightedObjectIndex(tile),\n highlightColor: this.state.highlightColor\n };\n }\n getHighlightedObjectIndex(tile) {\n const { hoveredFeatureId, hoveredFeatureLayerName, binary } = this.state;\n const { uniqueIdProperty, highlightedFeatureId } = this.props;\n const data = tile.content;\n const isHighlighted = isFeatureIdDefined(highlightedFeatureId);\n const isFeatureIdPresent = isFeatureIdDefined(hoveredFeatureId) || isHighlighted;\n if (!isFeatureIdPresent) {\n return -1;\n }\n const featureIdToHighlight = isHighlighted ? highlightedFeatureId : hoveredFeatureId;\n // Iterable data\n if (Array.isArray(data)) {\n return data.findIndex(feature => {\n const isMatchingId = getFeatureUniqueId(feature, uniqueIdProperty) === featureIdToHighlight;\n const isMatchingLayer = isHighlighted || getFeatureLayerName(feature) === hoveredFeatureLayerName;\n return isMatchingId && isMatchingLayer;\n });\n // Non-iterable data\n }\n else if (data && binary) {\n // Get the feature index of the selected item to highlight\n return findIndexBinary(data, uniqueIdProperty, featureIdToHighlight, isHighlighted ? '' : hoveredFeatureLayerName);\n }\n return -1;\n }\n _pickObjects(maxObjects) {\n const { deck, viewport } = this.context;\n const width = viewport.width;\n const height = viewport.height;\n const x = viewport.x;\n const y = viewport.y;\n const layerIds = [this.id];\n return deck.pickObjects({ x, y, width, height, layerIds, maxObjects });\n }\n /** Get the rendered features in the current viewport. */\n getRenderedFeatures(maxFeatures = null) {\n const features = this._pickObjects(maxFeatures);\n const featureCache = new Set();\n const renderedFeatures = [];\n for (const f of features) {\n const featureId = getFeatureUniqueId(f.object, this.props.uniqueIdProperty);\n if (featureId === undefined) {\n // we have no id for the feature, we just add to the list\n renderedFeatures.push(f.object);\n }\n else if (!featureCache.has(featureId)) {\n // Add removing duplicates\n featureCache.add(featureId);\n renderedFeatures.push(f.object);\n }\n }\n return renderedFeatures;\n }\n _setWGS84PropertyForTiles() {\n const propName = 'dataInWGS84';\n const tileset = this.state.tileset;\n // @ts-expect-error selectedTiles are always initialized when tile is being processed\n tileset.selectedTiles.forEach((tile) => {\n if (!tile.hasOwnProperty(propName)) {\n // eslint-disable-next-line accessor-pairs\n Object.defineProperty(tile, propName, {\n get: () => {\n // Still loading or encountered an error\n if (!tile.content) {\n return null;\n }\n if (this.state.binary && Array.isArray(tile.content) && !tile.content.length) {\n // TODO: @loaders.gl/mvt returns [] when no content. It should return a valid empty binary.\n // https://github.com/visgl/loaders.gl/pull/1137\n return [];\n }\n const { bbox } = tile;\n if (tile._contentWGS84 === undefined && isGeoBoundingBox(bbox)) {\n // Create a cache to transform only once\n const content = this.state.binary ? binaryToGeojson(tile.content) : tile.content;\n tile._contentWGS84 = content.map(feature => transformTileCoordsToWGS84(feature, bbox, this.context.viewport));\n }\n return tile._contentWGS84;\n }\n });\n }\n });\n }\n}\nMVTLayer.layerName = 'MVTLayer';\nMVTLayer.defaultProps = defaultProps;\nexport default MVTLayer;\nfunction getFeatureUniqueId(feature, uniqueIdProperty) {\n if (feature.properties && uniqueIdProperty) {\n return feature.properties[uniqueIdProperty];\n }\n if ('id' in feature) {\n return feature.id;\n }\n return undefined;\n}\nfunction getFeatureLayerName(feature) {\n return feature.properties?.layerName || null;\n}\nfunction isFeatureIdDefined(value) {\n return value !== undefined && value !== null && value !== '';\n}\nfunction transformTileCoordsToWGS84(object, bbox, viewport) {\n const feature = {\n ...object,\n geometry: {\n type: object.geometry.type\n }\n };\n // eslint-disable-next-line accessor-pairs\n Object.defineProperty(feature.geometry, 'coordinates', {\n get: () => {\n const wgs84Geom = transform(object.geometry, bbox, viewport);\n return wgs84Geom.coordinates;\n }\n });\n return feature;\n}\n", "import { lerp } from '@math.gl/core';\nconst availableTransformations = {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon\n};\nfunction Point([pointX, pointY], [nw, se], viewport) {\n const x = lerp(nw[0], se[0], pointX);\n const y = lerp(nw[1], se[1], pointY);\n return viewport.unprojectFlat([x, y]);\n}\nfunction getPoints(geometry, bbox, viewport) {\n return geometry.map(g => Point(g, bbox, viewport));\n}\nfunction MultiPoint(multiPoint, bbox, viewport) {\n return getPoints(multiPoint, bbox, viewport);\n}\nfunction LineString(line, bbox, viewport) {\n return getPoints(line, bbox, viewport);\n}\nfunction MultiLineString(multiLineString, bbox, viewport) {\n return multiLineString.map(lineString => LineString(lineString, bbox, viewport));\n}\nfunction Polygon(polygon, bbox, viewport) {\n return polygon.map(polygonRing => getPoints(polygonRing, bbox, viewport));\n}\nfunction MultiPolygon(multiPolygon, bbox, viewport) {\n return multiPolygon.map(polygon => Polygon(polygon, bbox, viewport));\n}\nexport function transform(geometry, bbox, viewport) {\n const nw = viewport.projectFlat([bbox.west, bbox.north]);\n const se = viewport.projectFlat([bbox.east, bbox.south]);\n const projectedBbox = [nw, se];\n return {\n ...geometry,\n coordinates: availableTransformations[geometry.type](geometry.coordinates, projectedBbox, viewport)\n };\n}\n", "const GEOM_TYPES = ['points', 'lines', 'polygons'];\n/**\n * Return the index of feature (numericProps or featureIds) for given feature id\n * Example: findIndexBinary(data, 'id', 33) will return the index in the array of numericProps\n * of the feature 33.\n */\nexport default function findIndexBinary(data, // The data in binary format\nuniqueIdProperty, // Name of the unique id property\nfeatureId, // feature id to find\nlayerName // the layer to search in\n) {\n for (const gt of GEOM_TYPES) {\n const index = data[gt] && findIndexByType(data[gt], uniqueIdProperty, featureId, layerName);\n if (index >= 0) {\n return index;\n }\n }\n return -1;\n}\nfunction findIndexByType(geomData, uniqueIdProperty, featureId, layerName) {\n const featureIds = geomData.featureIds.value;\n if (!featureIds.length) {\n return -1;\n }\n let startFeatureIndex = 0;\n let endFeatureIndex = featureIds[featureIds.length - 1] + 1;\n if (layerName) {\n const layerRange = getLayerRange(geomData, layerName);\n if (layerRange) {\n startFeatureIndex = layerRange[0];\n endFeatureIndex = layerRange[1] + 1;\n }\n else {\n return -1;\n }\n }\n // Look for the uniqueIdProperty\n let featureIndex = -1;\n if (uniqueIdProperty in geomData.numericProps) {\n const vertexIndex = geomData.numericProps[uniqueIdProperty].value.findIndex((x, i) => x === featureId && featureIds[i] >= startFeatureIndex && featureIds[i] < endFeatureIndex);\n return vertexIndex >= 0 ? geomData.globalFeatureIds.value[vertexIndex] : -1;\n }\n else if (uniqueIdProperty) {\n featureIndex = findIndex(geomData.properties, elem => elem[uniqueIdProperty] === featureId, startFeatureIndex, endFeatureIndex);\n }\n else if (geomData.fields) {\n featureIndex = findIndex(geomData.fields, (elem) => elem.id === featureId, startFeatureIndex, endFeatureIndex);\n }\n return featureIndex >= 0 ? getGlobalFeatureId(geomData, featureIndex) : -1;\n}\n// Returns [firstFeatureIndex, lastFeatureIndex]\n// MVTLoader parses tiles layer-by-layer, so each layer is a continuous range\nfunction getLayerRange(geomData, layerName) {\n if (!geomData.__layers) {\n // Cache a map from properties.layerName to index ranges\n const layerNames = {};\n const { properties } = geomData;\n for (let i = 0; i < properties.length; i++) {\n const { layerName: key } = properties[i];\n if (!key) {\n // ignore\n }\n else if (layerNames[key]) {\n layerNames[key][1] = i;\n }\n else {\n layerNames[key] = [i, i];\n }\n }\n geomData.__layers = layerNames;\n }\n return geomData.__layers[layerName];\n}\n// Returns global feature id\nfunction getGlobalFeatureId(geomData, featureIndex) {\n if (!geomData.__ids) {\n // Cache a map from featureId to globalFeatureId\n const result = [];\n const featureIds = geomData.featureIds.value;\n const globalFeatureIds = geomData.globalFeatureIds.value;\n for (let i = 0; i < featureIds.length; i++) {\n result[featureIds[i]] = globalFeatureIds[i];\n }\n geomData.__ids = result;\n }\n return geomData.__ids[featureIndex];\n}\n// Like array.findIndex, but only search within a range\nfunction findIndex(array, predicate, startIndex, endIndex) {\n for (let i = startIndex; i < endIndex; i++) {\n if (predicate(array[i], i)) {\n return i;\n }\n }\n return -1;\n}\n", "const BASE32_CODES = '0123456789bcdefghjkmnpqrstuvwxyz';\nconst BASE32_CODES_DICT = {};\nfor (let i = 0; i < BASE32_CODES.length; i++) {\n BASE32_CODES_DICT[BASE32_CODES.charAt(i)] = i;\n}\nconst MIN_LAT = -90;\nconst MAX_LAT = 90;\nconst MIN_LON = -180;\nconst MAX_LON = 180;\n// Adapted from ngeohash decode_bbox\nexport function getGeohashBounds(geohash) {\n let isLon = true;\n let maxLat = MAX_LAT;\n let minLat = MIN_LAT;\n let maxLon = MAX_LON;\n let minLon = MIN_LON;\n let mid;\n let hashValue = 0;\n for (let i = 0, l = geohash.length; i < l; i++) {\n const code = geohash[i].toLowerCase();\n hashValue = BASE32_CODES_DICT[code];\n for (let bits = 4; bits >= 0; bits--) {\n const bit = (hashValue >> bits) & 1;\n if (isLon) {\n mid = (maxLon + minLon) / 2;\n if (bit === 1) {\n minLon = mid;\n }\n else {\n maxLon = mid;\n }\n }\n else {\n mid = (maxLat + minLat) / 2;\n if (bit === 1) {\n minLat = mid;\n }\n else {\n maxLat = mid;\n }\n }\n isLon = !isLon;\n }\n }\n return [minLat, minLon, maxLat, maxLon];\n}\nexport function getGeohashPolygon(geohash) {\n const [s, w, n, e] = getGeohashBounds(geohash);\n return [e, n, e, s, w, s, w, n, e, n];\n}\n", "import GeoCellLayer from \"../geo-cell-layer/GeoCellLayer.js\";\nimport { getGeohashPolygon } from \"./geohash-utils.js\";\nconst defaultProps = {\n getGeohash: { type: 'accessor', value: (d) => d.geohash }\n};\n/** Render filled and/or stroked polygons based on the [Geohash](https://en.wikipedia.org/wiki/Geohash) geospatial indexing system. */\nclass GeohashLayer extends GeoCellLayer {\n indexToBounds() {\n const { data, getGeohash } = this.props;\n return {\n data,\n _normalize: false,\n positionFormat: 'XY',\n getPolygon: (x, objectInfo) => getGeohashPolygon(getGeohash(x, objectInfo))\n };\n }\n}\nGeohashLayer.layerName = 'GeohashLayer';\nGeohashLayer.defaultProps = defaultProps;\nexport default GeohashLayer;\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,kBAA2E;AAC3E,oBAA4B;AAC5B,iBAA+C;;;ACP/C,0BAA8B;AAG9B,IAAM,2BAA2B,UAAU,KAAK;AAIzC,SAAS,sBAAsB,OAAO;AACzC,QAAM,eAAW,mCAAc,KAAK;AACpC,WAAS,MAAM,SAAS,KAAK,MAAM,KAAK;AACxC,WAAS,MAAM,SAAS,KAAK,MAAM,KAAK;AACxC,SAAO;AACX;;;ADHA,IAAM,eAAe;AAAA,EACjB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,KAAK;AAAA,EACL,QAAQ,EAAE,MAAM,SAAS,SAAS,MAAM,OAAO,CAAC,EAAE;AAAA,EAClD,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MAAO,aAAa,OAAQ;AAClC,UAAI,OAAO;AACP,eAAO,SAAS,UAAU;AAC1B,YAAI,QAAQ,GAAG;AACX,mBAAS;AAAA,QACb,OACK;AACD,mBAAS;AAAA,QACb;AAAA,MACJ,OACK;AACD,eAAO,SAAS,UAAU;AAC1B,YAAI,QAAQ,GAAG;AACX,mBAAS;AAAA,QACb,OACK;AACD,mBAAS;AAAA,QACb;AAAA,MACJ;AACA,cAAQ,CAAC;AAAA,IACb;AAAA,EACJ;AACA,SAAO,CAAC,QAAQ,QAAQ,QAAQ,MAAM;AAC1C;AACO,SAAS,kBAAkB,SAAS;AACvC,QAAM,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,iBAAiB,OAAO;AAC7C,SAAO,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACxC;;;AC/CA,IAAMC,iBAAe;AAAA,EACjB,YAAY,EAAE,MAAM,YAAY,OAAO,CAAC,MAAM,EAAE,QAAQ;AAC5D;AAEA,IAAM,eAAN,cAA2B,qBAAa;AAAA,EACpC,gBAAgB;AACZ,UAAM,EAAE,MAAM,WAAW,IAAI,KAAK;AAClC,WAAO;AAAA,MACH;AAAA,MACA,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,YAAY,CAAC,GAAG,eAAe,kBAAkB,WAAW,GAAG,UAAU,CAAC;AAAA,IAC9E;AAAA,EACJ;AACJ;AACA,aAAa,YAAY;AACzB,aAAa,eAAeA;AAC5B,IAAO,wBAAQ;", "names": ["deepEqual", "import_layers", "defaultProps", "import_core", "import_layers", "defaultProps", "Long", "import_long", "Long", "defaultProps", "import_web_mercator", "defaultProps", "import_core", "import_layers", "import_core", "import_core", "import_web_mercator", "TILE_SIZE", "TILE_SIZE", "defaultProps", "flatten", "import_layers", "defaultProps", "import_h3_js", "import_core", "import_h3_js", "import_core", "import_layers", "import_core", "defaultProps", "defaultProps", "import_engine", "import_core", "import_layers", "import_mesh_layers", "defaultProps", "import_core", "defaultProps", "import_core", "import_mesh_layers", "defaultProps", "import_core", "import_layers", "import_core", "defaultProps", "defaultProps"] }