{ "version": 3, "sources": ["index.js", "arc-layer/arc-layer.js", "arc-layer/arc-layer-vertex.glsl.js", "arc-layer/arc-layer-fragment.glsl.js", "bitmap-layer/bitmap-layer.js", "bitmap-layer/create-mesh.js", "bitmap-layer/bitmap-layer-vertex.js", "bitmap-layer/bitmap-layer-fragment.js", "icon-layer/icon-layer.js", "icon-layer/icon-layer-vertex.glsl.js", "icon-layer/icon-layer-fragment.glsl.js", "icon-layer/icon-manager.js", "line-layer/line-layer.js", "line-layer/line-layer-vertex.glsl.js", "line-layer/line-layer-fragment.glsl.js", "point-cloud-layer/point-cloud-layer.js", "point-cloud-layer/point-cloud-layer-vertex.glsl.js", "point-cloud-layer/point-cloud-layer-fragment.glsl.js", "scatterplot-layer/scatterplot-layer.js", "scatterplot-layer/scatterplot-layer-vertex.glsl.js", "scatterplot-layer/scatterplot-layer-fragment.glsl.js", "column-layer/column-layer.js", "column-layer/column-geometry.js", "column-layer/column-layer-vertex.glsl.js", "column-layer/column-layer-fragment.glsl.js", "column-layer/grid-cell-layer.js", "path-layer/path-layer.js", "path-layer/path-tesselator.js", "path-layer/path.js", "path-layer/path-layer-vertex.glsl.js", "path-layer/path-layer-fragment.glsl.js", "polygon-layer/polygon-layer.js", "solid-polygon-layer/solid-polygon-layer.js", "solid-polygon-layer/polygon.js", "solid-polygon-layer/polygon-tesselator.js", "solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.js", "solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.js", "solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.js", "solid-polygon-layer/solid-polygon-layer-fragment.glsl.js", "utils.js", "geojson-layer/geojson-layer.js", "geojson-layer/geojson-binary.js", "text-layer/text-layer.js", "text-layer/multi-icon-layer/multi-icon-layer.js", "text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.js", "text-layer/font-atlas-manager.js", "text-layer/utils.js", "text-layer/lru-cache.js", "text-layer/text-background-layer/text-background-layer.js", "text-layer/text-background-layer/text-background-layer-vertex.glsl.js", "text-layer/text-background-layer/text-background-layer-fragment.glsl.js", "geojson-layer/sub-layer-map.js", "geojson-layer/geojson.js", "geojson-layer/geojson-layer-props.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 */\n// Core Layers\nexport { default as ArcLayer } from \"./arc-layer/arc-layer.js\";\nexport { default as BitmapLayer } from \"./bitmap-layer/bitmap-layer.js\";\nexport { default as IconLayer } from \"./icon-layer/icon-layer.js\";\nexport { default as LineLayer } from \"./line-layer/line-layer.js\";\nexport { default as PointCloudLayer } from \"./point-cloud-layer/point-cloud-layer.js\";\nexport { default as ScatterplotLayer } from \"./scatterplot-layer/scatterplot-layer.js\";\nexport { default as ColumnLayer } from \"./column-layer/column-layer.js\";\nexport { default as GridCellLayer } from \"./column-layer/grid-cell-layer.js\";\nexport { default as PathLayer } from \"./path-layer/path-layer.js\";\nexport { default as PolygonLayer } from \"./polygon-layer/polygon-layer.js\";\nexport { default as GeoJsonLayer } from \"./geojson-layer/geojson-layer.js\";\nexport { default as TextLayer } from \"./text-layer/text-layer.js\";\nexport { default as SolidPolygonLayer } from \"./solid-polygon-layer/solid-polygon-layer.js\";\n// Experimental layer exports\nexport { default as _MultiIconLayer } from \"./text-layer/multi-icon-layer/multi-icon-layer.js\";\nexport { default as _TextBackgroundLayer } from \"./text-layer/text-background-layer/text-background-layer.js\";\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 { Layer, project32, picking, UNIT } from '@deck.gl/core';\nimport { Geometry } from '@luma.gl/engine';\nimport { Model } from '@luma.gl/engine';\nimport vs from \"./arc-layer-vertex.glsl.js\";\nimport fs from \"./arc-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n getSourcePosition: { type: 'accessor', value: (x) => x.sourcePosition },\n getTargetPosition: { type: 'accessor', value: (x) => x.targetPosition },\n getSourceColor: { type: 'accessor', value: DEFAULT_COLOR },\n getTargetColor: { type: 'accessor', value: DEFAULT_COLOR },\n getWidth: { type: 'accessor', value: 1 },\n getHeight: { type: 'accessor', value: 1 },\n getTilt: { type: 'accessor', value: 0 },\n greatCircle: false,\n numSegments: { type: 'number', value: 50, min: 1 },\n widthUnits: 'pixels',\n widthScale: { type: 'number', value: 1, min: 0 },\n widthMinPixels: { type: 'number', value: 0, min: 0 },\n widthMaxPixels: { type: 'number', value: Number.MAX_SAFE_INTEGER, min: 0 }\n};\n/** Render raised arcs joining pairs of source and target coordinates. */\nclass ArcLayer extends Layer {\n getBounds() {\n return this.getAttributeManager()?.getBounds([\n 'instanceSourcePositions',\n 'instanceTargetPositions'\n ]);\n }\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, picking] }); // 'project' module added by default.\n }\n // This layer has its own wrapLongitude logic\n get wrapLongitude() {\n return false;\n }\n initializeState() {\n const attributeManager = this.getAttributeManager();\n /* eslint-disable max-len */\n attributeManager.addInstanced({\n instanceSourcePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getSourcePosition'\n },\n instanceTargetPositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getTargetPosition'\n },\n instanceSourceColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getSourceColor',\n defaultValue: DEFAULT_COLOR\n },\n instanceTargetColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getTargetColor',\n defaultValue: DEFAULT_COLOR\n },\n instanceWidths: {\n size: 1,\n transition: true,\n accessor: 'getWidth',\n defaultValue: 1\n },\n instanceHeights: {\n size: 1,\n transition: true,\n accessor: 'getHeight',\n defaultValue: 1\n },\n instanceTilts: {\n size: 1,\n transition: true,\n accessor: 'getTilt',\n defaultValue: 0\n }\n });\n /* eslint-enable max-len */\n }\n updateState(opts) {\n super.updateState(opts);\n const { props, oldProps, changeFlags } = opts;\n // Re-generate model if geometry changed\n if (changeFlags.extensionsChanged || props.numSegments !== oldProps.numSegments) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n this.getAttributeManager().invalidateAll();\n }\n }\n draw({ uniforms }) {\n const { widthUnits, widthScale, widthMinPixels, widthMaxPixels, greatCircle, wrapLongitude } = this.props;\n const model = this.state.model;\n model.setUniforms(uniforms);\n model.setUniforms({\n greatCircle,\n widthUnits: UNIT[widthUnits],\n widthScale,\n widthMinPixels,\n widthMaxPixels,\n useShortestPath: wrapLongitude\n });\n model.draw(this.context.renderPass);\n }\n _getModel() {\n const { numSegments } = this.props;\n let positions = [];\n /*\n * (0, -1)-------------_(1, -1)\n * | _,-\" |\n * o _,-\" o\n * | _,-\" |\n * (0, 1)\"-------------(1, 1)\n */\n for (let i = 0; i < numSegments; i++) {\n positions = positions.concat([i, 1, 0, i, -1, 0]);\n }\n const model = new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-strip',\n attributes: {\n positions: { size: 3, value: new Float32Array(positions) }\n }\n }),\n isInstanced: true\n });\n model.setUniforms({ numSegments });\n return model;\n }\n}\nArcLayer.layerName = 'ArcLayer';\nArcLayer.defaultProps = defaultProps;\nexport default ArcLayer;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME arc-layer-vertex-shader\nin vec3 positions;\nin vec4 instanceSourceColors;\nin vec4 instanceTargetColors;\nin vec3 instanceSourcePositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions;\nin vec3 instanceTargetPositions64Low;\nin vec3 instancePickingColors;\nin float instanceWidths;\nin float instanceHeights;\nin float instanceTilts;\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int widthUnits;\nout vec4 vColor;\nout vec2 uv;\nout float isValid;\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\nfloat deltaZ = targetZ - sourceZ;\nfloat dh = distance * instanceHeights;\nif (dh == 0.0) {\nreturn sourceZ + deltaZ * ratio;\n}\nfloat unitZ = deltaZ / dh;\nfloat p2 = unitZ * unitZ + 1.0;\nfloat dir = step(deltaZ, 0.0);\nfloat z0 = mix(sourceZ, targetZ, dir);\nfloat r = mix(ratio, 1.0 - ratio, dir);\nreturn sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\nfloat distance = length(source.xy - target.xy);\nfloat z = paraboloid(distance, source.z, target.z, segmentRatio);\nfloat tiltAngle = radians(instanceTilts);\nvec2 tiltDirection = normalize(target.xy - source.xy);\nvec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\nreturn vec3(\nmix(source.xy, target.xy, segmentRatio) + tilt,\nz * cos(tiltAngle)\n);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\nvec2 sourceRadians = radians(source);\nvec2 targetRadians = radians(target);\nvec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\nvec2 shd_sq = sin_half_delta * sin_half_delta;\nfloat a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\nreturn 2.0 * asin(sqrt(a));\n}\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\nvec2 lngLat;\nif(abs(angularDist - PI) < 0.001) {\nlngLat = (1.0 - t) * source.xy + t * target.xy;\n} else {\nfloat a = sin((1.0 - t) * angularDist);\nfloat b = sin(t * angularDist);\nvec3 p = source3D.yxz * a + target3D.yxz * b;\nlngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n}\nfloat z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\nreturn vec3(lngLat, z);\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nfloat segmentIndex = positions.x;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\nfloat nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nisValid = 1.0;\nuv = vec2(segmentRatio, positions.y);\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nvec4 curr;\nvec4 next;\nvec3 source;\nvec3 target;\nif ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nsource = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\ntarget = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\nfloat angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\nvec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\nvec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\nvec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\nif (abs(currPos.x - prevPos.x) > 180.0) {\nindexDir = -1.0;\nisValid = 0.0;\n} else if (abs(currPos.x - nextPos.x) > 180.0) {\nindexDir = 1.0;\nisValid = 0.0;\n}\nnextPos = indexDir < 0.0 ? prevPos : nextPos;\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nif (isValid == 0.0) {\nnextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\nfloat t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\ncurrPos = mix(currPos, nextPos, t);\nsegmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n}\nvec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\nvec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\ncurr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\nnext = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n} else {\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nif (useShortestPath) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng > 180.) target_world.x -= 360.;\nif (deltaLng < -180.) source_world.x -= 360.;\n}\nsource = project_position(source_world, instanceSourcePositions64Low);\ntarget = project_position(target_world, instanceTargetPositions64Low);\nfloat antiMeridianX = 0.0;\nif (useShortestPath) {\nif (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nantiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n}\nfloat thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\nif (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\nisValid = 0.0;\nindexDir = sign(segmentRatio - thresholdRatio);\nsegmentRatio = thresholdRatio;\n}\n}\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nvec3 currPos = interpolateFlat(source, target, segmentRatio);\nvec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\nif (useShortestPath) {\nif (nextPos.x < antiMeridianX) {\ncurrPos.x += TILE_SIZE;\nnextPos.x += TILE_SIZE;\n}\n}\ncurr = project_common_position_to_clipspace(vec4(currPos, 1.0));\nnext = project_common_position_to_clipspace(vec4(nextPos, 1.0));\ngeometry.position = vec4(currPos, 1.0);\n}\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(curr, geometry);\ngl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\nvColor = vec4(color.rgb, color.a * opacity);\nDECKGL_FILTER_COLOR(vColor, 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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME arc-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nin float isValid;\nout vec4 fragColor;\nvoid main(void) {\nif (isValid == 0.0) {\ndiscard;\n}\nfragColor = vColor;\ngeometry.uv = uv;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n", "// Copyright (c) 2015 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 { Layer, project32, picking, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { Model } from '@luma.gl/engine';\nimport { lngLatToWorld } from '@math.gl/web-mercator';\nimport createMesh from \"./create-mesh.js\";\nimport vs from \"./bitmap-layer-vertex.js\";\nimport fs from \"./bitmap-layer-fragment.js\";\nconst defaultProps = {\n image: { type: 'image', value: null, async: true },\n bounds: { type: 'array', value: [1, 0, 0, 1], compare: true },\n _imageCoordinateSystem: COORDINATE_SYSTEM.DEFAULT,\n desaturate: { type: 'number', min: 0, max: 1, value: 0 },\n // More context: because of the blending mode we're using for ground imagery,\n // alpha is not effective when blending the bitmap layers with the base map.\n // Instead we need to manually dim/blend rgb values with a background color.\n transparentColor: { type: 'color', value: [0, 0, 0, 0] },\n tintColor: { type: 'color', value: [255, 255, 255] },\n textureParameters: { type: 'object', ignore: true, value: null }\n};\n/** Render a bitmap at specified boundaries. */\nclass BitmapLayer extends Layer {\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, picking] });\n }\n initializeState() {\n const attributeManager = this.getAttributeManager();\n attributeManager.remove(['instancePickingColors']);\n const noAlloc = true;\n attributeManager.add({\n indices: {\n size: 1,\n isIndexed: true,\n update: attribute => (attribute.value = this.state.mesh.indices),\n noAlloc\n },\n positions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n update: attribute => (attribute.value = this.state.mesh.positions),\n noAlloc\n },\n texCoords: {\n size: 2,\n update: attribute => (attribute.value = this.state.mesh.texCoords),\n noAlloc\n }\n });\n }\n updateState({ props, oldProps, changeFlags }) {\n // setup model first\n const attributeManager = this.getAttributeManager();\n if (changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n attributeManager.invalidateAll();\n }\n if (props.bounds !== oldProps.bounds) {\n const oldMesh = this.state.mesh;\n const mesh = this._createMesh();\n this.state.model.setVertexCount(mesh.vertexCount);\n for (const key in mesh) {\n if (oldMesh && oldMesh[key] !== mesh[key]) {\n attributeManager.invalidate(key);\n }\n }\n this.setState({ mesh, ...this._getCoordinateUniforms() });\n }\n else if (props._imageCoordinateSystem !== oldProps._imageCoordinateSystem) {\n this.setState(this._getCoordinateUniforms());\n }\n }\n getPickingInfo(params) {\n const { image } = this.props;\n const info = params.info;\n if (!info.color || !image) {\n info.bitmap = null;\n return info;\n }\n const { width, height } = image;\n // Picking color doesn't represent object index in this layer\n info.index = 0;\n // Calculate uv and pixel in bitmap\n const uv = unpackUVsFromRGB(info.color);\n info.bitmap = {\n size: { width, height },\n uv,\n pixel: [Math.floor(uv[0] * width), Math.floor(uv[1] * height)]\n };\n return info;\n }\n // Override base Layer multi-depth picking logic\n disablePickingIndex() {\n this.setState({ disablePicking: true });\n }\n restorePickingColors() {\n this.setState({ disablePicking: false });\n }\n _updateAutoHighlight(info) {\n super._updateAutoHighlight({\n ...info,\n color: this.encodePickingColor(0)\n });\n }\n _createMesh() {\n const { bounds } = this.props;\n let normalizedBounds = bounds;\n // bounds as [minX, minY, maxX, maxY]\n if (isRectangularBounds(bounds)) {\n /*\n (minX0, maxY3) ---- (maxX2, maxY3)\n | |\n | |\n | |\n (minX0, minY1) ---- (maxX2, minY1)\n */\n normalizedBounds = [\n [bounds[0], bounds[1]],\n [bounds[0], bounds[3]],\n [bounds[2], bounds[3]],\n [bounds[2], bounds[1]]\n ];\n }\n return createMesh(normalizedBounds, this.context.viewport.resolution);\n }\n _getModel() {\n /*\n 0,0 --- 1,0\n | |\n 0,1 --- 1,1\n */\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n topology: 'triangle-list',\n isInstanced: false\n });\n }\n draw(opts) {\n const { uniforms, moduleParameters } = opts;\n const { model, coordinateConversion, bounds, disablePicking } = this.state;\n const { image, desaturate, transparentColor, tintColor } = this.props;\n if (moduleParameters.picking.isActive && disablePicking) {\n return;\n }\n // // TODO fix zFighting\n // Render the image\n if (image && model) {\n model.setUniforms(uniforms);\n model.setBindings({ bitmapTexture: image });\n model.setUniforms({\n desaturate,\n transparentColor: transparentColor.map(x => x / 255),\n // @ts-expect-error stricter luma gl types\n tintColor: tintColor.slice(0, 3).map(x => x / 255),\n coordinateConversion,\n bounds\n });\n model.draw(this.context.renderPass);\n }\n }\n _getCoordinateUniforms() {\n const { LNGLAT, CARTESIAN, DEFAULT } = COORDINATE_SYSTEM;\n let { _imageCoordinateSystem: imageCoordinateSystem } = this.props;\n if (imageCoordinateSystem !== DEFAULT) {\n const { bounds } = this.props;\n if (!isRectangularBounds(bounds)) {\n throw new Error('_imageCoordinateSystem only supports rectangular bounds');\n }\n // The default behavior (linearly interpolated tex coords)\n const defaultImageCoordinateSystem = this.context.viewport.resolution ? LNGLAT : CARTESIAN;\n imageCoordinateSystem = imageCoordinateSystem === LNGLAT ? LNGLAT : CARTESIAN;\n if (imageCoordinateSystem === LNGLAT && defaultImageCoordinateSystem === CARTESIAN) {\n // LNGLAT in Mercator, e.g. display LNGLAT-encoded image in WebMercator projection\n return { coordinateConversion: -1, bounds };\n }\n if (imageCoordinateSystem === CARTESIAN && defaultImageCoordinateSystem === LNGLAT) {\n // Mercator in LNGLAT, e.g. display WebMercator encoded image in Globe projection\n const bottomLeft = lngLatToWorld([bounds[0], bounds[1]]);\n const topRight = lngLatToWorld([bounds[2], bounds[3]]);\n return {\n coordinateConversion: 1,\n bounds: [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]]\n };\n }\n }\n return {\n coordinateConversion: 0,\n bounds: [0, 0, 0, 0]\n };\n }\n}\nBitmapLayer.layerName = 'BitmapLayer';\nBitmapLayer.defaultProps = defaultProps;\nexport default BitmapLayer;\n/**\n * Decode uv floats from rgb bytes where b contains 4-bit fractions of uv\n * @param {number[]} color\n * @returns {number[]} uvs\n * https://stackoverflow.com/questions/30242013/glsl-compressing-packing-multiple-0-1-colours-var4-into-a-single-var4-variab\n */\nfunction unpackUVsFromRGB(color) {\n const [u, v, fracUV] = color;\n const vFrac = (fracUV & 0xf0) / 256;\n const uFrac = (fracUV & 0x0f) / 16;\n return [(u + uFrac) / 256, (v + vFrac) / 256];\n}\nfunction isRectangularBounds(bounds) {\n return Number.isFinite(bounds[0]);\n}\n", "import { lerp } from '@math.gl/core';\nconst DEFAULT_INDICES = new Uint32Array([0, 2, 1, 0, 3, 2]);\nconst DEFAULT_TEX_COORDS = new Float32Array([0, 1, 0, 0, 1, 0, 1, 1]);\n/*\n 1 ---- 2\n | |\n | |\n 0 ---- 3\n*/\n/* eslint-disable max-statements */\nexport default function createMesh(bounds, resolution) {\n if (!resolution) {\n return createQuad(bounds);\n }\n const maxXSpan = Math.max(Math.abs(bounds[0][0] - bounds[3][0]), Math.abs(bounds[1][0] - bounds[2][0]));\n const maxYSpan = Math.max(Math.abs(bounds[1][1] - bounds[0][1]), Math.abs(bounds[2][1] - bounds[3][1]));\n const uCount = Math.ceil(maxXSpan / resolution) + 1;\n const vCount = Math.ceil(maxYSpan / resolution) + 1;\n const vertexCount = (uCount - 1) * (vCount - 1) * 6;\n const indices = new Uint32Array(vertexCount);\n const texCoords = new Float32Array(uCount * vCount * 2);\n const positions = new Float64Array(uCount * vCount * 3);\n // Tesselate\n let vertex = 0;\n let index = 0;\n for (let u = 0; u < uCount; u++) {\n const ut = u / (uCount - 1);\n for (let v = 0; v < vCount; v++) {\n const vt = v / (vCount - 1);\n const p = interpolateQuad(bounds, ut, vt);\n positions[vertex * 3 + 0] = p[0];\n positions[vertex * 3 + 1] = p[1];\n positions[vertex * 3 + 2] = p[2] || 0;\n texCoords[vertex * 2 + 0] = ut;\n texCoords[vertex * 2 + 1] = 1 - vt;\n if (u > 0 && v > 0) {\n indices[index++] = vertex - vCount;\n indices[index++] = vertex - vCount - 1;\n indices[index++] = vertex - 1;\n indices[index++] = vertex - vCount;\n indices[index++] = vertex - 1;\n indices[index++] = vertex;\n }\n vertex++;\n }\n }\n return {\n vertexCount,\n positions,\n indices,\n texCoords\n };\n}\nfunction createQuad(bounds) {\n const positions = new Float64Array(12);\n // [[minX, minY], [minX, maxY], [maxX, maxY], [maxX, minY]]\n for (let i = 0; i < bounds.length; i++) {\n positions[i * 3 + 0] = bounds[i][0];\n positions[i * 3 + 1] = bounds[i][1];\n positions[i * 3 + 2] = bounds[i][2] || 0;\n }\n return {\n vertexCount: 6,\n positions,\n indices: DEFAULT_INDICES,\n texCoords: DEFAULT_TEX_COORDS\n };\n}\nfunction interpolateQuad(quad, ut, vt) {\n return lerp(lerp(quad[0], quad[1], vt), lerp(quad[3], quad[2], vt), ut);\n}\n", "export default `\\\n#version 300 es\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nin vec2 texCoords;\nin vec3 positions;\nin vec3 positions64Low;\n\nout vec2 vTexCoord;\nout vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy + project_uCommonOrigin.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n`;\n", "/**\n * Pack the top 12 bits of two normalized floats into 3 8-bit (rgb) values\n * This enables addressing 4096x4096 individual pixels\n *\n * returns vec3 encoded RGB colors\n * result.r - top 8 bits of u\n * result.g - top 8 bits of v\n * result.b - next 4 bits of u and v: (u + v * 16)\n */\nconst packUVsIntoRGB = `\nvec3 packUVsIntoRGB(vec2 uv) {\n // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n vec2 uv8bit = floor(uv * 256.);\n\n // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n // Scale and clamp to 0-1 range\n vec2 uvFraction = fract(uv * 256.);\n vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n return vec3(uv8bit, fractions) / 255.;\n}\n`;\nexport default `\\\n#version 300 es\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nin vec2 vTexCoord;\nin vec2 vTexPos;\n\nout vec4 fragColor;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n if (transparentColor.a == 0.0) {\n return vec4(color, alpha);\n }\n float blendedAlpha = alpha + transparentColor.a * (1.0 - alpha);\n float highLightRatio = alpha / blendedAlpha;\n vec3 blendedRGB = mix(transparentColor.rgb, color, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n${packUVsIntoRGB}\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture(bitmapTexture, uv);\n\n fragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(fragColor, geometry);\n\n if (bool(picking.isActive) && !bool(picking.isAttribute)) {\n // Since instance information is not used, we can use picking color for pixel index\n fragColor.rgb = packUVsIntoRGB(uv);\n }\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 { Layer, project32, picking, log, UNIT } from '@deck.gl/core';\nimport { Model, Geometry } from '@luma.gl/engine';\nimport vs from \"./icon-layer-vertex.glsl.js\";\nimport fs from \"./icon-layer-fragment.glsl.js\";\nimport IconManager from \"./icon-manager.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n iconAtlas: { type: 'image', value: null, async: true },\n iconMapping: { type: 'object', value: {}, async: true },\n sizeScale: { type: 'number', value: 1, min: 0 },\n billboard: true,\n sizeUnits: 'pixels',\n sizeMinPixels: { type: 'number', min: 0, value: 0 }, // min point radius in pixels\n sizeMaxPixels: { type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER }, // max point radius in pixels\n alphaCutoff: { type: 'number', value: 0.05, min: 0, max: 1 },\n getPosition: { type: 'accessor', value: (x) => x.position },\n getIcon: { type: 'accessor', value: (x) => x.icon },\n getColor: { type: 'accessor', value: DEFAULT_COLOR },\n getSize: { type: 'accessor', value: 1 },\n getAngle: { type: 'accessor', value: 0 },\n getPixelOffset: { type: 'accessor', value: [0, 0] },\n onIconError: { type: 'function', value: null, optional: true },\n textureParameters: { type: 'object', ignore: true, value: null }\n};\n/** Render raster icons at given coordinates. */\nclass IconLayer extends Layer {\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, picking] });\n }\n initializeState() {\n this.state = {\n iconManager: new IconManager(this.context.device, {\n onUpdate: this._onUpdate.bind(this),\n onError: this._onError.bind(this)\n })\n };\n const attributeManager = this.getAttributeManager();\n /* eslint-disable max-len */\n attributeManager.addInstanced({\n instancePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getPosition'\n },\n instanceSizes: {\n size: 1,\n transition: true,\n accessor: 'getSize',\n defaultValue: 1\n },\n instanceOffsets: {\n size: 2,\n accessor: 'getIcon',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n transform: this.getInstanceOffset\n },\n instanceIconFrames: {\n size: 4,\n accessor: 'getIcon',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n transform: this.getInstanceIconFrame\n },\n instanceColorModes: {\n size: 1,\n type: 'uint8',\n accessor: 'getIcon',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n transform: this.getInstanceColorMode\n },\n instanceColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getColor',\n defaultValue: DEFAULT_COLOR\n },\n instanceAngles: {\n size: 1,\n transition: true,\n accessor: 'getAngle'\n },\n instancePixelOffset: {\n size: 2,\n transition: true,\n accessor: 'getPixelOffset'\n }\n });\n /* eslint-enable max-len */\n }\n /* eslint-disable max-statements, complexity */\n updateState(params) {\n super.updateState(params);\n const { props, oldProps, changeFlags } = params;\n const attributeManager = this.getAttributeManager();\n const { iconAtlas, iconMapping, data, getIcon, textureParameters } = props;\n const { iconManager } = this.state;\n if (typeof iconAtlas === 'string') {\n return;\n }\n // internalState is always defined during updateState\n const prePacked = iconAtlas || this.internalState.isAsyncPropLoading('iconAtlas');\n iconManager.setProps({\n loadOptions: props.loadOptions,\n autoPacking: !prePacked,\n iconAtlas,\n iconMapping: prePacked ? iconMapping : null,\n textureParameters\n });\n // prepacked iconAtlas from user\n if (prePacked) {\n if (oldProps.iconMapping !== props.iconMapping) {\n attributeManager.invalidate('getIcon');\n }\n }\n else if (changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getIcon))) {\n // Auto packing - getIcon is expected to return an object\n iconManager.packIcons(data, getIcon);\n }\n if (changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n attributeManager.invalidateAll();\n }\n }\n /* eslint-enable max-statements, complexity */\n get isLoaded() {\n return super.isLoaded && this.state.iconManager.isLoaded;\n }\n finalizeState(context) {\n super.finalizeState(context);\n // Release resources held by the icon manager\n this.state.iconManager.finalize();\n }\n draw({ uniforms }) {\n const { sizeScale, sizeMinPixels, sizeMaxPixels, sizeUnits, billboard, alphaCutoff } = this.props;\n const { iconManager } = this.state;\n const iconsTexture = iconManager.getTexture();\n if (iconsTexture) {\n const model = this.state.model;\n model.setBindings({ iconsTexture });\n model.setUniforms(uniforms);\n model.setUniforms({\n iconsTextureDim: [iconsTexture.width, iconsTexture.height],\n sizeUnits: UNIT[sizeUnits],\n sizeScale,\n sizeMinPixels,\n sizeMaxPixels,\n billboard,\n alphaCutoff\n });\n model.draw(this.context.renderPass);\n }\n }\n _getModel() {\n // The icon-layer vertex shader uses 2d positions\n // specifed via: in vec2 positions;\n const positions = [-1, -1, 1, -1, -1, 1, 1, 1];\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-strip',\n attributes: {\n // The size must be explicitly passed here otherwise luma.gl\n // will default to assuming that positions are 3D (x,y,z)\n positions: {\n size: 2,\n value: new Float32Array(positions)\n }\n }\n }),\n isInstanced: true\n });\n }\n _onUpdate() {\n this.setNeedsRedraw();\n }\n _onError(evt) {\n const onIconError = this.getCurrentLayer()?.props.onIconError;\n if (onIconError) {\n onIconError(evt);\n }\n else {\n log.error(evt.error.message)();\n }\n }\n getInstanceOffset(icon) {\n const { width, height, anchorX = width / 2, anchorY = height / 2 } = this.state.iconManager.getIconMapping(icon);\n return [width / 2 - anchorX, height / 2 - anchorY];\n }\n getInstanceColorMode(icon) {\n const mapping = this.state.iconManager.getIconMapping(icon);\n return mapping.mask ? 1 : 0;\n }\n getInstanceIconFrame(icon) {\n const { x, y, width, height } = this.state.iconManager.getIconMapping(icon);\n return [x, y, width, height];\n }\n}\nIconLayer.defaultProps = defaultProps;\nIconLayer.layerName = 'IconLayer';\nexport default IconLayer;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME icon-layer-vertex-shader\nin vec2 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin float instanceSizes;\nin float instanceAngles;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec4 instanceIconFrames;\nin float instanceColorModes;\nin vec2 instanceOffsets;\nin vec2 instancePixelOffset;\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\nuniform int sizeUnits;\nout float vColorMode;\nout vec4 vColor;\nout vec2 vTextureCoords;\nout vec2 uv;\nvec2 rotate_by_angle(vec2 vertex, float angle) {\nfloat angle_radian = angle * PI / 180.0;\nfloat cos_angle = cos(angle_radian);\nfloat sin_angle = sin(angle_radian);\nmat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\nreturn rotationMatrix * vertex;\n}\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = positions;\ngeometry.pickingColor = instancePickingColors;\nuv = positions;\nvec2 iconSize = instanceIconFrames.zw;\nfloat sizePixels = clamp(\nproject_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\nsizeMinPixels, sizeMaxPixels\n);\nfloat instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\nvec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\npixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\npixelOffset += instancePixelOffset;\npixelOffset.y *= -1.0;\nif (billboard) {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = vec3(pixelOffset, 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\nDECKGL_FILTER_SIZE(offset_common, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvTextureCoords = mix(\ninstanceIconFrames.xy,\ninstanceIconFrames.xy + iconSize,\n(positions.xy + 1.0) / 2.0\n) / iconsTextureDim;\nvColor = instanceColors;\nDECKGL_FILTER_COLOR(vColor, geometry);\nvColorMode = instanceColorModes;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME icon-layer-fragment-shader\nprecision highp float;\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\nin float vColorMode;\nin vec4 vColor;\nin vec2 vTextureCoords;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nvec4 texColor = texture(iconsTexture, vTextureCoords);\nvec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\nfloat a = texColor.a * opacity * vColor.a;\nif (a < alphaCutoff) {\ndiscard;\n}\nfragColor = vec4(color, a);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n", "import { load } from '@loaders.gl/core';\nimport { createIterable } from '@deck.gl/core';\nconst DEFAULT_CANVAS_WIDTH = 1024;\nconst DEFAULT_BUFFER = 4;\nconst noop = () => { };\nconst DEFAULT_SAMPLER_PARAMETERS = {\n minFilter: 'linear',\n mipmapFilter: 'linear',\n // LINEAR is the default value but explicitly set it here\n magFilter: 'linear',\n // minimize texture boundary artifacts\n addressModeU: 'clamp-to-edge',\n addressModeV: 'clamp-to-edge'\n};\nconst MISSING_ICON = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n};\nfunction nextPowOfTwo(number) {\n return Math.pow(2, Math.ceil(Math.log2(number)));\n}\n// update comment to create a new texture and copy original data.\nfunction resizeImage(ctx, imageData, maxWidth, maxHeight) {\n const resizeRatio = Math.min(maxWidth / imageData.width, maxHeight / imageData.height);\n const width = Math.floor(imageData.width * resizeRatio);\n const height = Math.floor(imageData.height * resizeRatio);\n if (resizeRatio === 1) {\n // No resizing required\n return { data: imageData, width, height };\n }\n ctx.canvas.height = height;\n ctx.canvas.width = width;\n ctx.clearRect(0, 0, width, height);\n // image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight\n ctx.drawImage(imageData, 0, 0, imageData.width, imageData.height, 0, 0, width, height);\n return { data: ctx.canvas, width, height };\n}\nfunction getIconId(icon) {\n return icon && (icon.id || icon.url);\n}\n// resize texture without losing original data\nfunction resizeTexture(texture, width, height, sampler) {\n const { width: oldWidth, height: oldHeight, device } = texture;\n const newTexture = device.createTexture({ format: 'rgba8unorm', width, height, sampler });\n const commandEncoder = device.createCommandEncoder();\n commandEncoder.copyTextureToTexture({\n source: texture,\n destination: newTexture,\n width: oldWidth,\n height: oldHeight\n });\n commandEncoder.finish();\n texture.destroy();\n return newTexture;\n}\n// traverse icons in a row of icon atlas\n// extend each icon with left-top coordinates\nfunction buildRowMapping(mapping, columns, yOffset) {\n for (let i = 0; i < columns.length; i++) {\n const { icon, xOffset } = columns[i];\n const id = getIconId(icon);\n mapping[id] = {\n ...icon,\n x: xOffset,\n y: yOffset\n };\n }\n}\n/**\n * Generate coordinate mapping to retrieve icon left-top position from an icon atlas\n */\nexport function buildMapping({ icons, buffer, mapping = {}, xOffset = 0, yOffset = 0, rowHeight = 0, canvasWidth }) {\n let columns = [];\n // Strategy to layout all the icons into a texture:\n // traverse the icons sequentially, layout the icons from left to right, top to bottom\n // when the sum of the icons width is equal or larger than canvasWidth,\n // move to next row starting from total height so far plus max height of the icons in previous row\n // row width is equal to canvasWidth\n // row height is decided by the max height of the icons in that row\n // mapping coordinates of each icon is its left-top position in the texture\n for (let i = 0; i < icons.length; i++) {\n const icon = icons[i];\n const id = getIconId(icon);\n if (!mapping[id]) {\n const { height, width } = icon;\n // fill one row\n if (xOffset + width + buffer > canvasWidth) {\n buildRowMapping(mapping, columns, yOffset);\n xOffset = 0;\n yOffset = rowHeight + yOffset + buffer;\n rowHeight = 0;\n columns = [];\n }\n columns.push({\n icon,\n xOffset\n });\n xOffset = xOffset + width + buffer;\n rowHeight = Math.max(rowHeight, height);\n }\n }\n if (columns.length > 0) {\n buildRowMapping(mapping, columns, yOffset);\n }\n return {\n mapping,\n rowHeight,\n xOffset,\n yOffset,\n canvasWidth,\n canvasHeight: nextPowOfTwo(rowHeight + yOffset + buffer)\n };\n}\n// extract icons from data\n// return icons should be unique, and not cached or cached but url changed\nexport function getDiffIcons(data, getIcon, cachedIcons) {\n if (!data || !getIcon) {\n return null;\n }\n cachedIcons = cachedIcons || {};\n const icons = {};\n const { iterable, objectInfo } = createIterable(data);\n for (const object of iterable) {\n objectInfo.index++;\n const icon = getIcon(object, objectInfo);\n const id = getIconId(icon);\n if (!icon) {\n throw new Error('Icon is missing.');\n }\n if (!icon.url) {\n throw new Error('Icon url is missing.');\n }\n if (!icons[id] && (!cachedIcons[id] || icon.url !== cachedIcons[id].url)) {\n icons[id] = { ...icon, source: object, sourceIndex: objectInfo.index };\n }\n }\n return icons;\n}\nexport default class IconManager {\n constructor(device, { onUpdate = noop, onError = noop }) {\n this._loadOptions = null;\n this._texture = null;\n this._externalTexture = null;\n this._mapping = {};\n this._textureParameters = null;\n /** count of pending requests to fetch icons */\n this._pendingCount = 0;\n this._autoPacking = false;\n // / internal state used for autoPacking\n this._xOffset = 0;\n this._yOffset = 0;\n this._rowHeight = 0;\n this._buffer = DEFAULT_BUFFER;\n this._canvasWidth = DEFAULT_CANVAS_WIDTH;\n this._canvasHeight = 0;\n this._canvas = null;\n this.device = device;\n this.onUpdate = onUpdate;\n this.onError = onError;\n }\n finalize() {\n this._texture?.delete();\n }\n getTexture() {\n return this._texture || this._externalTexture;\n }\n getIconMapping(icon) {\n const id = this._autoPacking ? getIconId(icon) : icon;\n return this._mapping[id] || MISSING_ICON;\n }\n setProps({ loadOptions, autoPacking, iconAtlas, iconMapping, textureParameters }) {\n if (loadOptions) {\n this._loadOptions = loadOptions;\n }\n if (autoPacking !== undefined) {\n this._autoPacking = autoPacking;\n }\n if (iconMapping) {\n this._mapping = iconMapping;\n }\n if (iconAtlas) {\n this._texture?.delete();\n this._texture = null;\n this._externalTexture = iconAtlas;\n }\n if (textureParameters) {\n this._textureParameters = textureParameters;\n }\n }\n get isLoaded() {\n return this._pendingCount === 0;\n }\n packIcons(data, getIcon) {\n if (!this._autoPacking || typeof document === 'undefined') {\n return;\n }\n const icons = Object.values(getDiffIcons(data, getIcon, this._mapping) || {});\n if (icons.length > 0) {\n // generate icon mapping\n const { mapping, xOffset, yOffset, rowHeight, canvasHeight } = buildMapping({\n icons,\n buffer: this._buffer,\n canvasWidth: this._canvasWidth,\n mapping: this._mapping,\n rowHeight: this._rowHeight,\n xOffset: this._xOffset,\n yOffset: this._yOffset\n });\n this._rowHeight = rowHeight;\n this._mapping = mapping;\n this._xOffset = xOffset;\n this._yOffset = yOffset;\n this._canvasHeight = canvasHeight;\n // create new texture\n if (!this._texture) {\n this._texture = this.device.createTexture({\n format: 'rgba8unorm',\n width: this._canvasWidth,\n height: this._canvasHeight,\n sampler: this._textureParameters || DEFAULT_SAMPLER_PARAMETERS\n });\n }\n if (this._texture.height !== this._canvasHeight) {\n this._texture = resizeTexture(this._texture, this._canvasWidth, this._canvasHeight, this._textureParameters || DEFAULT_SAMPLER_PARAMETERS);\n }\n this.onUpdate();\n // load images\n this._canvas = this._canvas || document.createElement('canvas');\n this._loadIcons(icons);\n }\n }\n _loadIcons(icons) {\n // This method is only called in the auto packing case, where _canvas is defined\n const ctx = this._canvas.getContext('2d', {\n willReadFrequently: true\n });\n for (const icon of icons) {\n this._pendingCount++;\n load(icon.url, this._loadOptions)\n .then(imageData => {\n const id = getIconId(icon);\n const iconDef = this._mapping[id];\n const { x, y, width: maxWidth, height: maxHeight } = iconDef;\n const { data, width, height } = resizeImage(ctx, imageData, maxWidth, maxHeight);\n // @ts-expect-error TODO v9 API not yet clear\n this._texture.setSubImageData({\n data,\n x: x + (maxWidth - width) / 2,\n y: y + (maxHeight - height) / 2,\n width,\n height\n });\n iconDef.width = width;\n iconDef.height = height;\n // Call to regenerate mipmaps after modifying texture(s)\n // @ts-expect-error TODO v9 API not yet clear\n this._texture.generateMipmap();\n this.onUpdate();\n })\n .catch(error => {\n this.onError({\n url: icon.url,\n source: icon.source,\n sourceIndex: icon.sourceIndex,\n loadOptions: this._loadOptions,\n error\n });\n })\n .finally(() => {\n this._pendingCount--;\n });\n }\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 { Layer, project32, picking, UNIT } from '@deck.gl/core';\nimport { Geometry } from '@luma.gl/engine';\nimport { Model } from '@luma.gl/engine';\nimport vs from \"./line-layer-vertex.glsl.js\";\nimport fs from \"./line-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n getSourcePosition: { type: 'accessor', value: (x) => x.sourcePosition },\n getTargetPosition: { type: 'accessor', value: (x) => x.targetPosition },\n getColor: { type: 'accessor', value: DEFAULT_COLOR },\n getWidth: { type: 'accessor', value: 1 },\n widthUnits: 'pixels',\n widthScale: { type: 'number', value: 1, min: 0 },\n widthMinPixels: { type: 'number', value: 0, min: 0 },\n widthMaxPixels: { type: 'number', value: Number.MAX_SAFE_INTEGER, min: 0 }\n};\n/**\n * A layer that renders straight lines joining pairs of source and target coordinates.\n */\nclass LineLayer extends Layer {\n getBounds() {\n return this.getAttributeManager()?.getBounds([\n 'instanceSourcePositions',\n 'instanceTargetPositions'\n ]);\n }\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, picking] });\n }\n // This layer has its own wrapLongitude logic\n get wrapLongitude() {\n return false;\n }\n initializeState() {\n const attributeManager = this.getAttributeManager();\n /* eslint-disable max-len */\n attributeManager.addInstanced({\n instanceSourcePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getSourcePosition'\n },\n instanceTargetPositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getTargetPosition'\n },\n instanceColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceWidths: {\n size: 1,\n transition: true,\n accessor: 'getWidth',\n defaultValue: 1\n }\n });\n /* eslint-enable max-len */\n }\n updateState(params) {\n super.updateState(params);\n if (params.changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n this.getAttributeManager().invalidateAll();\n }\n }\n draw({ uniforms }) {\n const { widthUnits, widthScale, widthMinPixels, widthMaxPixels, wrapLongitude } = this.props;\n const model = this.state.model;\n model.setUniforms(uniforms);\n model.setUniforms({\n widthUnits: UNIT[widthUnits],\n widthScale,\n widthMinPixels,\n widthMaxPixels,\n useShortestPath: wrapLongitude ? 1 : 0\n });\n model.draw(this.context.renderPass);\n if (wrapLongitude) {\n // Render a second copy for the clipped lines at the 180th meridian\n model.setUniforms({\n useShortestPath: -1\n });\n model.draw(this.context.renderPass);\n }\n }\n _getModel() {\n /*\n * (0, -1)-------------_(1, -1)\n * | _,-\" |\n * o _,-\" o\n * | _,-\" |\n * (0, 1)\"-------------(1, 1)\n */\n const positions = [0, -1, 0, 0, 1, 0, 1, -1, 0, 1, 1, 0];\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-strip',\n attributes: {\n positions: { size: 3, value: new Float32Array(positions) }\n }\n }),\n isInstanced: true\n });\n }\n}\nLineLayer.layerName = 'LineLayer';\nLineLayer.defaultProps = defaultProps;\nexport default LineLayer;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME line-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceSourcePositions;\nin vec3 instanceTargetPositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin float instanceWidths;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float useShortestPath;\nuniform int widthUnits;\nout vec4 vColor;\nout vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nvec3 splitLine(vec3 a, vec3 b, float x) {\nfloat t = (x - a.x) / (b.x - a.x);\nreturn vec3(x, mix(a.yz, b.yz, t));\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nvec3 source_world_64low = instanceSourcePositions64Low;\nvec3 target_world_64low = instanceTargetPositions64Low;\nif (useShortestPath > 0.5 || useShortestPath < -0.5) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng * useShortestPath > 180.) {\nsource_world.x += 360. * useShortestPath;\nsource_world = splitLine(source_world, target_world, 180. * useShortestPath);\nsource_world_64low = vec3(0.0);\n} else if (deltaLng * useShortestPath < -180.) {\ntarget_world.x += 360. * useShortestPath;\ntarget_world = splitLine(source_world, target_world, 180. * useShortestPath);\ntarget_world_64low = vec3(0.0);\n} else if (useShortestPath < 0.) {\ngl_Position = vec4(0.);\nreturn;\n}\n}\nvec4 source_commonspace;\nvec4 target_commonspace;\nvec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\nvec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\nfloat segmentIndex = positions.x;\nvec4 p = mix(source, target, segmentIndex);\ngeometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\nuv = positions.xy;\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(p, geometry);\ngl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\nDECKGL_FILTER_COLOR(vColor, 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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME line-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nfragColor = vColor;\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 { Layer, project32, gouraudLighting, picking, UNIT } from '@deck.gl/core';\nimport { Model, Geometry } from '@luma.gl/engine';\nimport vs from \"./point-cloud-layer-vertex.glsl.js\";\nimport fs from \"./point-cloud-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst DEFAULT_NORMAL = [0, 0, 1];\nconst defaultProps = {\n sizeUnits: 'pixels',\n pointSize: { type: 'number', min: 0, value: 10 }, // point radius in pixels\n getPosition: { type: 'accessor', value: (x) => x.position },\n getNormal: { type: 'accessor', value: DEFAULT_NORMAL },\n getColor: { type: 'accessor', value: DEFAULT_COLOR },\n material: true,\n // Depreated\n radiusPixels: { deprecatedFor: 'pointSize' }\n};\n// support loaders.gl point cloud format\nfunction normalizeData(data) {\n const { header, attributes } = data;\n if (!header || !attributes) {\n return;\n }\n data.length = header.vertexCount;\n if (attributes.POSITION) {\n attributes.instancePositions = attributes.POSITION;\n }\n if (attributes.NORMAL) {\n attributes.instanceNormals = attributes.NORMAL;\n }\n if (attributes.COLOR_0) {\n const { size, value } = attributes.COLOR_0;\n attributes.instanceColors = { size, type: 'unorm8', value };\n }\n}\n/** Render a point cloud with 3D positions, normals and colors. */\nclass PointCloudLayer extends Layer {\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, gouraudLighting, picking] });\n }\n initializeState() {\n this.getAttributeManager().addInstanced({\n instancePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getPosition'\n },\n instanceNormals: {\n size: 3,\n transition: true,\n accessor: 'getNormal',\n defaultValue: DEFAULT_NORMAL\n },\n instanceColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getColor',\n defaultValue: DEFAULT_COLOR\n }\n });\n }\n updateState(params) {\n const { changeFlags, props } = params;\n super.updateState(params);\n if (changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n this.getAttributeManager().invalidateAll();\n }\n if (changeFlags.dataChanged) {\n normalizeData(props.data);\n }\n }\n draw({ uniforms }) {\n const { pointSize, sizeUnits } = this.props;\n const model = this.state.model;\n model.setUniforms(uniforms);\n model.setUniforms({\n sizeUnits: UNIT[sizeUnits],\n radiusPixels: pointSize\n });\n model.draw(this.context.renderPass);\n }\n _getModel() {\n // a triangle that minimally cover the unit circle\n const positions = [];\n for (let i = 0; i < 3; i++) {\n const angle = (i / 3) * Math.PI * 2;\n positions.push(Math.cos(angle) * 2, Math.sin(angle) * 2, 0);\n }\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-list',\n attributes: {\n positions: new Float32Array(positions)\n }\n }),\n isInstanced: true\n });\n }\n}\nPointCloudLayer.layerName = 'PointCloudLayer';\nPointCloudLayer.defaultProps = defaultProps;\nexport default PointCloudLayer;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME point-cloud-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceNormals;\nin vec4 instanceColors;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radiusPixels;\nuniform int sizeUnits;\nout vec4 vColor;\nout vec2 unitPosition;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.normal = project_normal(instanceNormals);\nunitPosition = positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;\nvec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\nvec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, instanceColors.a * opacity);\nDECKGL_FILTER_COLOR(vColor, 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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME point-cloud-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 unitPosition;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition;\nfloat distToCenter = length(unitPosition);\nif (distToCenter > 1.0) {\ndiscard;\n}\nfragColor = vColor;\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 { Layer, project32, picking, UNIT } from '@deck.gl/core';\nimport { Geometry } from '@luma.gl/engine';\nimport { Model } from '@luma.gl/engine';\nimport vs from \"./scatterplot-layer-vertex.glsl.js\";\nimport fs from \"./scatterplot-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n radiusUnits: 'meters',\n radiusScale: { type: 'number', min: 0, value: 1 },\n radiusMinPixels: { type: 'number', min: 0, value: 0 }, // min point radius in pixels\n radiusMaxPixels: { type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER }, // max point radius in pixels\n lineWidthUnits: 'meters',\n lineWidthScale: { type: 'number', min: 0, value: 1 },\n lineWidthMinPixels: { type: 'number', min: 0, value: 0 },\n lineWidthMaxPixels: { type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER },\n stroked: false,\n filled: true,\n billboard: false,\n antialiasing: true,\n getPosition: { type: 'accessor', value: (x) => x.position },\n getRadius: { type: 'accessor', value: 1 },\n getFillColor: { type: 'accessor', value: DEFAULT_COLOR },\n getLineColor: { type: 'accessor', value: DEFAULT_COLOR },\n getLineWidth: { type: 'accessor', value: 1 },\n // deprecated\n strokeWidth: { deprecatedFor: 'getLineWidth' },\n outline: { deprecatedFor: 'stroked' },\n getColor: { deprecatedFor: ['getFillColor', 'getLineColor'] }\n};\n/** Render circles at given coordinates. */\nclass ScatterplotLayer extends Layer {\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, picking] });\n }\n initializeState() {\n this.getAttributeManager().addInstanced({\n instancePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getPosition'\n },\n instanceRadius: {\n size: 1,\n transition: true,\n accessor: 'getRadius',\n defaultValue: 1\n },\n instanceFillColors: {\n size: this.props.colorFormat.length,\n transition: true,\n type: 'unorm8',\n accessor: 'getFillColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceLineColors: {\n size: this.props.colorFormat.length,\n transition: true,\n type: 'unorm8',\n accessor: 'getLineColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceLineWidths: {\n size: 1,\n transition: true,\n accessor: 'getLineWidth',\n defaultValue: 1\n }\n });\n }\n updateState(params) {\n super.updateState(params);\n if (params.changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n this.getAttributeManager().invalidateAll();\n }\n }\n draw({ uniforms }) {\n const { radiusUnits, radiusScale, radiusMinPixels, radiusMaxPixels, stroked, filled, billboard, antialiasing, lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels } = this.props;\n const model = this.state.model;\n model.setUniforms(uniforms);\n model.setUniforms({\n stroked: stroked ? 1 : 0,\n filled,\n billboard,\n antialiasing,\n radiusUnits: UNIT[radiusUnits],\n radiusScale,\n radiusMinPixels,\n radiusMaxPixels,\n lineWidthUnits: UNIT[lineWidthUnits],\n lineWidthScale,\n lineWidthMinPixels,\n lineWidthMaxPixels\n });\n model.draw(this.context.renderPass);\n }\n _getModel() {\n // a square that minimally cover the unit circle\n const positions = [-1, -1, 0, 1, -1, 0, -1, 1, 0, 1, 1, 0];\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-strip',\n attributes: {\n positions: { size: 3, value: new Float32Array(positions) }\n }\n }),\n isInstanced: true\n });\n }\n}\nScatterplotLayer.defaultProps = defaultProps;\nScatterplotLayer.layerName = 'ScatterplotLayer';\nexport default ScatterplotLayer;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME scatterplot-layer-vertex-shader\nin vec3 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin float instanceRadius;\nin float instanceLineWidths;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool antialiasing;\nuniform bool billboard;\nuniform int radiusUnits;\nuniform int lineWidthUnits;\nout vec4 vFillColor;\nout vec4 vLineColor;\nout vec2 unitPosition;\nout float innerUnitRadius;\nout float outerRadiusPixels;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nouterRadiusPixels = clamp(\nproject_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\nradiusMinPixels, radiusMaxPixels\n);\nfloat lineWidthPixels = clamp(\nproject_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\nlineWidthMinPixels, lineWidthMaxPixels\n);\nouterRadiusPixels += stroked * lineWidthPixels / 2.0;\nfloat edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\nunitPosition = edgePadding * positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;\ninnerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\nif (billboard) {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = edgePadding * positions * outerRadiusPixels;\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\nDECKGL_FILTER_COLOR(vFillColor, geometry);\nvLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\nDECKGL_FILTER_COLOR(vLineColor, 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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME scatterplot-layer-fragment-shader\nprecision highp float;\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\nin vec4 vFillColor;\nin vec4 vLineColor;\nin vec2 unitPosition;\nin float innerUnitRadius;\nin float outerRadiusPixels;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition;\nfloat distToCenter = length(unitPosition) * outerRadiusPixels;\nfloat inCircle = antialiasing ?\nsmoothedge(distToCenter, outerRadiusPixels) :\nstep(distToCenter, outerRadiusPixels);\nif (inCircle == 0.0) {\ndiscard;\n}\nif (stroked > 0.5) {\nfloat isLine = antialiasing ?\nsmoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\nstep(innerUnitRadius * outerRadiusPixels, distToCenter);\nif (filled) {\nfragColor = mix(vFillColor, vLineColor, isLine);\n} else {\nif (isLine == 0.0) {\ndiscard;\n}\nfragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n}\n} else if (!filled) {\ndiscard;\n} else {\nfragColor = vFillColor;\n}\nfragColor.a *= inCircle;\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 { Layer, project32, gouraudLighting, phongLighting, picking, UNIT } from '@deck.gl/core';\nimport { Model } from '@luma.gl/engine';\nimport ColumnGeometry from \"./column-geometry.js\";\nimport vs from \"./column-layer-vertex.glsl.js\";\nimport fs from \"./column-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n diskResolution: { type: 'number', min: 4, value: 20 },\n vertices: null,\n radius: { type: 'number', min: 0, value: 1000 },\n angle: { type: 'number', value: 0 },\n offset: { type: 'array', value: [0, 0] },\n coverage: { type: 'number', min: 0, max: 1, value: 1 },\n elevationScale: { type: 'number', min: 0, value: 1 },\n radiusUnits: 'meters',\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n extruded: true,\n wireframe: false,\n filled: true,\n stroked: false,\n flatShading: false,\n getPosition: { type: 'accessor', value: (x) => x.position },\n getFillColor: { type: 'accessor', value: DEFAULT_COLOR },\n getLineColor: { type: 'accessor', value: DEFAULT_COLOR },\n getLineWidth: { type: 'accessor', value: 1 },\n getElevation: { type: 'accessor', value: 1000 },\n material: true,\n getColor: { deprecatedFor: ['getFillColor', 'getLineColor'] }\n};\n/** Render extruded cylinders (tessellated regular polygons) at given coordinates. */\nclass ColumnLayer extends Layer {\n getShaders() {\n const defines = {};\n const { flatShading } = this.props;\n if (flatShading) {\n defines.FLAT_SHADING = 1;\n }\n return super.getShaders({\n vs,\n fs,\n defines,\n modules: [project32, flatShading ? phongLighting : gouraudLighting, picking]\n });\n }\n /**\n * DeckGL calls initializeState when GL context is available\n * Essentially a deferred constructor\n */\n initializeState() {\n const attributeManager = this.getAttributeManager();\n /* eslint-disable max-len */\n attributeManager.addInstanced({\n instancePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getPosition'\n },\n instanceElevations: {\n size: 1,\n transition: true,\n accessor: 'getElevation'\n },\n instanceFillColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getFillColor',\n defaultValue: DEFAULT_COLOR\n },\n instanceLineColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getLineColor',\n defaultValue: DEFAULT_COLOR\n },\n instanceStrokeWidths: {\n size: 1,\n accessor: 'getLineWidth',\n transition: true\n }\n });\n /* eslint-enable max-len */\n }\n updateState(params) {\n super.updateState(params);\n const { props, oldProps, changeFlags } = params;\n const regenerateModels = changeFlags.extensionsChanged || props.flatShading !== oldProps.flatShading;\n if (regenerateModels) {\n this.state.models?.forEach(model => model.destroy());\n this.setState(this._getModels());\n this.getAttributeManager().invalidateAll();\n }\n const instanceCount = this.getNumInstances();\n this.state.fillModel.setInstanceCount(instanceCount);\n this.state.wireframeModel.setInstanceCount(instanceCount);\n if (regenerateModels ||\n props.diskResolution !== oldProps.diskResolution ||\n props.vertices !== oldProps.vertices ||\n (props.extruded || props.stroked) !== (oldProps.extruded || oldProps.stroked)) {\n this._updateGeometry(props);\n }\n }\n getGeometry(diskResolution, vertices, hasThinkness) {\n const geometry = new ColumnGeometry({\n radius: 1,\n height: hasThinkness ? 2 : 0,\n vertices,\n nradial: diskResolution\n });\n let meanVertexDistance = 0;\n if (vertices) {\n for (let i = 0; i < diskResolution; i++) {\n const p = vertices[i];\n const d = Math.sqrt(p[0] * p[0] + p[1] * p[1]);\n meanVertexDistance += d / diskResolution;\n }\n }\n else {\n meanVertexDistance = 1;\n }\n this.setState({\n edgeDistance: Math.cos(Math.PI / diskResolution) * meanVertexDistance\n });\n return geometry;\n }\n _getModels() {\n const shaders = this.getShaders();\n const bufferLayout = this.getAttributeManager().getBufferLayouts();\n const fillModel = new Model(this.context.device, {\n ...shaders,\n id: `${this.props.id}-fill`,\n bufferLayout,\n isInstanced: true\n });\n const wireframeModel = new Model(this.context.device, {\n ...shaders,\n id: `${this.props.id}-wireframe`,\n bufferLayout,\n isInstanced: true\n });\n return {\n fillModel,\n wireframeModel,\n models: [wireframeModel, fillModel]\n };\n }\n _updateGeometry({ diskResolution, vertices, extruded, stroked }) {\n const geometry = this.getGeometry(diskResolution, vertices, extruded || stroked);\n this.setState({\n fillVertexCount: geometry.attributes.POSITION.value.length / 3\n });\n const fillModel = this.state.fillModel;\n const wireframeModel = this.state.wireframeModel;\n fillModel.setGeometry(geometry);\n fillModel.setTopology('triangle-strip');\n // Disable indices\n fillModel.setIndexBuffer(null);\n wireframeModel.setGeometry(geometry);\n wireframeModel.setTopology('line-list');\n }\n draw({ uniforms }) {\n const { lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels, radiusUnits, elevationScale, extruded, filled, stroked, wireframe, offset, coverage, radius, angle } = this.props;\n const fillModel = this.state.fillModel;\n const wireframeModel = this.state.wireframeModel;\n const { fillVertexCount, edgeDistance } = this.state;\n const renderUniforms = {\n ...uniforms,\n radius,\n angle: (angle / 180) * Math.PI,\n offset,\n extruded,\n stroked,\n coverage,\n elevationScale,\n edgeDistance,\n radiusUnits: UNIT[radiusUnits],\n widthUnits: UNIT[lineWidthUnits],\n widthScale: lineWidthScale,\n widthMinPixels: lineWidthMinPixels,\n widthMaxPixels: lineWidthMaxPixels\n };\n // When drawing 3d: draw wireframe first so it doesn't get occluded by depth test\n if (extruded && wireframe) {\n wireframeModel.setUniforms(renderUniforms);\n wireframeModel.setUniforms({ isStroke: true });\n wireframeModel.draw(this.context.renderPass);\n }\n fillModel.setUniforms(renderUniforms);\n if (filled) {\n // model.setProps({isIndexed: false});\n fillModel.setVertexCount(fillVertexCount);\n fillModel.setUniforms({ isStroke: false });\n fillModel.draw(this.context.renderPass);\n }\n // When drawing 2d: draw fill before stroke so that the outline is always on top\n if (!extruded && stroked) {\n // model.setProps({isIndexed: false});\n // The width of the stroke is achieved by flattening the side of the cylinder.\n // Skip the last 1/3 of the vertices which is the top.\n fillModel.setVertexCount((fillVertexCount * 2) / 3);\n fillModel.setUniforms({ isStroke: true });\n fillModel.draw(this.context.renderPass);\n }\n }\n}\nColumnLayer.layerName = 'ColumnLayer';\nColumnLayer.defaultProps = defaultProps;\nexport default ColumnLayer;\n", "import { log } from '@deck.gl/core';\nimport { Geometry } from '@luma.gl/engine';\nimport { modifyPolygonWindingDirection, WINDING } from '@math.gl/polygon';\nexport default class ColumnGeometry extends Geometry {\n constructor(props) {\n const { indices, attributes } = tesselateColumn(props);\n super({\n ...props,\n indices,\n // @ts-expect-error\n attributes\n });\n }\n}\n/* eslint-disable max-statements, complexity */\nfunction tesselateColumn(props) {\n const { radius, height = 1, nradial = 10 } = props;\n let { vertices } = props;\n if (vertices) {\n log.assert(vertices.length >= nradial); // `vertices` must contain at least `diskResolution` points\n vertices = vertices.flatMap(v => [v[0], v[1]]);\n modifyPolygonWindingDirection(vertices, WINDING.COUNTER_CLOCKWISE);\n }\n const isExtruded = height > 0;\n const vertsAroundEdge = nradial + 1; // loop\n const numVertices = isExtruded\n ? vertsAroundEdge * 3 + 1 // top, side top edge, side bottom edge, one additional degenerage vertex\n : nradial; // top\n const stepAngle = (Math.PI * 2) / nradial;\n // Used for wireframe\n const indices = new Uint16Array(isExtruded ? nradial * 3 * 2 : 0); // top loop, side vertical, bottom loop\n const positions = new Float32Array(numVertices * 3);\n const normals = new Float32Array(numVertices * 3);\n let i = 0;\n // side tesselation: 0, 1, 2, 3, 4, 5, ...\n //\n // 0 - 2 - 4 ... top\n // | / | / |\n // 1 - 3 - 5 ... bottom\n //\n if (isExtruded) {\n for (let j = 0; j < vertsAroundEdge; j++) {\n const a = j * stepAngle;\n const vertexIndex = j % nradial;\n const sin = Math.sin(a);\n const cos = Math.cos(a);\n for (let k = 0; k < 2; k++) {\n positions[i + 0] = vertices ? vertices[vertexIndex * 2] : cos * radius;\n positions[i + 1] = vertices ? vertices[vertexIndex * 2 + 1] : sin * radius;\n positions[i + 2] = (1 / 2 - k) * height;\n normals[i + 0] = vertices ? vertices[vertexIndex * 2] : cos;\n normals[i + 1] = vertices ? vertices[vertexIndex * 2 + 1] : sin;\n i += 3;\n }\n }\n // duplicate the last vertex to create proper degenerate triangle.\n positions[i + 0] = positions[i - 3];\n positions[i + 1] = positions[i - 2];\n positions[i + 2] = positions[i - 1];\n i += 3;\n }\n // The column geometry is rendered as a triangle strip, so\n // in order to render sides and top in one go we need to use degenerate triangles.\n // Duplicate last vertex of side trinagles and first vertex of the top cap to preserve winding order.\n // top tesselation: 0, -1, 1, -2, 2, -3, 3, ...\n //\n // 0 -- 1\n // / \\\n // -1 2\n // | |\n // -2 3\n // \\ /\n // -3 -- 4\n //\n for (let j = isExtruded ? 0 : 1; j < vertsAroundEdge; j++) {\n const v = Math.floor(j / 2) * Math.sign(0.5 - (j % 2));\n const a = v * stepAngle;\n const vertexIndex = (v + nradial) % nradial;\n const sin = Math.sin(a);\n const cos = Math.cos(a);\n positions[i + 0] = vertices ? vertices[vertexIndex * 2] : cos * radius;\n positions[i + 1] = vertices ? vertices[vertexIndex * 2 + 1] : sin * radius;\n positions[i + 2] = height / 2;\n normals[i + 2] = 1;\n i += 3;\n }\n if (isExtruded) {\n let index = 0;\n for (let j = 0; j < nradial; j++) {\n // top loop\n indices[index++] = j * 2 + 0;\n indices[index++] = j * 2 + 2;\n // side vertical\n indices[index++] = j * 2 + 0;\n indices[index++] = j * 2 + 1;\n // bottom loop\n indices[index++] = j * 2 + 1;\n indices[index++] = j * 2 + 3;\n }\n }\n return {\n indices,\n attributes: {\n POSITION: { size: 3, value: positions },\n NORMAL: { size: 3, value: normals }\n }\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.\nexport default `#version 300 es\n#define SHADER_NAME column-layer-vertex-shader\nin vec3 positions;\nin vec3 normals;\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int radiusUnits;\nuniform int widthUnits;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nvec4 color = isStroke ? instanceLineColors : instanceFillColors;\nmat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\nfloat elevation = 0.0;\nfloat strokeOffsetRatio = 1.0;\nif (extruded) {\nelevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n} else if (stroked) {\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels) / 2.0;\nfloat halfOffset = project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\nif (isStroke) {\nstrokeOffsetRatio -= sign(positions.z) * halfOffset;\n} else {\nstrokeOffsetRatio -= halfOffset;\n}\n}\nfloat shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\nfloat dotRadius = radius * coverage * shouldRender;\ngeometry.pickingColor = instancePickingColors;\nvec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\nvec3 centroidPosition64Low = instancePositions64Low;\nvec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;\nif (radiusUnits == UNIT_METERS) {\noffset = project_size(offset);\n}\nvec3 pos = vec3(offset, 0.);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\ngeometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (extruded && !isStroke) {\n#ifdef FLAT_SHADING\nposition_commonspace = geometry.position;\nvColor = vec4(color.rgb, color.a * opacity);\n#else\nvec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, color.a * opacity);\n#endif\n} else {\nvColor = vec4(color.rgb, color.a * opacity);\n}\nDECKGL_FILTER_COLOR(vColor, 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.\nexport default `#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\nprecision highp float;\nuniform vec3 project_uCameraPosition;\nuniform bool extruded;\nuniform bool isStroke;\nout vec4 fragColor;\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec4 position_commonspace;\n#endif\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\n#ifdef FLAT_SHADING\nif (extruded && !isStroke && !bool(picking.isActive)) {\nvec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\nfragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal);\n}\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 { UNIT } from '@deck.gl/core';\nimport { CubeGeometry } from '@luma.gl/engine';\nimport ColumnLayer from \"./column-layer.js\";\nconst defaultProps = {\n cellSize: { type: 'number', min: 0, value: 1000 },\n offset: { type: 'array', value: [1, 1] }\n};\nclass GridCellLayer extends ColumnLayer {\n _updateGeometry() {\n const geometry = new CubeGeometry();\n this.state.fillModel.setGeometry(geometry);\n }\n draw({ uniforms }) {\n const { elevationScale, extruded, offset, coverage, cellSize, angle, radiusUnits } = this.props;\n const fillModel = this.state.fillModel;\n fillModel.setUniforms(uniforms);\n fillModel.setUniforms({\n radius: cellSize / 2,\n radiusUnits: UNIT[radiusUnits],\n angle,\n offset,\n extruded,\n coverage,\n elevationScale,\n edgeDistance: 1,\n isStroke: false\n });\n fillModel.draw(this.context.renderPass);\n }\n}\nGridCellLayer.layerName = 'GridCellLayer';\nGridCellLayer.defaultProps = defaultProps;\nexport default GridCellLayer;\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 { Layer, project32, picking, UNIT } from '@deck.gl/core';\nimport { Geometry } from '@luma.gl/engine';\nimport { Model } from '@luma.gl/engine';\nimport PathTesselator from \"./path-tesselator.js\";\nimport vs from \"./path-layer-vertex.glsl.js\";\nimport fs from \"./path-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n widthUnits: 'meters',\n widthScale: { type: 'number', min: 0, value: 1 },\n widthMinPixels: { type: 'number', min: 0, value: 0 },\n widthMaxPixels: { type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER },\n jointRounded: false,\n capRounded: false,\n miterLimit: { type: 'number', min: 0, value: 4 },\n billboard: false,\n _pathType: null,\n getPath: { type: 'accessor', value: (object) => object.path },\n getColor: { type: 'accessor', value: DEFAULT_COLOR },\n getWidth: { type: 'accessor', value: 1 },\n // deprecated props\n rounded: { deprecatedFor: ['jointRounded', 'capRounded'] }\n};\nconst ATTRIBUTE_TRANSITION = {\n enter: (value, chunk) => {\n return chunk.length ? chunk.subarray(chunk.length - value.length) : value;\n }\n};\n/** Render lists of coordinate points as extruded polylines with mitering. */\nclass PathLayer extends Layer {\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, picking] }); // 'project' module added by default.\n }\n get wrapLongitude() {\n return false;\n }\n getBounds() {\n return this.getAttributeManager()?.getBounds(['vertexPositions']);\n }\n initializeState() {\n const noAlloc = true;\n const attributeManager = this.getAttributeManager();\n /* eslint-disable max-len */\n attributeManager.addInstanced({\n vertexPositions: {\n size: 3,\n // Start filling buffer from 1 vertex in\n vertexOffset: 1,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: ATTRIBUTE_TRANSITION,\n accessor: 'getPath',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n update: this.calculatePositions,\n noAlloc,\n shaderAttributes: {\n instanceLeftPositions: {\n vertexOffset: 0\n },\n instanceStartPositions: {\n vertexOffset: 1\n },\n instanceEndPositions: {\n vertexOffset: 2\n },\n instanceRightPositions: {\n vertexOffset: 3\n }\n }\n },\n instanceTypes: {\n size: 1,\n type: 'uint8',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n update: this.calculateSegmentTypes,\n noAlloc\n },\n instanceStrokeWidths: {\n size: 1,\n accessor: 'getWidth',\n transition: ATTRIBUTE_TRANSITION,\n defaultValue: 1\n },\n instanceColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n accessor: 'getColor',\n transition: ATTRIBUTE_TRANSITION,\n defaultValue: DEFAULT_COLOR\n },\n instancePickingColors: {\n size: 4,\n type: 'uint8',\n accessor: (object, { index, target: value }) => this.encodePickingColor(object && object.__source ? object.__source.index : index, value)\n }\n });\n /* eslint-enable max-len */\n this.setState({\n pathTesselator: new PathTesselator({\n fp64: this.use64bitPositions()\n })\n });\n }\n updateState(params) {\n super.updateState(params);\n const { props, changeFlags } = params;\n const attributeManager = this.getAttributeManager();\n const geometryChanged = changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getPath));\n if (geometryChanged) {\n const { pathTesselator } = this.state;\n const buffers = props.data.attributes || {};\n pathTesselator.updateGeometry({\n data: props.data,\n geometryBuffer: buffers.getPath,\n buffers,\n normalize: !props._pathType,\n loop: props._pathType === 'loop',\n getGeometry: props.getPath,\n positionFormat: props.positionFormat,\n wrapLongitude: props.wrapLongitude,\n // TODO - move the flag out of the viewport\n resolution: this.context.viewport.resolution,\n dataChanged: changeFlags.dataChanged\n });\n this.setState({\n numInstances: pathTesselator.instanceCount,\n startIndices: pathTesselator.vertexStarts\n });\n if (!changeFlags.dataChanged) {\n // Base `layer.updateState` only invalidates all attributes on data change\n // Cover the rest of the scenarios here\n attributeManager.invalidateAll();\n }\n }\n if (changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n attributeManager.invalidateAll();\n }\n }\n getPickingInfo(params) {\n const info = super.getPickingInfo(params);\n const { index } = info;\n const data = this.props.data;\n // Check if data comes from a composite layer, wrapped with getSubLayerRow\n if (data[0] && data[0].__source) {\n // index decoded from picking color refers to the source index\n info.object = data.find(d => d.__source.index === index);\n }\n return info;\n }\n /** Override base Layer method */\n disablePickingIndex(objectIndex) {\n const data = this.props.data;\n // Check if data comes from a composite layer, wrapped with getSubLayerRow\n if (data[0] && data[0].__source) {\n // index decoded from picking color refers to the source index\n for (let i = 0; i < data.length; i++) {\n if (data[i].__source.index === objectIndex) {\n this._disablePickingIndex(i);\n }\n }\n }\n else {\n super.disablePickingIndex(objectIndex);\n }\n }\n draw({ uniforms }) {\n const { jointRounded, capRounded, billboard, miterLimit, widthUnits, widthScale, widthMinPixels, widthMaxPixels } = this.props;\n const model = this.state.model;\n model.setUniforms(uniforms);\n model.setUniforms({\n jointType: Number(jointRounded),\n capType: Number(capRounded),\n billboard,\n widthUnits: UNIT[widthUnits],\n widthScale,\n miterLimit,\n widthMinPixels,\n widthMaxPixels\n });\n model.draw(this.context.renderPass);\n }\n _getModel() {\n /*\n * _\n * \"-_ 1 3 5\n * _ \"o---------------------o-------------------_-o\n * - / \"\"--..__ '. _.-' /\n * _ \"@- - - - - \"\"--..__- - - - x - - - -_.@' /\n * \"-_ / \"\"--..__ '. _,-` : /\n * \"o----------------------------\"\"-o' : /\n * 0,2 4 / '. : /\n * / '.: /\n * / :'. /\n * / : ', /\n * / : o\n */\n // prettier-ignore\n const SEGMENT_INDICES = [\n // start corner\n 0, 1, 2,\n // body\n 1, 4, 2,\n 1, 3, 4,\n // end corner\n 3, 5, 4\n ];\n // [0] position on segment - 0: start, 1: end\n // [1] side of path - -1: left, 0: center (joint), 1: right\n // prettier-ignore\n const SEGMENT_POSITIONS = [\n // bevel start corner\n 0, 0,\n // start inner corner\n 0, -1,\n // start outer corner\n 0, 1,\n // end inner corner\n 1, -1,\n // end outer corner\n 1, 1,\n // bevel end corner\n 1, 0\n ];\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-list',\n attributes: {\n indices: new Uint16Array(SEGMENT_INDICES),\n positions: { value: new Float32Array(SEGMENT_POSITIONS), size: 2 }\n }\n }),\n isInstanced: true\n });\n }\n calculatePositions(attribute) {\n const { pathTesselator } = this.state;\n attribute.startIndices = pathTesselator.vertexStarts;\n attribute.value = pathTesselator.get('positions');\n }\n calculateSegmentTypes(attribute) {\n const { pathTesselator } = this.state;\n attribute.startIndices = pathTesselator.vertexStarts;\n attribute.value = pathTesselator.get('segmentTypes');\n }\n}\nPathLayer.defaultProps = defaultProps;\nPathLayer.layerName = 'PathLayer';\nexport default PathLayer;\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 { Tesselator } from '@deck.gl/core';\nimport { normalizePath } from \"./path.js\";\nconst START_CAP = 1;\nconst END_CAP = 2;\nconst INVALID = 4;\n// This class is set up to allow querying one attribute at a time\n// the way the AttributeManager expects it\nexport default class PathTesselator extends Tesselator {\n constructor(opts) {\n super({\n ...opts,\n attributes: {\n // Padding covers shaderAttributes for last segment in largest case fp64\n // additional vertex + hi & low parts, 3 * 6\n positions: {\n size: 3,\n padding: 18,\n initialize: true,\n type: opts.fp64 ? Float64Array : Float32Array\n },\n segmentTypes: { size: 1, type: Uint8ClampedArray }\n }\n });\n }\n /** Get packed attribute by name */\n get(attributeName) {\n return this.attributes[attributeName];\n }\n /* Implement base Tesselator interface */\n getGeometryFromBuffer(buffer) {\n if (this.normalize) {\n return super.getGeometryFromBuffer(buffer);\n }\n // we don't need to read the positions if no normalization\n return null;\n }\n /* Implement base Tesselator interface */\n normalizeGeometry(path) {\n if (this.normalize) {\n return normalizePath(path, this.positionSize, this.opts.resolution, this.opts.wrapLongitude);\n }\n return path;\n }\n /* Implement base Tesselator interface */\n getGeometrySize(path) {\n if (isCut(path)) {\n let size = 0;\n for (const subPath of path) {\n size += this.getGeometrySize(subPath);\n }\n return size;\n }\n const numPoints = this.getPathLength(path);\n if (numPoints < 2) {\n // invalid path\n return 0;\n }\n if (this.isClosed(path)) {\n // minimum 3 vertices\n return numPoints < 3 ? 0 : numPoints + 2;\n }\n return numPoints;\n }\n /* Implement base Tesselator interface */\n updateGeometryAttributes(path, context) {\n if (context.geometrySize === 0) {\n return;\n }\n if (path && isCut(path)) {\n for (const subPath of path) {\n const geometrySize = this.getGeometrySize(subPath);\n context.geometrySize = geometrySize;\n this.updateGeometryAttributes(subPath, context);\n context.vertexStart += geometrySize;\n }\n }\n else {\n this._updateSegmentTypes(path, context);\n this._updatePositions(path, context);\n }\n }\n _updateSegmentTypes(path, context) {\n const segmentTypes = this.attributes.segmentTypes;\n const isPathClosed = path ? this.isClosed(path) : false;\n const { vertexStart, geometrySize } = context;\n // positions -- A0 A1 B0 B1 B2 B3 B0 B1 B2 --\n // segmentTypes 3 4 4 0 0 0 0 4 4\n segmentTypes.fill(0, vertexStart, vertexStart + geometrySize);\n if (isPathClosed) {\n segmentTypes[vertexStart] = INVALID;\n segmentTypes[vertexStart + geometrySize - 2] = INVALID;\n }\n else {\n segmentTypes[vertexStart] += START_CAP;\n segmentTypes[vertexStart + geometrySize - 2] += END_CAP;\n }\n segmentTypes[vertexStart + geometrySize - 1] = INVALID;\n }\n _updatePositions(path, context) {\n const { positions } = this.attributes;\n if (!positions || !path) {\n return;\n }\n const { vertexStart, geometrySize } = context;\n const p = new Array(3);\n // positions -- A0 A1 B0 B1 B2 B3 B0 B1 B2 --\n // segmentTypes 3 4 4 0 0 0 0 4 4\n for (let i = vertexStart, ptIndex = 0; ptIndex < geometrySize; i++, ptIndex++) {\n this.getPointOnPath(path, ptIndex, p);\n positions[i * 3] = p[0];\n positions[i * 3 + 1] = p[1];\n positions[i * 3 + 2] = p[2];\n }\n }\n // Utilities\n /** Returns the number of points in the path */\n getPathLength(path) {\n return path.length / this.positionSize;\n }\n /** Returns a point on the path at the specified index */\n getPointOnPath(path, index, target = []) {\n const { positionSize } = this;\n if (index * positionSize >= path.length) {\n // loop\n index += 1 - path.length / positionSize;\n }\n const i = index * positionSize;\n target[0] = path[i];\n target[1] = path[i + 1];\n target[2] = (positionSize === 3 && path[i + 2]) || 0;\n return target;\n }\n // Returns true if the first and last points are identical\n isClosed(path) {\n if (!this.normalize) {\n return Boolean(this.opts.loop);\n }\n const { positionSize } = this;\n const lastPointIndex = path.length - positionSize;\n return (path[0] === path[lastPointIndex] &&\n path[1] === path[lastPointIndex + 1] &&\n (positionSize === 2 || path[2] === path[lastPointIndex + 2]));\n }\n}\nfunction isCut(path) {\n return Array.isArray(path[0]);\n}\n", "import { cutPolylineByGrid, cutPolylineByMercatorBounds } from '@math.gl/polygon';\n/**\n * Flattens a nested path object\n * Cut the feature if needed (globe projection, wrap longitude, etc.)\n * Returns a flat array of path positions, or a list of flat arrays representing multiple paths\n */\nexport function normalizePath(path, size, gridResolution, wrapLongitude) {\n let flatPath;\n if (Array.isArray(path[0])) {\n const length = path.length * size;\n flatPath = new Array(length);\n for (let i = 0; i < path.length; i++) {\n for (let j = 0; j < size; j++) {\n flatPath[i * size + j] = path[i][j] || 0;\n }\n }\n }\n else {\n flatPath = path;\n }\n if (gridResolution) {\n return cutPolylineByGrid(flatPath, { size, gridResolution });\n }\n if (wrapLongitude) {\n return cutPolylineByMercatorBounds(flatPath, { size });\n }\n return flatPath;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME path-layer-vertex-shader\nin vec2 positions;\nin float instanceTypes;\nin vec3 instanceStartPositions;\nin vec3 instanceEndPositions;\nin vec3 instanceLeftPositions;\nin vec3 instanceRightPositions;\nin vec3 instanceLeftPositions64Low;\nin vec3 instanceStartPositions64Low;\nin vec3 instanceEndPositions64Low;\nin vec3 instanceRightPositions64Low;\nin float instanceStrokeWidths;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\nuniform int widthUnits;\nuniform float opacity;\nout vec4 vColor;\nout vec2 vCornerOffset;\nout float vMiterLength;\nout vec2 vPathPosition;\nout float vPathLength;\nout float vJointType;\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\nfloat flipIfTrue(bool flag) {\nreturn -(float(flag) * 2. - 1.);\n}\nvec3 getLineJoinOffset(\nvec3 prevPoint, vec3 currPoint, vec3 nextPoint,\nvec2 width\n) {\nbool isEnd = positions.x > 0.0;\nfloat sideOfPath = positions.y;\nfloat isJoint = float(sideOfPath == 0.0);\nvec3 deltaA3 = (currPoint - prevPoint);\nvec3 deltaB3 = (nextPoint - currPoint);\nmat3 rotationMatrix;\nbool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\nif (needsRotation) {\ndeltaA3 = deltaA3 * rotationMatrix;\ndeltaB3 = deltaB3 * rotationMatrix;\n}\nvec2 deltaA = deltaA3.xy / width;\nvec2 deltaB = deltaB3.xy / width;\nfloat lenA = length(deltaA);\nfloat lenB = length(deltaB);\nvec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\nvec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\nvec2 perpA = vec2(-dirA.y, dirA.x);\nvec2 perpB = vec2(-dirB.y, dirB.x);\nvec2 tangent = dirA + dirB;\ntangent = length(tangent) > 0. ? normalize(tangent) : perpA;\nvec2 miterVec = vec2(-tangent.y, tangent.x);\nvec2 dir = isEnd ? dirA : dirB;\nvec2 perp = isEnd ? perpA : perpB;\nfloat L = isEnd ? lenA : lenB;\nfloat sinHalfA = abs(dot(miterVec, perp));\nfloat cosHalfA = abs(dot(dirA, miterVec));\nfloat turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\nfloat cornerPosition = sideOfPath * turnDirection;\nfloat miterSize = 1.0 / max(sinHalfA, EPSILON);\nmiterSize = mix(\nmin(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\nmiterSize,\nstep(0.0, cornerPosition)\n);\nvec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n* (sideOfPath + isJoint * turnDirection);\nbool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\nbool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\nbool isCap = isStartCap || isEndCap;\nif (isCap) {\noffsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\nvJointType = capType;\n} else {\nvJointType = jointType;\n}\nvPathLength = L;\nvCornerOffset = offsetVec;\nvMiterLength = dot(vCornerOffset, miterVec * turnDirection);\nvMiterLength = isCap ? isJoint : vMiterLength;\nvec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\nvPathPosition = vec2(\ndot(offsetFromStartOfPath, perp),\ndot(offsetFromStartOfPath, dir)\n);\ngeometry.uv = vPathPosition;\nfloat isValid = step(instanceTypes, 3.5);\nvec3 offset = vec3(offsetVec * width * isValid, 0.0);\nif (needsRotation) {\noffset = rotationMatrix * offset;\n}\nreturn offset;\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\nif (position.w < EPSILON) {\nfloat r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\nposition = refPosition + (position - refPosition) * r;\n}\n}\nvoid main() {\ngeometry.pickingColor = instancePickingColors;\nvColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\nfloat isEnd = positions.x;\nvec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\nvec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\nvec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\nvec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\nvec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\nvec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\ngeometry.worldPosition = currPosition;\nvec2 widthPixels = vec2(clamp(\nproject_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels) / 2.0);\nvec3 width;\nif (billboard) {\nvec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\nvec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\nvec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\nclipLine(prevPositionScreen, currPositionScreen);\nclipLine(nextPositionScreen, currPositionScreen);\nclipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\nwidth = vec3(widthPixels, 0.0);\nDECKGL_FILTER_SIZE(width, geometry);\nvec3 offset = getLineJoinOffset(\nprevPositionScreen.xyz / prevPositionScreen.w,\ncurrPositionScreen.xyz / currPositionScreen.w,\nnextPositionScreen.xyz / nextPositionScreen.w,\nproject_pixel_size_to_clipspace(width.xy)\n);\nDECKGL_FILTER_GL_POSITION(currPositionScreen, geometry);\ngl_Position = vec4(currPositionScreen.xyz + offset * currPositionScreen.w, currPositionScreen.w);\n} else {\nprevPosition = project_position(prevPosition, prevPosition64Low);\ncurrPosition = project_position(currPosition, currPosition64Low);\nnextPosition = project_position(nextPosition, nextPosition64Low);\nwidth = vec3(project_pixel_size(widthPixels), 0.0);\nDECKGL_FILTER_SIZE(width, geometry);\nvec3 offset = getLineJoinOffset(prevPosition, currPosition, nextPosition, width.xy);\ngeometry.position = vec4(currPosition + offset, 1.0);\ngl_Position = project_common_position_to_clipspace(geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nDECKGL_FILTER_COLOR(vColor, 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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME path-layer-fragment-shader\nprecision highp float;\nuniform float miterLimit;\nin vec4 vColor;\nin vec2 vCornerOffset;\nin float vMiterLength;\nin vec2 vPathPosition;\nin float vPathLength;\nin float vJointType;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = vPathPosition;\nif (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\nif (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\ndiscard;\n}\nif (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\ndiscard;\n}\n}\nfragColor = vColor;\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, createIterable, log } from '@deck.gl/core';\nimport SolidPolygonLayer from \"../solid-polygon-layer/solid-polygon-layer.js\";\nimport PathLayer from \"../path-layer/path-layer.js\";\nimport * as Polygon from \"../solid-polygon-layer/polygon.js\";\nimport { replaceInRange } from \"../utils.js\";\nconst defaultLineColor = [0, 0, 0, 255];\nconst defaultFillColor = [0, 0, 0, 255];\nconst defaultProps = {\n stroked: true,\n filled: true,\n extruded: false,\n elevationScale: 1,\n wireframe: false,\n _normalize: true,\n _windingOrder: 'CW',\n lineWidthUnits: 'meters',\n lineWidthScale: 1,\n lineWidthMinPixels: 0,\n lineWidthMaxPixels: Number.MAX_SAFE_INTEGER,\n lineJointRounded: false,\n lineMiterLimit: 4,\n getPolygon: { type: 'accessor', value: (f) => f.polygon },\n // Polygon fill color\n getFillColor: { type: 'accessor', value: defaultFillColor },\n // Point, line and polygon outline color\n getLineColor: { type: 'accessor', value: defaultLineColor },\n // Line and polygon outline accessors\n getLineWidth: { type: 'accessor', value: 1 },\n // Polygon extrusion accessor\n getElevation: { type: 'accessor', value: 1000 },\n // Optional material for 'lighting' shader module\n material: true\n};\n/** A composite layer that renders filled, stroked and/or extruded polygons. */\nclass PolygonLayer extends CompositeLayer {\n initializeState() {\n this.state = {\n paths: [],\n pathsDiff: null\n };\n if (this.props.getLineDashArray) {\n log.removed('getLineDashArray', 'PathStyleExtension')();\n }\n }\n updateState({ changeFlags }) {\n const geometryChanged = changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getPolygon));\n if (geometryChanged && Array.isArray(changeFlags.dataChanged)) {\n const paths = this.state.paths.slice();\n const pathsDiff = changeFlags.dataChanged.map(dataRange => replaceInRange({\n data: paths,\n getIndex: p => p.__source.index,\n dataRange,\n replace: this._getPaths(dataRange)\n }));\n this.setState({ paths, pathsDiff });\n }\n else if (geometryChanged) {\n this.setState({\n paths: this._getPaths(),\n pathsDiff: null\n });\n }\n }\n _getPaths(dataRange = {}) {\n const { data, getPolygon, positionFormat, _normalize } = this.props;\n const paths = [];\n const positionSize = positionFormat === 'XY' ? 2 : 3;\n const { startRow, endRow } = dataRange;\n const { iterable, objectInfo } = createIterable(data, startRow, endRow);\n for (const object of iterable) {\n objectInfo.index++;\n let polygon = getPolygon(object, objectInfo);\n if (_normalize) {\n polygon = Polygon.normalize(polygon, positionSize);\n }\n const { holeIndices } = polygon;\n const positions = polygon.positions || polygon;\n if (holeIndices) {\n // split the positions array into `holeIndices.length + 1` rings\n // holeIndices[-1] falls back to 0\n // holeIndices[holeIndices.length] falls back to positions.length\n for (let i = 0; i <= holeIndices.length; i++) {\n const path = positions.slice(holeIndices[i - 1] || 0, holeIndices[i] || positions.length);\n paths.push(this.getSubLayerRow({ path }, object, objectInfo.index));\n }\n }\n else {\n paths.push(this.getSubLayerRow({ path: positions }, object, objectInfo.index));\n }\n }\n return paths;\n }\n /* eslint-disable complexity */\n renderLayers() {\n // Layer composition props\n const { data, _dataDiff, stroked, filled, extruded, wireframe, _normalize, _windingOrder, elevationScale, transitions, positionFormat } = this.props;\n // Rendering props underlying layer\n const { lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels, lineJointRounded, lineMiterLimit, lineDashJustified } = this.props;\n // Accessor props for underlying layers\n const { getFillColor, getLineColor, getLineWidth, getLineDashArray, getElevation, getPolygon, updateTriggers, material } = this.props;\n const { paths, pathsDiff } = this.state;\n const FillLayer = this.getSubLayerClass('fill', SolidPolygonLayer);\n const StrokeLayer = this.getSubLayerClass('stroke', PathLayer);\n // Filled Polygon Layer\n const polygonLayer = this.shouldRenderSubLayer('fill', paths) &&\n new FillLayer({\n _dataDiff,\n extruded,\n elevationScale,\n filled,\n wireframe,\n _normalize,\n _windingOrder,\n getElevation,\n getFillColor,\n getLineColor: extruded && wireframe ? getLineColor : defaultLineColor,\n material,\n transitions\n }, this.getSubLayerProps({\n id: 'fill',\n updateTriggers: updateTriggers && {\n getPolygon: updateTriggers.getPolygon,\n getElevation: updateTriggers.getElevation,\n getFillColor: updateTriggers.getFillColor,\n // using a legacy API to invalid lineColor attributes\n // if (extruded && wireframe) has changed\n lineColors: extruded && wireframe,\n getLineColor: updateTriggers.getLineColor\n }\n }), {\n data,\n positionFormat,\n getPolygon\n });\n // Polygon line layer\n const polygonLineLayer = !extruded &&\n stroked &&\n this.shouldRenderSubLayer('stroke', paths) &&\n new StrokeLayer({\n _dataDiff: pathsDiff && (() => pathsDiff),\n widthUnits: lineWidthUnits,\n widthScale: lineWidthScale,\n widthMinPixels: lineWidthMinPixels,\n widthMaxPixels: lineWidthMaxPixels,\n jointRounded: lineJointRounded,\n miterLimit: lineMiterLimit,\n dashJustified: lineDashJustified,\n // Already normalized\n _pathType: 'loop',\n transitions: transitions && {\n getWidth: transitions.getLineWidth,\n getColor: transitions.getLineColor,\n getPath: transitions.getPolygon\n },\n getColor: this.getSubLayerAccessor(getLineColor),\n getWidth: this.getSubLayerAccessor(getLineWidth),\n getDashArray: this.getSubLayerAccessor(getLineDashArray)\n }, this.getSubLayerProps({\n id: 'stroke',\n updateTriggers: updateTriggers && {\n getWidth: updateTriggers.getLineWidth,\n getColor: updateTriggers.getLineColor,\n getDashArray: updateTriggers.getLineDashArray\n }\n }), {\n data: paths,\n positionFormat,\n getPath: x => x.path\n });\n return [\n // If not extruded: flat fill layer is drawn below outlines\n !extruded && polygonLayer,\n polygonLineLayer,\n // If extruded: draw fill layer last for correct blending behavior\n extruded && polygonLayer\n ];\n }\n}\nPolygonLayer.layerName = 'PolygonLayer';\nPolygonLayer.defaultProps = defaultProps;\nexport default PolygonLayer;\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 { Layer, project32, gouraudLighting, picking, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { Model, Geometry } from '@luma.gl/engine';\n// Polygon geometry generation is managed by the polygon tesselator\nimport PolygonTesselator from \"./polygon-tesselator.js\";\nimport vsTop from \"./solid-polygon-layer-vertex-top.glsl.js\";\nimport vsSide from \"./solid-polygon-layer-vertex-side.glsl.js\";\nimport fs from \"./solid-polygon-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n filled: true,\n extruded: false,\n wireframe: false,\n _normalize: true,\n _windingOrder: 'CW',\n _full3d: false,\n elevationScale: { type: 'number', min: 0, value: 1 },\n getPolygon: { type: 'accessor', value: (f) => f.polygon },\n getElevation: { type: 'accessor', value: 1000 },\n getFillColor: { type: 'accessor', value: DEFAULT_COLOR },\n getLineColor: { type: 'accessor', value: DEFAULT_COLOR },\n material: true\n};\nconst ATTRIBUTE_TRANSITION = {\n enter: (value, chunk) => {\n return chunk.length ? chunk.subarray(chunk.length - value.length) : value;\n }\n};\nclass SolidPolygonLayer extends Layer {\n getShaders(type) {\n return super.getShaders({\n vs: type === 'top' ? vsTop : vsSide,\n fs,\n defines: {\n RING_WINDING_ORDER_CW: !this.props._normalize && this.props._windingOrder === 'CCW' ? 0 : 1\n },\n modules: [project32, gouraudLighting, picking]\n });\n }\n get wrapLongitude() {\n return false;\n }\n getBounds() {\n return this.getAttributeManager()?.getBounds(['vertexPositions']);\n }\n initializeState() {\n const { viewport } = this.context;\n let { coordinateSystem } = this.props;\n const { _full3d } = this.props;\n if (viewport.isGeospatial && coordinateSystem === COORDINATE_SYSTEM.DEFAULT) {\n coordinateSystem = COORDINATE_SYSTEM.LNGLAT;\n }\n let preproject;\n if (coordinateSystem === COORDINATE_SYSTEM.LNGLAT) {\n if (_full3d) {\n preproject = viewport.projectPosition.bind(viewport);\n }\n else {\n preproject = viewport.projectFlat.bind(viewport);\n }\n }\n this.setState({\n numInstances: 0,\n polygonTesselator: new PolygonTesselator({\n // Lnglat coordinates are usually projected non-linearly, which affects tesselation results\n // Provide a preproject function if the coordinates are in lnglat\n preproject,\n fp64: this.use64bitPositions(),\n IndexType: Uint32Array\n })\n });\n const attributeManager = this.getAttributeManager();\n const noAlloc = true;\n attributeManager.remove(['instancePickingColors']);\n /* eslint-disable max-len */\n attributeManager.add({\n indices: {\n size: 1,\n isIndexed: true,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n update: this.calculateIndices,\n noAlloc\n },\n vertexPositions: {\n size: 3,\n type: 'float64',\n stepMode: 'dynamic',\n fp64: this.use64bitPositions(),\n transition: ATTRIBUTE_TRANSITION,\n accessor: 'getPolygon',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n update: this.calculatePositions,\n noAlloc,\n shaderAttributes: {\n nextVertexPositions: {\n vertexOffset: 1\n }\n }\n },\n instanceVertexValid: {\n size: 1,\n type: 'uint16',\n stepMode: 'instance',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n update: this.calculateVertexValid,\n noAlloc\n },\n elevations: {\n size: 1,\n stepMode: 'dynamic',\n transition: ATTRIBUTE_TRANSITION,\n accessor: 'getElevation'\n },\n fillColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n stepMode: 'dynamic',\n transition: ATTRIBUTE_TRANSITION,\n accessor: 'getFillColor',\n defaultValue: DEFAULT_COLOR\n },\n lineColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n stepMode: 'dynamic',\n transition: ATTRIBUTE_TRANSITION,\n accessor: 'getLineColor',\n defaultValue: DEFAULT_COLOR\n },\n pickingColors: {\n size: 4,\n type: 'uint8',\n stepMode: 'dynamic',\n accessor: (object, { index, target: value }) => this.encodePickingColor(object && object.__source ? object.__source.index : index, value)\n }\n });\n /* eslint-enable max-len */\n }\n getPickingInfo(params) {\n const info = super.getPickingInfo(params);\n const { index } = info;\n const data = this.props.data;\n // Check if data comes from a composite layer, wrapped with getSubLayerRow\n if (data[0] && data[0].__source) {\n // index decoded from picking color refers to the source index\n info.object = data.find(d => d.__source.index === index);\n }\n return info;\n }\n disablePickingIndex(objectIndex) {\n const data = this.props.data;\n // Check if data comes from a composite layer, wrapped with getSubLayerRow\n if (data[0] && data[0].__source) {\n // index decoded from picking color refers to the source index\n for (let i = 0; i < data.length; i++) {\n if (data[i].__source.index === objectIndex) {\n this._disablePickingIndex(i);\n }\n }\n }\n else {\n super.disablePickingIndex(objectIndex);\n }\n }\n draw({ uniforms }) {\n const { extruded, filled, wireframe, elevationScale } = this.props;\n const { topModel, sideModel, wireframeModel, polygonTesselator } = this.state;\n const renderUniforms = {\n ...uniforms,\n extruded: Boolean(extruded),\n elevationScale\n };\n // Note - the order is important\n if (wireframeModel && wireframe) {\n wireframeModel.setInstanceCount(polygonTesselator.instanceCount - 1);\n wireframeModel.setUniforms(renderUniforms);\n wireframeModel.draw(this.context.renderPass);\n }\n if (sideModel && filled) {\n sideModel.setInstanceCount(polygonTesselator.instanceCount - 1);\n sideModel.setUniforms(renderUniforms);\n sideModel.draw(this.context.renderPass);\n }\n if (topModel && filled) {\n topModel.setVertexCount(polygonTesselator.vertexCount);\n topModel.setUniforms(renderUniforms);\n topModel.draw(this.context.renderPass);\n }\n }\n updateState(updateParams) {\n super.updateState(updateParams);\n this.updateGeometry(updateParams);\n const { props, oldProps, changeFlags } = updateParams;\n const attributeManager = this.getAttributeManager();\n const regenerateModels = changeFlags.extensionsChanged ||\n props.filled !== oldProps.filled ||\n props.extruded !== oldProps.extruded;\n if (regenerateModels) {\n this.state.models?.forEach(model => model.destroy());\n this.setState(this._getModels());\n attributeManager.invalidateAll();\n }\n }\n updateGeometry({ props, oldProps, changeFlags }) {\n const geometryConfigChanged = changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getPolygon));\n // When the geometry config or the data is changed,\n // tessellator needs to be invoked\n if (geometryConfigChanged) {\n const { polygonTesselator } = this.state;\n const buffers = props.data.attributes || {};\n polygonTesselator.updateGeometry({\n data: props.data,\n normalize: props._normalize,\n geometryBuffer: buffers.getPolygon,\n buffers,\n getGeometry: props.getPolygon,\n positionFormat: props.positionFormat,\n wrapLongitude: props.wrapLongitude,\n // TODO - move the flag out of the viewport\n resolution: this.context.viewport.resolution,\n fp64: this.use64bitPositions(),\n dataChanged: changeFlags.dataChanged,\n full3d: props._full3d\n });\n this.setState({\n numInstances: polygonTesselator.instanceCount,\n startIndices: polygonTesselator.vertexStarts\n });\n if (!changeFlags.dataChanged) {\n // Base `layer.updateState` only invalidates all attributes on data change\n // Cover the rest of the scenarios here\n this.getAttributeManager().invalidateAll();\n }\n }\n }\n _getModels() {\n const { id, filled, extruded } = this.props;\n let topModel;\n let sideModel;\n let wireframeModel;\n if (filled) {\n const shaders = this.getShaders('top');\n shaders.defines.NON_INSTANCED_MODEL = 1;\n const bufferLayout = this.getAttributeManager().getBufferLayouts({ isInstanced: false });\n topModel = new Model(this.context.device, {\n ...shaders,\n id: `${id}-top`,\n topology: 'triangle-list',\n uniforms: {\n isWireframe: false\n },\n bufferLayout,\n isIndexed: true,\n userData: {\n excludeAttributes: { instanceVertexValid: true }\n }\n });\n }\n if (extruded) {\n const bufferLayout = this.getAttributeManager().getBufferLayouts({ isInstanced: true });\n sideModel = new Model(this.context.device, {\n ...this.getShaders('side'),\n id: `${id}-side`,\n bufferLayout,\n uniforms: {\n isWireframe: false\n },\n geometry: new Geometry({\n topology: 'triangle-strip',\n attributes: {\n // top right - top left - bottom right - bottom left\n positions: {\n size: 2,\n value: new Float32Array([1, 0, 0, 0, 1, 1, 0, 1])\n }\n }\n }),\n isInstanced: true,\n userData: {\n excludeAttributes: { indices: true }\n }\n });\n wireframeModel = new Model(this.context.device, {\n ...this.getShaders('side'),\n id: `${id}-wireframe`,\n bufferLayout,\n uniforms: {\n isWireframe: true\n },\n geometry: new Geometry({\n topology: 'line-strip',\n attributes: {\n // top right - top left - bottom left - bottom right\n positions: {\n size: 2,\n value: new Float32Array([1, 0, 0, 0, 0, 1, 1, 1])\n }\n }\n }),\n isInstanced: true,\n userData: {\n excludeAttributes: { indices: true }\n }\n });\n }\n return {\n models: [sideModel, wireframeModel, topModel].filter(Boolean),\n topModel,\n sideModel,\n wireframeModel\n };\n }\n calculateIndices(attribute) {\n const { polygonTesselator } = this.state;\n attribute.startIndices = polygonTesselator.indexStarts;\n attribute.value = polygonTesselator.get('indices');\n }\n calculatePositions(attribute) {\n const { polygonTesselator } = this.state;\n attribute.startIndices = polygonTesselator.vertexStarts;\n attribute.value = polygonTesselator.get('positions');\n }\n calculateVertexValid(attribute) {\n attribute.value = this.state.polygonTesselator.get('vertexValid');\n }\n}\nSolidPolygonLayer.defaultProps = defaultProps;\nSolidPolygonLayer.layerName = 'SolidPolygonLayer';\nexport default SolidPolygonLayer;\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.\n/* eslint-disable max-params */\nimport earcut from 'earcut';\nimport { modifyPolygonWindingDirection, WINDING } from '@math.gl/polygon';\nconst OUTER_POLYGON_WINDING = WINDING.CLOCKWISE;\nconst HOLE_POLYGON_WINDING = WINDING.COUNTER_CLOCKWISE;\n/** A scratch object for sending winding options */\nconst windingOptions = {\n isClosed: true\n};\n/**\n * Ensure a polygon is valid format\n */\nfunction validate(polygon) {\n polygon = (polygon && polygon.positions) || polygon;\n if (!Array.isArray(polygon) && !ArrayBuffer.isView(polygon)) {\n throw new Error('invalid polygon');\n }\n}\n/** Get the positions from a normalized polygon */\nexport function getPositions(polygon) {\n return 'positions' in polygon ? polygon.positions : polygon;\n}\n/** Get the hole indices from a normalized polygon */\nexport function getHoleIndices(polygon) {\n return 'holeIndices' in polygon ? polygon.holeIndices : null;\n}\n/**\n * Check if a polygon is nested or flat\n * Returns true if the polygon is a flat polygon (i.e. not an array of polygons)\n */\nfunction isNested(polygon) {\n return Array.isArray(polygon[0]);\n}\n/**\n * Check if a polygon is simple or complex\n * Returns true if the polygon is a simple polygon (i.e. not an array of polygons)\n */\nfunction isSimple(polygon) {\n return polygon.length >= 1 && polygon[0].length >= 2 && Number.isFinite(polygon[0][0]);\n}\n/**\n * Check if a simple polygon is a closed ring\n * Returns true if the simple polygon is a closed ring\n */\nfunction isNestedRingClosed(simplePolygon) {\n // check if first and last vertex are the same\n const p0 = simplePolygon[0];\n const p1 = simplePolygon[simplePolygon.length - 1];\n return p0[0] === p1[0] && p0[1] === p1[1] && p0[2] === p1[2];\n}\n/**\n * Check if a simple flat array is a closed ring\n * Returns true if the simple flat array is a closed ring\n */\nfunction isFlatRingClosed(positions, \n/** size of a position, 2 (xy) or 3 (xyz) */\nsize, \n/** start index of the path in the positions array */\nstartIndex, \n/** end index of the path in the positions array */\nendIndex) {\n for (let i = 0; i < size; i++) {\n if (positions[startIndex + i] !== positions[endIndex - size + i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Copy a simple polygon coordinates into a flat array, closes the ring if needed.\n * Returns the index of the write head in the destination\n */\nfunction copyNestedRing(\n/** destination */\ntarget, \n/** index in the destination to start copying into */\ntargetStartIndex, \n/** the source polygon */\nsimplePolygon, \n/** size of a position, 2 (xy) or 3 (xyz) */\nsize, \n/** modify polygon to be of the specified winding direction */\nwindingDirection) {\n let targetIndex = targetStartIndex;\n const len = simplePolygon.length;\n for (let i = 0; i < len; i++) {\n for (let j = 0; j < size; j++) {\n target[targetIndex++] = simplePolygon[i][j] || 0;\n }\n }\n if (!isNestedRingClosed(simplePolygon)) {\n for (let j = 0; j < size; j++) {\n target[targetIndex++] = simplePolygon[0][j] || 0;\n }\n }\n windingOptions.start = targetStartIndex;\n windingOptions.end = targetIndex;\n windingOptions.size = size;\n modifyPolygonWindingDirection(target, windingDirection, windingOptions);\n return targetIndex;\n}\n/**\n * Copy a simple flat array into another flat array, closes the ring if needed.\n * Returns the index of the write head in the destination\n */\nfunction copyFlatRing(\n/** destination */\ntarget, \n/** index in the destination to start copying into */\ntargetStartIndex, \n/** the source polygon */\npositions, \n/** size of a position, 2 (xy) or 3 (xyz) */\nsize, \n/** start index of the path in the positions array */\nsrcStartIndex = 0, \n/** end index of the path in the positions array */\nsrcEndIndex, windingDirection) {\n srcEndIndex = srcEndIndex || positions.length;\n const srcLength = srcEndIndex - srcStartIndex;\n if (srcLength <= 0) {\n return targetStartIndex;\n }\n let targetIndex = targetStartIndex;\n for (let i = 0; i < srcLength; i++) {\n target[targetIndex++] = positions[srcStartIndex + i];\n }\n if (!isFlatRingClosed(positions, size, srcStartIndex, srcEndIndex)) {\n for (let i = 0; i < size; i++) {\n target[targetIndex++] = positions[srcStartIndex + i];\n }\n }\n windingOptions.start = targetStartIndex;\n windingOptions.end = targetIndex;\n windingOptions.size = size;\n modifyPolygonWindingDirection(target, windingDirection, windingOptions);\n return targetIndex;\n}\n/**\n * Normalize any polygon representation into the \"complex flat\" format\n */\n/* eslint-disable max-statements */\nexport function normalize(polygon, positionSize) {\n validate(polygon);\n const positions = [];\n const holeIndices = [];\n if ('positions' in polygon) {\n // complex flat\n const { positions: srcPositions, holeIndices: srcHoleIndices } = polygon;\n if (srcHoleIndices) {\n let targetIndex = 0;\n // split the positions array into `holeIndices.length + 1` rings\n // holeIndices[-1] falls back to 0\n // holeIndices[holeIndices.length] falls back to positions.length\n for (let i = 0; i <= srcHoleIndices.length; i++) {\n targetIndex = copyFlatRing(positions, targetIndex, srcPositions, positionSize, srcHoleIndices[i - 1], srcHoleIndices[i], i === 0 ? OUTER_POLYGON_WINDING : HOLE_POLYGON_WINDING);\n holeIndices.push(targetIndex);\n }\n // The last one is not a starting index of a hole, remove\n holeIndices.pop();\n return { positions, holeIndices };\n }\n polygon = srcPositions;\n }\n if (!isNested(polygon)) {\n // simple flat\n copyFlatRing(positions, 0, polygon, positionSize, 0, positions.length, OUTER_POLYGON_WINDING);\n return positions;\n }\n if (!isSimple(polygon)) {\n // complex polygon\n let targetIndex = 0;\n for (const [polygonIndex, simplePolygon] of polygon.entries()) {\n targetIndex = copyNestedRing(positions, targetIndex, simplePolygon, positionSize, polygonIndex === 0 ? OUTER_POLYGON_WINDING : HOLE_POLYGON_WINDING);\n holeIndices.push(targetIndex);\n }\n // The last one is not a starting index of a hole, remove\n holeIndices.pop();\n // last index points to the end of the array, remove it\n return { positions, holeIndices };\n }\n // simple polygon\n copyNestedRing(positions, 0, polygon, positionSize, OUTER_POLYGON_WINDING);\n return positions;\n}\n/* eslint-enable max-statements */\n/*\n * Calculate the area of a single plane of the polygon\n */\nfunction getPlaneArea(positions, xIndex, yIndex) {\n const numVerts = positions.length / 3;\n let area = 0;\n for (let i = 0; i < numVerts; i++) {\n const j = (i + 1) % numVerts;\n area += positions[i * 3 + xIndex] * positions[j * 3 + yIndex];\n area -= positions[j * 3 + xIndex] * positions[i * 3 + yIndex];\n }\n return Math.abs(area / 2);\n}\nfunction permutePositions(positions, xIndex, yIndex, zIndex) {\n const numVerts = positions.length / 3;\n for (let i = 0; i < numVerts; i++) {\n const o = i * 3;\n const x = positions[o + 0];\n const y = positions[o + 1];\n const z = positions[o + 2];\n positions[o + xIndex] = x;\n positions[o + yIndex] = y;\n positions[o + zIndex] = z;\n }\n}\n/**\n * Get vertex indices for drawing polygon mesh (triangulation)\n */\n// eslint-disable-next-line complexity, max-statements\nexport function getSurfaceIndices(polygon, positionSize, preproject, full3d) {\n let holeIndices = getHoleIndices(polygon);\n if (holeIndices) {\n holeIndices = holeIndices.map(positionIndex => positionIndex / positionSize);\n }\n let positions = getPositions(polygon);\n const is3d = full3d && positionSize === 3;\n if (preproject) {\n // When tesselating lnglat coordinates, project them to the common space for accuracy\n const n = positions.length;\n // Clone the array\n positions = positions.slice();\n const p = [];\n for (let i = 0; i < n; i += positionSize) {\n p[0] = positions[i];\n p[1] = positions[i + 1];\n if (is3d) {\n p[2] = positions[i + 2];\n }\n const xy = preproject(p);\n positions[i] = xy[0];\n positions[i + 1] = xy[1];\n if (is3d) {\n positions[i + 2] = xy[2];\n }\n }\n }\n if (is3d) {\n // calculate plane with largest area\n const xyArea = getPlaneArea(positions, 0, 1);\n const xzArea = getPlaneArea(positions, 0, 2);\n const yzArea = getPlaneArea(positions, 1, 2);\n if (!xyArea && !xzArea && !yzArea) {\n return []; // no planes have area, nothing we can do\n }\n // permute positions to make the largest plane xy for earcut\n if (xyArea > xzArea && xyArea > yzArea) {\n // xy plane largest, nothing to do\n }\n else if (xzArea > yzArea) {\n // xz plane largest, permute to make xyz -> xzy\n if (!preproject) {\n positions = positions.slice();\n }\n permutePositions(positions, 0, 2, 1);\n }\n else {\n // yz plane largest, permute to make xyz -> yzx\n if (!preproject) {\n positions = positions.slice();\n }\n permutePositions(positions, 2, 0, 1);\n }\n }\n // Let earcut triangulate the polygon\n return earcut(positions, holeIndices, positionSize);\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.\n// Handles tesselation of polygons with holes\n// - 2D surfaces\n// - 2D outlines\n// - 3D surfaces (top and sides only)\n// - 3D wireframes (not yet)\nimport * as Polygon from \"./polygon.js\";\nimport { Tesselator } from '@deck.gl/core';\nimport { cutPolygonByGrid, cutPolygonByMercatorBounds } from '@math.gl/polygon';\n// This class is set up to allow querying one attribute at a time\n// the way the AttributeManager expects it\nexport default class PolygonTesselator extends Tesselator {\n constructor(opts) {\n const { fp64, IndexType = Uint32Array } = opts;\n super({\n ...opts,\n attributes: {\n positions: { size: 3, type: fp64 ? Float64Array : Float32Array },\n vertexValid: { type: Uint16Array, size: 1 },\n indices: { type: IndexType, size: 1 }\n }\n });\n }\n /** Get attribute by name */\n get(attributeName) {\n const { attributes } = this;\n if (attributeName === 'indices') {\n return attributes.indices && attributes.indices.subarray(0, this.vertexCount);\n }\n return attributes[attributeName];\n }\n /** Override base Tesselator method */\n updateGeometry(opts) {\n super.updateGeometry(opts);\n const externalIndices = this.buffers.indices;\n if (externalIndices) {\n // @ts-ignore (2339) value is not defined on TypedArray (fall through)\n this.vertexCount = (externalIndices.value || externalIndices).length;\n }\n else if (this.data && !this.getGeometry) {\n throw new Error('missing indices buffer');\n }\n }\n /** Implement base Tesselator interface */\n normalizeGeometry(polygon) {\n if (this.normalize) {\n const normalizedPolygon = Polygon.normalize(polygon, this.positionSize);\n if (this.opts.resolution) {\n return cutPolygonByGrid(Polygon.getPositions(normalizedPolygon), Polygon.getHoleIndices(normalizedPolygon), {\n size: this.positionSize,\n gridResolution: this.opts.resolution,\n edgeTypes: true\n });\n }\n if (this.opts.wrapLongitude) {\n return cutPolygonByMercatorBounds(Polygon.getPositions(normalizedPolygon), Polygon.getHoleIndices(normalizedPolygon), {\n size: this.positionSize,\n maxLatitude: 86,\n edgeTypes: true\n });\n }\n return normalizedPolygon;\n }\n // normalize is explicitly set to false, assume that user passed in already normalized polygons\n return polygon;\n }\n /** Implement base Tesselator interface */\n getGeometrySize(polygon) {\n if (isCut(polygon)) {\n let size = 0;\n for (const subPolygon of polygon) {\n size += this.getGeometrySize(subPolygon);\n }\n return size;\n }\n return Polygon.getPositions(polygon).length / this.positionSize;\n }\n /** Override base Tesselator method */\n getGeometryFromBuffer(buffer) {\n if (this.normalize || !this.buffers.indices) {\n return super.getGeometryFromBuffer(buffer);\n }\n // we don't need to read the positions if no normalization/tesselation\n return null;\n }\n /** Implement base Tesselator interface */\n updateGeometryAttributes(polygon, context) {\n if (polygon && isCut(polygon)) {\n for (const subPolygon of polygon) {\n const geometrySize = this.getGeometrySize(subPolygon);\n context.geometrySize = geometrySize;\n this.updateGeometryAttributes(subPolygon, context);\n context.vertexStart += geometrySize;\n context.indexStart = this.indexStarts[context.geometryIndex + 1];\n }\n }\n else {\n const normalizedPolygon = polygon;\n this._updateIndices(normalizedPolygon, context);\n this._updatePositions(normalizedPolygon, context);\n this._updateVertexValid(normalizedPolygon, context);\n }\n }\n // Flatten the indices array\n _updateIndices(polygon, { geometryIndex, vertexStart: offset, indexStart }) {\n const { attributes, indexStarts, typedArrayManager } = this;\n let target = attributes.indices;\n if (!target || !polygon) {\n return;\n }\n let i = indexStart;\n // 1. get triangulated indices for the internal areas\n const indices = Polygon.getSurfaceIndices(polygon, this.positionSize, this.opts.preproject, this.opts.full3d);\n // make sure the buffer is large enough\n target = typedArrayManager.allocate(target, indexStart + indices.length, {\n copy: true\n });\n // 2. offset each index by the number of indices in previous polygons\n for (let j = 0; j < indices.length; j++) {\n target[i++] = indices[j] + offset;\n }\n indexStarts[geometryIndex + 1] = indexStart + indices.length;\n attributes.indices = target;\n }\n // Flatten out all the vertices of all the sub subPolygons\n _updatePositions(polygon, { vertexStart, geometrySize }) {\n const { attributes: { positions }, positionSize } = this;\n if (!positions || !polygon) {\n return;\n }\n const polygonPositions = Polygon.getPositions(polygon);\n for (let i = vertexStart, j = 0; j < geometrySize; i++, j++) {\n const x = polygonPositions[j * positionSize];\n const y = polygonPositions[j * positionSize + 1];\n const z = positionSize > 2 ? polygonPositions[j * positionSize + 2] : 0;\n positions[i * 3] = x;\n positions[i * 3 + 1] = y;\n positions[i * 3 + 2] = z;\n }\n }\n _updateVertexValid(polygon, { vertexStart, geometrySize }) {\n const { positionSize } = this;\n const vertexValid = this.attributes.vertexValid;\n const holeIndices = polygon && Polygon.getHoleIndices(polygon);\n /* We are reusing the some buffer for `nextPositions` by offseting one vertex\n * to the left. As a result,\n * the last vertex of each ring overlaps with the first vertex of the next ring.\n * `vertexValid` is used to mark the end of each ring so we don't draw these\n * segments:\n positions A0 A1 A2 A3 A4 B0 B1 B2 C0 ...\n nextPositions A1 A2 A3 A4 B0 B1 B2 C0 C1 ...\n vertexValid 1 1 1 1 0 1 1 0 1 ...\n */\n if (polygon && polygon.edgeTypes) {\n vertexValid.set(polygon.edgeTypes, vertexStart);\n }\n else {\n vertexValid.fill(1, vertexStart, vertexStart + geometrySize);\n }\n if (holeIndices) {\n for (let j = 0; j < holeIndices.length; j++) {\n vertexValid[vertexStart + holeIndices[j] / positionSize - 1] = 0;\n }\n }\n vertexValid[vertexStart + geometrySize - 1] = 0;\n }\n}\nfunction isCut(polygon) {\n return Array.isArray(polygon) && polygon.length > 0 && !Number.isFinite(polygon[0]);\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.\nexport default `\\\nuniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\nin vec4 fillColors;\nin vec4 lineColors;\nin vec3 pickingColors;\nout vec4 vColor;\nstruct PolygonProps {\nvec3 positions;\nvec3 positions64Low;\nvec3 normal;\nfloat elevations;\n};\nvec3 project_offset_normal(vec3 vector) {\nif (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\nproject_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\nreturn normalize(vector * project_uCommonUnitsPerWorldUnit);\n}\nreturn project_normal(vector);\n}\nvoid calculatePosition(PolygonProps props) {\nvec3 pos = props.positions;\nvec3 pos64Low = props.positions64Low;\nvec3 normal = props.normal;\nvec4 colors = isWireframe ? lineColors : fillColors;\ngeometry.worldPosition = props.positions;\ngeometry.pickingColor = pickingColors;\nif (extruded) {\npos.z += props.elevations * elevationScale;\n}\ngl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (extruded) {\n#ifdef IS_SIDE_VERTEX\nnormal = project_offset_normal(normal);\n#else\nnormal = project_normal(normal);\n#endif\ngeometry.normal = normal;\nvec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, colors.a * opacity);\n} else {\nvColor = vec4(colors.rgb, colors.a * opacity);\n}\nDECKGL_FILTER_COLOR(vColor, 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 main from \"./solid-polygon-layer-vertex-main.glsl.js\";\nexport default `\\\n#version 300 es\n#define SHADER_NAME solid-polygon-layer-vertex-shader\nin vec3 vertexPositions;\nin vec3 vertexPositions64Low;\nin float elevations;\n${main}\nvoid main(void) {\nPolygonProps props;\nprops.positions = vertexPositions;\nprops.positions64Low = vertexPositions64Low;\nprops.elevations = elevations;\nprops.normal = vec3(0.0, 0.0, 1.0);\ncalculatePosition(props);\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 main from \"./solid-polygon-layer-vertex-main.glsl.js\";\nexport default `\\\n#version 300 es\n#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\nin vec2 positions;\nin vec3 vertexPositions;\nin vec3 nextVertexPositions;\nin vec3 vertexPositions64Low;\nin vec3 nextVertexPositions64Low;\nin float elevations;\nin float instanceVertexValid;\n${main}\nvoid main(void) {\nif(instanceVertexValid < 0.5){\ngl_Position = vec4(0.);\nreturn;\n}\nPolygonProps props;\nvec3 pos;\nvec3 pos64Low;\nvec3 nextPos;\nvec3 nextPos64Low;\n#if RING_WINDING_ORDER_CW == 1\npos = vertexPositions;\npos64Low = vertexPositions64Low;\nnextPos = nextVertexPositions;\nnextPos64Low = nextVertexPositions64Low;\n#else\npos = nextVertexPositions;\npos64Low = nextVertexPositions64Low;\nnextPos = vertexPositions;\nnextPos64Low = vertexPositions64Low;\n#endif\nprops.positions = mix(pos, nextPos, positions.x);\nprops.positions64Low = mix(pos64Low, nextPos64Low, positions.x);\nprops.normal = vec3(\npos.y - nextPos.y + (pos64Low.y - nextPos64Low.y),\nnextPos.x - pos.x + (nextPos64Low.x - pos64Low.x),\n0.0);\nprops.elevations = elevations * positions.y;\ncalculatePosition(props);\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME solid-polygon-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n", "// Assume data array is sorted by \n// Replaces the specified range with a new subarray\n// Mutates the data array\n// Returns {startRow, endRow} of the inserted items\nexport function replaceInRange({ data, getIndex, dataRange, replace }) {\n const { startRow = 0, endRow = Infinity } = dataRange;\n const count = data.length;\n let replaceStart = count;\n let replaceEnd = count;\n for (let i = 0; i < count; i++) {\n const row = getIndex(data[i]);\n if (replaceStart > i && row >= startRow) {\n replaceStart = i;\n }\n if (row >= endRow) {\n replaceEnd = i;\n break;\n }\n }\n let index = replaceStart;\n const dataLengthChanged = replaceEnd - replaceStart !== replace.length;\n // Save the items after replaceEnd before we overwrite data\n const endChunk = dataLengthChanged ? data.slice(replaceEnd) : undefined;\n // Insert new items\n for (let i = 0; i < replace.length; i++) {\n data[index++] = replace[i];\n }\n if (endChunk) {\n // Append items after replaceEnd\n for (let i = 0; i < endChunk.length; i++) {\n data[index++] = endChunk[i];\n }\n // Trim additional items\n data.length = index;\n }\n return {\n startRow: replaceStart,\n endRow: replaceStart + replace.length\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 } from '@deck.gl/core';\nimport { replaceInRange } from \"../utils.js\";\nimport { binaryToFeatureForAccesor } from \"./geojson-binary.js\";\nimport { POINT_LAYER, LINE_LAYER, POLYGON_LAYER, getDefaultProps, forwardProps } from \"./sub-layer-map.js\";\nimport { getGeojsonFeatures, separateGeojsonFeatures } from \"./geojson.js\";\nimport { createLayerPropsFromFeatures, createLayerPropsFromBinary } from \"./geojson-layer-props.js\";\nconst FEATURE_TYPES = ['points', 'linestrings', 'polygons'];\nconst defaultProps = {\n ...getDefaultProps(POINT_LAYER.circle),\n ...getDefaultProps(POINT_LAYER.icon),\n ...getDefaultProps(POINT_LAYER.text),\n ...getDefaultProps(LINE_LAYER),\n ...getDefaultProps(POLYGON_LAYER),\n // Overwrite sub layer defaults\n stroked: true,\n filled: true,\n extruded: false,\n wireframe: false,\n _full3d: false,\n iconAtlas: { type: 'object', value: null },\n iconMapping: { type: 'object', value: {} },\n getIcon: { type: 'accessor', value: f => f.properties.icon },\n getText: { type: 'accessor', value: f => f.properties.text },\n // Self props\n pointType: 'circle',\n // TODO: deprecated, remove in v9\n getRadius: { deprecatedFor: 'getPointRadius' }\n};\n/** Render GeoJSON formatted data as polygons, lines and points (circles, icons and/or texts). */\nclass GeoJsonLayer extends CompositeLayer {\n initializeState() {\n this.state = {\n layerProps: {},\n features: {},\n featuresDiff: {}\n };\n }\n updateState({ props, changeFlags }) {\n if (!changeFlags.dataChanged) {\n return;\n }\n const { data } = this.props;\n const binary = data && 'points' in data && 'polygons' in data && 'lines' in data;\n this.setState({ binary });\n if (binary) {\n this._updateStateBinary({ props, changeFlags });\n }\n else {\n this._updateStateJSON({ props, changeFlags });\n }\n }\n _updateStateBinary({ props, changeFlags }) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const layerProps = createLayerPropsFromBinary(props.data, this.encodePickingColor);\n this.setState({ layerProps });\n }\n _updateStateJSON({ props, changeFlags }) {\n const features = getGeojsonFeatures(props.data);\n const wrapFeature = this.getSubLayerRow.bind(this);\n let newFeatures = {};\n const featuresDiff = {};\n if (Array.isArray(changeFlags.dataChanged)) {\n const oldFeatures = this.state.features;\n for (const key in oldFeatures) {\n newFeatures[key] = oldFeatures[key].slice();\n featuresDiff[key] = [];\n }\n for (const dataRange of changeFlags.dataChanged) {\n const partialFeatures = separateGeojsonFeatures(features, wrapFeature, dataRange);\n for (const key in oldFeatures) {\n featuresDiff[key].push(replaceInRange({\n data: newFeatures[key],\n getIndex: f => f.__source.index,\n dataRange,\n replace: partialFeatures[key]\n }));\n }\n }\n }\n else {\n newFeatures = separateGeojsonFeatures(features, wrapFeature);\n }\n const layerProps = createLayerPropsFromFeatures(newFeatures, featuresDiff);\n this.setState({\n features: newFeatures,\n featuresDiff,\n layerProps\n });\n }\n getPickingInfo(params) {\n const info = super.getPickingInfo(params);\n const { index, sourceLayer } = info;\n info.featureType = FEATURE_TYPES.find(ft => sourceLayer.id.startsWith(`${this.id}-${ft}-`));\n if (index >= 0 && sourceLayer.id.startsWith(`${this.id}-points-text`) && this.state.binary) {\n info.index = this.props.data.points.globalFeatureIds.value[index];\n }\n return info;\n }\n _updateAutoHighlight(info) {\n // All sub layers except the points layer use source feature index to encode the picking color\n // The points layer uses indices from the points data array.\n const pointLayerIdPrefix = `${this.id}-points-`;\n const sourceIsPoints = info.featureType === 'points';\n for (const layer of this.getSubLayers()) {\n if (layer.id.startsWith(pointLayerIdPrefix) === sourceIsPoints) {\n layer.updateAutoHighlight(info);\n }\n }\n }\n _renderPolygonLayer() {\n const { extruded, wireframe } = this.props;\n const { layerProps } = this.state;\n const id = 'polygons-fill';\n const PolygonFillLayer = this.shouldRenderSubLayer(id, layerProps.polygons?.data) &&\n this.getSubLayerClass(id, POLYGON_LAYER.type);\n if (PolygonFillLayer) {\n const forwardedProps = forwardProps(this, POLYGON_LAYER.props);\n // Avoid building the lineColors attribute if wireframe is off\n const useLineColor = extruded && wireframe;\n if (!useLineColor) {\n delete forwardedProps.getLineColor;\n }\n // using a legacy API to invalid lineColor attributes\n forwardedProps.updateTriggers.lineColors = useLineColor;\n return new PolygonFillLayer(forwardedProps, this.getSubLayerProps({\n id,\n updateTriggers: forwardedProps.updateTriggers\n }), layerProps.polygons);\n }\n return null;\n }\n _renderLineLayers() {\n const { extruded, stroked } = this.props;\n const { layerProps } = this.state;\n const polygonStrokeLayerId = 'polygons-stroke';\n const lineStringsLayerId = 'linestrings';\n const PolygonStrokeLayer = !extruded &&\n stroked &&\n this.shouldRenderSubLayer(polygonStrokeLayerId, layerProps.polygonsOutline?.data) &&\n this.getSubLayerClass(polygonStrokeLayerId, LINE_LAYER.type);\n const LineStringsLayer = this.shouldRenderSubLayer(lineStringsLayerId, layerProps.lines?.data) &&\n this.getSubLayerClass(lineStringsLayerId, LINE_LAYER.type);\n if (PolygonStrokeLayer || LineStringsLayer) {\n const forwardedProps = forwardProps(this, LINE_LAYER.props);\n return [\n PolygonStrokeLayer &&\n new PolygonStrokeLayer(forwardedProps, this.getSubLayerProps({\n id: polygonStrokeLayerId,\n updateTriggers: forwardedProps.updateTriggers\n }), layerProps.polygonsOutline),\n LineStringsLayer &&\n new LineStringsLayer(forwardedProps, this.getSubLayerProps({\n id: lineStringsLayerId,\n updateTriggers: forwardedProps.updateTriggers\n }), layerProps.lines)\n ];\n }\n return null;\n }\n _renderPointLayers() {\n const { pointType } = this.props;\n const { layerProps, binary } = this.state;\n let { highlightedObjectIndex } = this.props;\n if (!binary && Number.isFinite(highlightedObjectIndex)) {\n // @ts-expect-error TODO - type non-binary data\n highlightedObjectIndex = layerProps.points.data.findIndex(d => d.__source.index === highlightedObjectIndex);\n }\n // Avoid duplicate sub layer ids\n const types = new Set(pointType.split('+'));\n const pointLayers = [];\n for (const type of types) {\n const id = `points-${type}`;\n const PointLayerMapping = POINT_LAYER[type];\n const PointsLayer = PointLayerMapping &&\n this.shouldRenderSubLayer(id, layerProps.points?.data) &&\n this.getSubLayerClass(id, PointLayerMapping.type);\n if (PointsLayer) {\n const forwardedProps = forwardProps(this, PointLayerMapping.props);\n let pointsLayerProps = layerProps.points;\n if (type === 'text' && binary) {\n // Picking colors are per-point but for text per-character are required\n // getPickingInfo() maps back to the correct index\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n // @ts-expect-error TODO - type binary data\n const { instancePickingColors, ...rest } = pointsLayerProps.data.attributes;\n pointsLayerProps = {\n ...pointsLayerProps,\n // @ts-expect-error TODO - type binary data\n data: { ...pointsLayerProps.data, attributes: rest }\n };\n }\n pointLayers.push(new PointsLayer(forwardedProps, this.getSubLayerProps({\n id,\n updateTriggers: forwardedProps.updateTriggers,\n highlightedObjectIndex\n }), pointsLayerProps));\n }\n }\n return pointLayers;\n }\n renderLayers() {\n const { extruded } = this.props;\n const polygonFillLayer = this._renderPolygonLayer();\n const lineLayers = this._renderLineLayers();\n const pointLayers = this._renderPointLayers();\n return [\n // If not extruded: flat fill layer is drawn below outlines\n !extruded && polygonFillLayer,\n lineLayers,\n pointLayers,\n // If extruded: draw fill layer last for correct blending behavior\n extruded && polygonFillLayer\n ];\n }\n getSubLayerAccessor(accessor) {\n const { binary } = this.state;\n if (!binary || typeof accessor !== 'function') {\n return super.getSubLayerAccessor(accessor);\n }\n return (object, info) => {\n const { data, index } = info;\n const feature = binaryToFeatureForAccesor(data, index);\n // @ts-ignore (TS2349) accessor is always function\n return accessor(feature, info);\n };\n }\n}\nGeoJsonLayer.layerName = 'GeoJsonLayer';\nGeoJsonLayer.defaultProps = defaultProps;\nexport default GeoJsonLayer;\n", "// This module implement some utility functions to work with\n// the geojson-binary format defined at loaders.gl:\n// https://github.com/visgl/loaders.gl/blob/master/modules/gis/docs/api-reference/geojson-to-binary.md\n/**\n * Return the feature for an accesor\n */\nexport function binaryToFeatureForAccesor(data, index) {\n if (!data) {\n return null;\n }\n const featureIndex = 'startIndices' in data ? data.startIndices[index] : index;\n const geometryIndex = data.featureIds.value[featureIndex];\n if (featureIndex !== -1) {\n return getPropertiesForIndex(data, geometryIndex, featureIndex);\n }\n return null;\n}\nfunction getPropertiesForIndex(data, propertiesIndex, numericPropsIndex) {\n const feature = {\n properties: { ...data.properties[propertiesIndex] }\n };\n for (const prop in data.numericProps) {\n feature.properties[prop] = data.numericProps[prop].value[numericPropsIndex];\n }\n return feature;\n}\n// Custom picking color to keep binary indexes\nexport function calculatePickingColors(geojsonBinary, encodePickingColor) {\n const pickingColors = {\n points: null,\n lines: null,\n polygons: null\n };\n for (const key in pickingColors) {\n const featureIds = geojsonBinary[key].globalFeatureIds.value;\n pickingColors[key] = new Uint8ClampedArray(featureIds.length * 3);\n const pickingColor = [];\n for (let i = 0; i < featureIds.length; i++) {\n encodePickingColor(featureIds[i], pickingColor);\n pickingColors[key][i * 3 + 0] = pickingColor[0];\n pickingColors[key][i * 3 + 1] = pickingColor[1];\n pickingColors[key][i * 3 + 2] = pickingColor[2];\n }\n }\n return pickingColors;\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, createIterable, log } from '@deck.gl/core';\nimport MultiIconLayer from \"./multi-icon-layer/multi-icon-layer.js\";\nimport FontAtlasManager, { DEFAULT_FONT_SETTINGS, setFontAtlasCacheLimit } from \"./font-atlas-manager.js\";\nimport { transformParagraph, getTextFromBuffer } from \"./utils.js\";\nimport TextBackgroundLayer from \"./text-background-layer/text-background-layer.js\";\nconst TEXT_ANCHOR = {\n start: 1,\n middle: 0,\n end: -1\n};\nconst ALIGNMENT_BASELINE = {\n top: 1,\n center: 0,\n bottom: -1\n};\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst DEFAULT_LINE_HEIGHT = 1.0;\nconst defaultProps = {\n billboard: true,\n sizeScale: 1,\n sizeUnits: 'pixels',\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n background: false,\n getBackgroundColor: { type: 'accessor', value: [255, 255, 255, 255] },\n getBorderColor: { type: 'accessor', value: DEFAULT_COLOR },\n getBorderWidth: { type: 'accessor', value: 0 },\n backgroundPadding: { type: 'array', value: [0, 0, 0, 0] },\n characterSet: { type: 'object', value: DEFAULT_FONT_SETTINGS.characterSet },\n fontFamily: DEFAULT_FONT_SETTINGS.fontFamily,\n fontWeight: DEFAULT_FONT_SETTINGS.fontWeight,\n lineHeight: DEFAULT_LINE_HEIGHT,\n outlineWidth: { type: 'number', value: 0, min: 0 },\n outlineColor: { type: 'color', value: DEFAULT_COLOR },\n fontSettings: { type: 'object', value: {}, compare: 1 },\n // auto wrapping options\n wordBreak: 'break-word',\n maxWidth: { type: 'number', value: -1 },\n getText: { type: 'accessor', value: (x) => x.text },\n getPosition: { type: 'accessor', value: (x) => x.position },\n getColor: { type: 'accessor', value: DEFAULT_COLOR },\n getSize: { type: 'accessor', value: 32 },\n getAngle: { type: 'accessor', value: 0 },\n getTextAnchor: { type: 'accessor', value: 'middle' },\n getAlignmentBaseline: { type: 'accessor', value: 'center' },\n getPixelOffset: { type: 'accessor', value: [0, 0] },\n // deprecated\n backgroundColor: { deprecatedFor: ['background', 'getBackgroundColor'] }\n};\n/** Render text labels at given coordinates. */\nclass TextLayer extends CompositeLayer {\n constructor() {\n super(...arguments);\n /** Returns the x, y, width, height of each text string, relative to pixel size.\n * Used to render the background.\n */\n this.getBoundingRect = (object, objectInfo) => {\n let { size: [width, height] } = this.transformParagraph(object, objectInfo);\n const { fontSize } = this.state.fontAtlasManager.props;\n width /= fontSize;\n height /= fontSize;\n const { getTextAnchor, getAlignmentBaseline } = this.props;\n const anchorX = TEXT_ANCHOR[typeof getTextAnchor === 'function' ? getTextAnchor(object, objectInfo) : getTextAnchor];\n const anchorY = ALIGNMENT_BASELINE[typeof getAlignmentBaseline === 'function'\n ? getAlignmentBaseline(object, objectInfo)\n : getAlignmentBaseline];\n return [((anchorX - 1) * width) / 2, ((anchorY - 1) * height) / 2, width, height];\n };\n /** Returns the x, y offsets of each character in a text string, in texture size.\n * Used to layout characters in the vertex shader.\n */\n this.getIconOffsets = (object, objectInfo) => {\n const { getTextAnchor, getAlignmentBaseline } = this.props;\n const { x, y, rowWidth, size: [width, height] } = this.transformParagraph(object, objectInfo);\n const anchorX = TEXT_ANCHOR[typeof getTextAnchor === 'function' ? getTextAnchor(object, objectInfo) : getTextAnchor];\n const anchorY = ALIGNMENT_BASELINE[typeof getAlignmentBaseline === 'function'\n ? getAlignmentBaseline(object, objectInfo)\n : getAlignmentBaseline];\n const numCharacters = x.length;\n const offsets = new Array(numCharacters * 2);\n let index = 0;\n for (let i = 0; i < numCharacters; i++) {\n // For a multi-line object, offset in x-direction needs consider\n // the row offset in the paragraph and the object offset in the row\n const rowOffset = ((1 - anchorX) * (width - rowWidth[i])) / 2;\n offsets[index++] = ((anchorX - 1) * width) / 2 + rowOffset + x[i];\n offsets[index++] = ((anchorY - 1) * height) / 2 + y[i];\n }\n return offsets;\n };\n }\n initializeState() {\n this.state = {\n styleVersion: 0,\n fontAtlasManager: new FontAtlasManager()\n };\n // Breaking change in v8.9\n if (this.props.maxWidth > 0) {\n log.warn('v8.9 breaking change: TextLayer maxWidth is now relative to text size')();\n }\n }\n // eslint-disable-next-line complexity\n updateState(params) {\n const { props, oldProps, changeFlags } = params;\n const textChanged = changeFlags.dataChanged ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getText));\n if (textChanged) {\n this._updateText();\n }\n const fontChanged = this._updateFontAtlas();\n const styleChanged = fontChanged ||\n props.lineHeight !== oldProps.lineHeight ||\n props.wordBreak !== oldProps.wordBreak ||\n props.maxWidth !== oldProps.maxWidth;\n if (styleChanged) {\n this.setState({\n styleVersion: this.state.styleVersion + 1\n });\n }\n }\n getPickingInfo({ info }) {\n // because `TextLayer` assign the same pickingInfoIndex for one text label,\n // here info.index refers the index of text label in props.data\n info.object = info.index >= 0 ? this.props.data[info.index] : null;\n return info;\n }\n /** Returns true if font has changed */\n _updateFontAtlas() {\n const { fontSettings, fontFamily, fontWeight } = this.props;\n const { fontAtlasManager, characterSet } = this.state;\n const fontProps = {\n ...fontSettings,\n characterSet,\n fontFamily,\n fontWeight\n };\n if (!fontAtlasManager.mapping) {\n // This is the first update\n fontAtlasManager.setProps(fontProps);\n return true;\n }\n for (const key in fontProps) {\n if (fontProps[key] !== fontAtlasManager.props[key]) {\n fontAtlasManager.setProps(fontProps);\n return true;\n }\n }\n return false;\n }\n // Text strings are variable width objects\n // Count characters and start offsets\n _updateText() {\n const { data, characterSet } = this.props;\n const textBuffer = data.attributes?.getText;\n let { getText } = this.props;\n let startIndices = data.startIndices;\n let numInstances;\n const autoCharacterSet = characterSet === 'auto' && new Set();\n if (textBuffer && startIndices) {\n const { texts, characterCount } = getTextFromBuffer({\n ...(ArrayBuffer.isView(textBuffer) ? { value: textBuffer } : textBuffer),\n // @ts-ignore if data.attribute is defined then length is expected\n length: data.length,\n startIndices,\n characterSet: autoCharacterSet\n });\n numInstances = characterCount;\n getText = (_, { index }) => texts[index];\n }\n else {\n const { iterable, objectInfo } = createIterable(data);\n startIndices = [0];\n numInstances = 0;\n for (const object of iterable) {\n objectInfo.index++;\n // Break into an array of characters\n // When dealing with double-length unicode characters, `str.length` or `str[i]` do not work\n const text = Array.from(getText(object, objectInfo) || '');\n if (autoCharacterSet) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n text.forEach(autoCharacterSet.add, autoCharacterSet);\n }\n numInstances += text.length;\n startIndices.push(numInstances);\n }\n }\n this.setState({\n getText,\n startIndices,\n numInstances,\n characterSet: autoCharacterSet || characterSet\n });\n }\n /** There are two size systems in this layer:\n \n + Pixel size: user-specified text size, via getSize, sizeScale, sizeUnits etc.\n The layer roughly matches the output of the layer to CSS pixels, e.g. getSize: 12, sizeScale: 2\n in layer props is roughly equivalent to font-size: 24px in CSS.\n + Texture size: internally, character positions in a text blob are calculated using the sizes of iconMapping,\n which depends on how large each character is drawn into the font atlas. This is controlled by\n fontSettings.fontSize (default 64) and most users do not set it manually.\n These numbers are intended to be used in the vertex shader and never to be exposed to the end user.\n \n All surfaces exposed to the user should either use the pixel size or a multiplier relative to the pixel size. */\n /** Calculate the size and position of each character in a text string.\n * Values are in texture size */\n transformParagraph(object, objectInfo) {\n const { fontAtlasManager } = this.state;\n const iconMapping = fontAtlasManager.mapping;\n const getText = this.state.getText;\n const { wordBreak, lineHeight, maxWidth } = this.props;\n const paragraph = getText(object, objectInfo) || '';\n return transformParagraph(paragraph, lineHeight, wordBreak, maxWidth * fontAtlasManager.props.fontSize, iconMapping);\n }\n renderLayers() {\n const { startIndices, numInstances, getText, fontAtlasManager: { scale, atlas, mapping }, styleVersion } = this.state;\n const { data, _dataDiff, getPosition, getColor, getSize, getAngle, getPixelOffset, getBackgroundColor, getBorderColor, getBorderWidth, backgroundPadding, background, billboard, fontSettings, outlineWidth, outlineColor, sizeScale, sizeUnits, sizeMinPixels, sizeMaxPixels, transitions, updateTriggers } = this.props;\n const CharactersLayerClass = this.getSubLayerClass('characters', MultiIconLayer);\n const BackgroundLayerClass = this.getSubLayerClass('background', TextBackgroundLayer);\n return [\n background &&\n new BackgroundLayerClass({\n // background props\n getFillColor: getBackgroundColor,\n getLineColor: getBorderColor,\n getLineWidth: getBorderWidth,\n padding: backgroundPadding,\n // props shared with characters layer\n getPosition,\n getSize,\n getAngle,\n getPixelOffset,\n billboard,\n sizeScale,\n sizeUnits,\n sizeMinPixels,\n sizeMaxPixels,\n transitions: transitions && {\n getPosition: transitions.getPosition,\n getAngle: transitions.getAngle,\n getSize: transitions.getSize,\n getFillColor: transitions.getBackgroundColor,\n getLineColor: transitions.getBorderColor,\n getLineWidth: transitions.getBorderWidth,\n getPixelOffset: transitions.getPixelOffset\n }\n }, this.getSubLayerProps({\n id: 'background',\n updateTriggers: {\n getPosition: updateTriggers.getPosition,\n getAngle: updateTriggers.getAngle,\n getSize: updateTriggers.getSize,\n getFillColor: updateTriggers.getBackgroundColor,\n getLineColor: updateTriggers.getBorderColor,\n getLineWidth: updateTriggers.getBorderWidth,\n getPixelOffset: updateTriggers.getPixelOffset,\n getBoundingRect: {\n getText: updateTriggers.getText,\n getTextAnchor: updateTriggers.getTextAnchor,\n getAlignmentBaseline: updateTriggers.getAlignmentBaseline,\n styleVersion\n }\n }\n }), {\n data: \n // @ts-ignore (2339) attribute is not defined on all data types\n data.attributes && data.attributes.background\n ? // @ts-ignore (2339) attribute is not defined on all data types\n { length: data.length, attributes: data.attributes.background }\n : data,\n _dataDiff,\n // Maintain the same background behavior as <=8.3. Remove in v9?\n autoHighlight: false,\n getBoundingRect: this.getBoundingRect\n }),\n new CharactersLayerClass({\n sdf: fontSettings.sdf,\n smoothing: Number.isFinite(fontSettings.smoothing)\n ? fontSettings.smoothing\n : DEFAULT_FONT_SETTINGS.smoothing,\n outlineWidth: outlineWidth / (fontSettings.radius || DEFAULT_FONT_SETTINGS.radius),\n outlineColor,\n iconAtlas: atlas,\n iconMapping: mapping,\n getPosition,\n getColor,\n getSize,\n getAngle,\n getPixelOffset,\n billboard,\n sizeScale: sizeScale * scale,\n sizeUnits,\n sizeMinPixels: sizeMinPixels * scale,\n sizeMaxPixels: sizeMaxPixels * scale,\n transitions: transitions && {\n getPosition: transitions.getPosition,\n getAngle: transitions.getAngle,\n getColor: transitions.getColor,\n getSize: transitions.getSize,\n getPixelOffset: transitions.getPixelOffset\n }\n }, this.getSubLayerProps({\n id: 'characters',\n updateTriggers: {\n all: updateTriggers.getText,\n getPosition: updateTriggers.getPosition,\n getAngle: updateTriggers.getAngle,\n getColor: updateTriggers.getColor,\n getSize: updateTriggers.getSize,\n getPixelOffset: updateTriggers.getPixelOffset,\n getIconOffsets: {\n getTextAnchor: updateTriggers.getTextAnchor,\n getAlignmentBaseline: updateTriggers.getAlignmentBaseline,\n styleVersion\n }\n }\n }), {\n data,\n _dataDiff,\n startIndices,\n numInstances,\n getIconOffsets: this.getIconOffsets,\n getIcon: getText\n })\n ];\n }\n static set fontAtlasCacheLimit(limit) {\n setFontAtlasCacheLimit(limit);\n }\n}\nTextLayer.defaultProps = defaultProps;\nTextLayer.layerName = 'TextLayer';\nexport default TextLayer;\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 { log } from '@deck.gl/core';\nimport IconLayer from \"../../icon-layer/icon-layer.js\";\nimport fs from \"./multi-icon-layer-fragment.glsl.js\";\n// TODO expose as layer properties\nconst DEFAULT_BUFFER = 192.0 / 256;\nconst EMPTY_ARRAY = [];\nconst defaultProps = {\n getIconOffsets: { type: 'accessor', value: (x) => x.offsets },\n alphaCutoff: 0.001,\n smoothing: 0.1,\n outlineWidth: 0,\n outlineColor: { type: 'color', value: [0, 0, 0, 255] }\n};\nclass MultiIconLayer extends IconLayer {\n getShaders() {\n return { ...super.getShaders(), fs };\n }\n initializeState() {\n super.initializeState();\n const attributeManager = this.getAttributeManager();\n attributeManager.addInstanced({\n instanceOffsets: {\n size: 2,\n accessor: 'getIconOffsets'\n },\n instancePickingColors: {\n type: 'uint8',\n size: 3,\n accessor: (object, { index, target: value }) => this.encodePickingColor(index, value)\n }\n });\n }\n updateState(params) {\n super.updateState(params);\n const { props, oldProps } = params;\n let { outlineColor } = props;\n if (outlineColor !== oldProps.outlineColor) {\n outlineColor = outlineColor.map(x => x / 255);\n outlineColor[3] = Number.isFinite(outlineColor[3]) ? outlineColor[3] : 1;\n this.setState({\n outlineColor\n });\n }\n if (!props.sdf && props.outlineWidth) {\n log.warn(`${this.id}: fontSettings.sdf is required to render outline`)();\n }\n }\n draw(params) {\n const { sdf, smoothing, outlineWidth } = this.props;\n const { outlineColor } = this.state;\n const outlineBuffer = outlineWidth\n ? Math.max(smoothing, DEFAULT_BUFFER * (1 - outlineWidth))\n : -1;\n params.uniforms = {\n ...params.uniforms,\n // Refer the following doc about gamma and buffer\n // https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-mapbox-gl-b0933af6f817\n sdfBuffer: DEFAULT_BUFFER,\n outlineBuffer,\n gamma: smoothing,\n sdf: Boolean(sdf),\n outlineColor\n };\n super.draw(params);\n // draw text without outline on top to ensure a thick outline won't occlude other characters\n if (sdf && outlineWidth) {\n const { iconManager } = this.state;\n const iconsTexture = iconManager.getTexture();\n const model = this.state.model;\n if (iconsTexture) {\n model.setUniforms({ outlineBuffer: DEFAULT_BUFFER });\n model.draw(this.context.renderPass);\n }\n }\n }\n getInstanceOffset(icons) {\n return icons ? Array.from(icons).flatMap(icon => super.getInstanceOffset(icon)) : EMPTY_ARRAY;\n }\n getInstanceColorMode(icons) {\n return 1; // mask\n }\n getInstanceIconFrame(icons) {\n return icons\n ? Array.from(icons).flatMap(icon => super.getInstanceIconFrame(icon))\n : EMPTY_ARRAY;\n }\n}\nMultiIconLayer.defaultProps = defaultProps;\nMultiIconLayer.layerName = 'MultiIconLayer';\nexport default MultiIconLayer;\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.\nexport default `\\\n#version 300 es\n#define SHADER_NAME multi-icon-layer-fragment-shader\nprecision highp float;\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float sdfBuffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\nin vec4 vColor;\nin vec2 vTextureCoords;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nif (!bool(picking.isActive)) {\nfloat alpha = texture(iconsTexture, vTextureCoords).a;\nvec4 color = vColor;\nif (sdf) {\nfloat distance = alpha;\nalpha = smoothstep(sdfBuffer - gamma, sdfBuffer + gamma, distance);\nif (outlineBuffer > 0.0) {\nfloat inFill = alpha;\nfloat inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\ncolor = mix(outlineColor, vColor, inFill);\nalpha = inBorder;\n}\n}\nfloat a = alpha * color.a;\nif (a < alphaCutoff) {\ndiscard;\n}\nfragColor = vec4(color.rgb, a * opacity);\n}\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n", "/* global document */\nimport TinySDF from '@mapbox/tiny-sdf';\nimport { log } from '@deck.gl/core';\nimport { buildMapping } from \"./utils.js\";\nimport LRUCache from \"./lru-cache.js\";\n// import type {Texture} from '@deck.gl/core';\nfunction getDefaultCharacterSet() {\n const charSet = [];\n for (let i = 32; i < 128; i++) {\n charSet.push(String.fromCharCode(i));\n }\n return charSet;\n}\nexport const DEFAULT_FONT_SETTINGS = {\n fontFamily: 'Monaco, monospace',\n fontWeight: 'normal',\n characterSet: getDefaultCharacterSet(),\n fontSize: 64,\n buffer: 4,\n sdf: false,\n cutoff: 0.25,\n radius: 12,\n smoothing: 0.1\n};\nconst MAX_CANVAS_WIDTH = 1024;\nconst BASELINE_SCALE = 0.9;\nconst HEIGHT_SCALE = 1.2;\n// only preserve latest three fontAtlas\nconst CACHE_LIMIT = 3;\nlet cache = new LRUCache(CACHE_LIMIT);\n/**\n * get all the chars not in cache\n * @returns chars not in cache\n */\nfunction getNewChars(cacheKey, characterSet) {\n let newCharSet;\n if (typeof characterSet === 'string') {\n newCharSet = new Set(Array.from(characterSet));\n }\n else {\n newCharSet = new Set(characterSet);\n }\n const cachedFontAtlas = cache.get(cacheKey);\n if (!cachedFontAtlas) {\n return newCharSet;\n }\n for (const char in cachedFontAtlas.mapping) {\n if (newCharSet.has(char)) {\n newCharSet.delete(char);\n }\n }\n return newCharSet;\n}\nfunction populateAlphaChannel(alphaChannel, imageData) {\n // populate distance value from tinySDF to image alpha channel\n for (let i = 0; i < alphaChannel.length; i++) {\n imageData.data[4 * i + 3] = alphaChannel[i];\n }\n}\nfunction setTextStyle(ctx, fontFamily, fontSize, fontWeight) {\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n ctx.fillStyle = '#000';\n ctx.textBaseline = 'alphabetic';\n ctx.textAlign = 'left';\n}\n/**\n * Sets the Font Atlas LRU Cache Limit\n * @param {number} limit LRU Cache limit\n */\nexport function setFontAtlasCacheLimit(limit) {\n log.assert(Number.isFinite(limit) && limit >= CACHE_LIMIT, 'Invalid cache limit');\n cache = new LRUCache(limit);\n}\nexport default class FontAtlasManager {\n constructor() {\n /** Font settings */\n this.props = { ...DEFAULT_FONT_SETTINGS };\n }\n get atlas() {\n return this._atlas;\n }\n // TODO - cut during v9 porting as types reveal this is not correct\n // get texture(): Texture | undefined {\n // return this._atlas;\n // }\n get mapping() {\n return this._atlas && this._atlas.mapping;\n }\n get scale() {\n const { fontSize, buffer } = this.props;\n return (fontSize * HEIGHT_SCALE + buffer * 2) / fontSize;\n }\n setProps(props = {}) {\n Object.assign(this.props, props);\n // update cache key\n this._key = this._getKey();\n const charSet = getNewChars(this._key, this.props.characterSet);\n const cachedFontAtlas = cache.get(this._key);\n // if a fontAtlas associated with the new settings is cached and\n // there are no new chars\n if (cachedFontAtlas && charSet.size === 0) {\n // update texture with cached fontAtlas\n if (this._atlas !== cachedFontAtlas) {\n this._atlas = cachedFontAtlas;\n }\n return;\n }\n // update fontAtlas with new settings\n const fontAtlas = this._generateFontAtlas(charSet, cachedFontAtlas);\n this._atlas = fontAtlas;\n // update cache\n cache.set(this._key, fontAtlas);\n }\n // eslint-disable-next-line max-statements\n _generateFontAtlas(characterSet, cachedFontAtlas) {\n const { fontFamily, fontWeight, fontSize, buffer, sdf, radius, cutoff } = this.props;\n let canvas = cachedFontAtlas && cachedFontAtlas.data;\n if (!canvas) {\n canvas = document.createElement('canvas');\n canvas.width = MAX_CANVAS_WIDTH;\n }\n const ctx = canvas.getContext('2d', { willReadFrequently: true });\n setTextStyle(ctx, fontFamily, fontSize, fontWeight);\n // 1. build mapping\n const { mapping, canvasHeight, xOffset, yOffset } = buildMapping({\n getFontWidth: char => ctx.measureText(char).width,\n fontHeight: fontSize * HEIGHT_SCALE,\n buffer,\n characterSet,\n maxCanvasWidth: MAX_CANVAS_WIDTH,\n ...(cachedFontAtlas && {\n mapping: cachedFontAtlas.mapping,\n xOffset: cachedFontAtlas.xOffset,\n yOffset: cachedFontAtlas.yOffset\n })\n });\n // 2. update canvas\n // copy old canvas data to new canvas only when height changed\n if (canvas.height !== canvasHeight) {\n const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n canvas.height = canvasHeight;\n ctx.putImageData(imageData, 0, 0);\n }\n setTextStyle(ctx, fontFamily, fontSize, fontWeight);\n // 3. layout characters\n if (sdf) {\n const tinySDF = new TinySDF({\n fontSize,\n buffer,\n radius,\n cutoff,\n fontFamily,\n fontWeight: `${fontWeight}`\n });\n for (const char of characterSet) {\n const { data, width, height, glyphTop } = tinySDF.draw(char);\n mapping[char].width = width;\n mapping[char].layoutOffsetY = fontSize * BASELINE_SCALE - glyphTop;\n const imageData = ctx.createImageData(width, height);\n populateAlphaChannel(data, imageData);\n ctx.putImageData(imageData, mapping[char].x, mapping[char].y);\n }\n }\n else {\n for (const char of characterSet) {\n ctx.fillText(char, mapping[char].x, mapping[char].y + buffer + fontSize * BASELINE_SCALE);\n }\n }\n return {\n xOffset,\n yOffset,\n mapping,\n data: canvas,\n width: canvas.width,\n height: canvas.height\n };\n }\n _getKey() {\n const { fontFamily, fontWeight, fontSize, buffer, sdf, radius, cutoff } = this.props;\n if (sdf) {\n return `${fontFamily} ${fontWeight} ${fontSize} ${buffer} ${radius} ${cutoff}`;\n }\n return `${fontFamily} ${fontWeight} ${fontSize} ${buffer}`;\n }\n}\n", "/* eslint-disable max-statements, max-params, complexity, max-depth */\n// TODO merge with icon-layer/icon-manager\nimport { log } from '@deck.gl/core';\nconst MISSING_CHAR_WIDTH = 32;\nconst SINGLE_LINE = [];\nexport function nextPowOfTwo(number) {\n return Math.pow(2, Math.ceil(Math.log2(number)));\n}\n/**\n * Generate character mapping table or update from an existing mapping table\n */\nexport function buildMapping({ characterSet, getFontWidth, fontHeight, buffer, maxCanvasWidth, mapping = {}, xOffset = 0, yOffset = 0 }) {\n let row = 0;\n // continue from x position of last character in the old mapping\n let x = xOffset;\n const rowHeight = fontHeight + buffer * 2;\n for (const char of characterSet) {\n if (!mapping[char]) {\n // measure texts\n // TODO - use Advanced text metrics when they are adopted:\n // https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics\n const width = getFontWidth(char);\n if (x + width + buffer * 2 > maxCanvasWidth) {\n x = 0;\n row++;\n }\n mapping[char] = {\n x: x + buffer,\n y: yOffset + row * rowHeight + buffer,\n width,\n height: rowHeight,\n layoutWidth: width,\n layoutHeight: fontHeight\n };\n x += width + buffer * 2;\n }\n }\n return {\n mapping,\n xOffset: x,\n yOffset: yOffset + row * rowHeight,\n canvasHeight: nextPowOfTwo(yOffset + (row + 1) * rowHeight)\n };\n}\nfunction getTextWidth(text, startIndex, endIndex, mapping) {\n let width = 0;\n for (let i = startIndex; i < endIndex; i++) {\n const character = text[i];\n width += mapping[character]?.layoutWidth || 0;\n }\n return width;\n}\nfunction breakAll(text, startIndex, endIndex, maxWidth, iconMapping, target) {\n let rowStartCharIndex = startIndex;\n let rowOffsetLeft = 0;\n for (let i = startIndex; i < endIndex; i++) {\n // 2. figure out where to break lines\n const textWidth = getTextWidth(text, i, i + 1, iconMapping);\n if (rowOffsetLeft + textWidth > maxWidth) {\n if (rowStartCharIndex < i) {\n target.push(i);\n }\n rowStartCharIndex = i;\n rowOffsetLeft = 0;\n }\n rowOffsetLeft += textWidth;\n }\n return rowOffsetLeft;\n}\nfunction breakWord(text, startIndex, endIndex, maxWidth, iconMapping, target) {\n let rowStartCharIndex = startIndex;\n let groupStartCharIndex = startIndex;\n let groupEndCharIndex = startIndex;\n let rowOffsetLeft = 0;\n for (let i = startIndex; i < endIndex; i++) {\n // 1. break text into word groups\n // - if current char is white space\n // - else if next char is white space\n // - else if reach last char\n if (text[i] === ' ') {\n groupEndCharIndex = i + 1;\n }\n else if (text[i + 1] === ' ' || i + 1 === endIndex) {\n groupEndCharIndex = i + 1;\n }\n if (groupEndCharIndex > groupStartCharIndex) {\n // 2. break text into next row at maxWidth\n let groupWidth = getTextWidth(text, groupStartCharIndex, groupEndCharIndex, iconMapping);\n if (rowOffsetLeft + groupWidth > maxWidth) {\n if (rowStartCharIndex < groupStartCharIndex) {\n target.push(groupStartCharIndex);\n rowStartCharIndex = groupStartCharIndex;\n rowOffsetLeft = 0;\n }\n // if a single text group is bigger than maxWidth, then `break-all`\n if (groupWidth > maxWidth) {\n groupWidth = breakAll(text, groupStartCharIndex, groupEndCharIndex, maxWidth, iconMapping, target);\n // move reference to last row\n rowStartCharIndex = target[target.length - 1];\n }\n }\n groupStartCharIndex = groupEndCharIndex;\n rowOffsetLeft += groupWidth;\n }\n }\n return rowOffsetLeft;\n}\n/**\n * Wrap the given text so that each line does not exceed the given max width.\n * Returns a list of indices where line breaks should be inserted.\n */\nexport function autoWrapping(text, wordBreak, maxWidth, iconMapping, startIndex = 0, endIndex) {\n if (endIndex === undefined) {\n endIndex = text.length;\n }\n const result = [];\n if (wordBreak === 'break-all') {\n breakAll(text, startIndex, endIndex, maxWidth, iconMapping, result);\n }\n else {\n breakWord(text, startIndex, endIndex, maxWidth, iconMapping, result);\n }\n return result;\n}\nfunction transformRow(line, startIndex, endIndex, iconMapping, leftOffsets, rowSize) {\n let x = 0;\n let rowHeight = 0;\n for (let i = startIndex; i < endIndex; i++) {\n const character = line[i];\n const frame = iconMapping[character];\n if (frame) {\n if (!rowHeight) {\n // frame.height should be a constant\n rowHeight = frame.layoutHeight;\n }\n leftOffsets[i] = x + frame.layoutWidth / 2;\n x += frame.layoutWidth;\n }\n else {\n log.warn(`Missing character: ${character} (${character.codePointAt(0)})`)();\n leftOffsets[i] = x;\n x += MISSING_CHAR_WIDTH;\n }\n }\n rowSize[0] = x;\n rowSize[1] = rowHeight;\n}\n/**\n * Transform a text paragraph to an array of characters, each character contains\n */\nexport function transformParagraph(paragraph, \n/** CSS line-height */\nlineHeight, \n/** CSS word-break option */\nwordBreak, \n/** CSS max-width */\nmaxWidth, \n/** character mapping table for retrieving a character from font atlas */\niconMapping) {\n // Break into an array of characters\n // When dealing with double-length unicode characters, `str.length` or `str[i]` do not work\n const characters = Array.from(paragraph);\n const numCharacters = characters.length;\n const x = new Array(numCharacters);\n const y = new Array(numCharacters);\n const rowWidth = new Array(numCharacters);\n const autoWrappingEnabled = (wordBreak === 'break-word' || wordBreak === 'break-all') && isFinite(maxWidth) && maxWidth > 0;\n // maxWidth and height of the paragraph\n const size = [0, 0];\n const rowSize = [0, 0];\n let rowOffsetTop = 0;\n let lineStartIndex = 0;\n let lineEndIndex = 0;\n for (let i = 0; i <= numCharacters; i++) {\n const char = characters[i];\n if (char === '\\n' || i === numCharacters) {\n lineEndIndex = i;\n }\n if (lineEndIndex > lineStartIndex) {\n const rows = autoWrappingEnabled\n ? autoWrapping(characters, wordBreak, maxWidth, iconMapping, lineStartIndex, lineEndIndex)\n : SINGLE_LINE;\n for (let rowIndex = 0; rowIndex <= rows.length; rowIndex++) {\n const rowStart = rowIndex === 0 ? lineStartIndex : rows[rowIndex - 1];\n const rowEnd = rowIndex < rows.length ? rows[rowIndex] : lineEndIndex;\n transformRow(characters, rowStart, rowEnd, iconMapping, x, rowSize);\n for (let j = rowStart; j < rowEnd; j++) {\n const char = characters[j];\n const layoutOffsetY = iconMapping[char]?.layoutOffsetY || 0;\n y[j] = rowOffsetTop + rowSize[1] / 2 + layoutOffsetY;\n rowWidth[j] = rowSize[0];\n }\n rowOffsetTop = rowOffsetTop + rowSize[1] * lineHeight;\n size[0] = Math.max(size[0], rowSize[0]);\n }\n lineStartIndex = lineEndIndex;\n }\n if (char === '\\n') {\n // Make sure result.length matches paragraph.length\n x[lineStartIndex] = 0;\n y[lineStartIndex] = 0;\n rowWidth[lineStartIndex] = 0;\n lineStartIndex++;\n }\n }\n // last row\n size[1] = rowOffsetTop;\n return { x, y, rowWidth, size };\n}\nexport function getTextFromBuffer({ value, length, stride, offset, startIndices, characterSet }) {\n const bytesPerElement = value.BYTES_PER_ELEMENT;\n const elementStride = stride ? stride / bytesPerElement : 1;\n const elementOffset = offset ? offset / bytesPerElement : 0;\n const characterCount = startIndices[length] || Math.ceil((value.length - elementOffset) / elementStride);\n const autoCharacterSet = characterSet && new Set();\n const texts = new Array(length);\n let codes = value;\n if (elementStride > 1 || elementOffset > 0) {\n const ArrayType = value.constructor;\n codes = new ArrayType(characterCount);\n for (let i = 0; i < characterCount; i++) {\n codes[i] = value[i * elementStride + elementOffset];\n }\n }\n for (let index = 0; index < length; index++) {\n const startIndex = startIndices[index];\n const endIndex = startIndices[index + 1] || characterCount;\n const codesAtIndex = codes.subarray(startIndex, endIndex);\n // @ts-ignore TS wants the argument to be number[] but typed array works too\n texts[index] = String.fromCodePoint.apply(null, codesAtIndex);\n if (autoCharacterSet) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n codesAtIndex.forEach(autoCharacterSet.add, autoCharacterSet);\n }\n }\n if (autoCharacterSet) {\n for (const charCode of autoCharacterSet) {\n characterSet.add(String.fromCodePoint(charCode));\n }\n }\n return { texts, characterCount };\n}\n", "/**\n * LRU Cache class with limit\n *\n * Update order for each get/set operation\n * Delete oldest when reach given limit\n */\nexport default class LRUCache {\n constructor(limit = 5) {\n this._cache = {};\n /** access/update order, first item is oldest, last item is newest */\n this._order = [];\n this.limit = limit;\n }\n get(key) {\n const value = this._cache[key];\n if (value) {\n // update order\n this._deleteOrder(key);\n this._appendOrder(key);\n }\n return value;\n }\n set(key, value) {\n if (!this._cache[key]) {\n // if reach limit, delete the oldest\n if (Object.keys(this._cache).length === this.limit) {\n this.delete(this._order[0]);\n }\n this._cache[key] = value;\n this._appendOrder(key);\n }\n else {\n // if found in cache, delete the old one, insert new one to the first of list\n this.delete(key);\n this._cache[key] = value;\n this._appendOrder(key);\n }\n }\n delete(key) {\n const value = this._cache[key];\n if (value) {\n delete this._cache[key];\n this._deleteOrder(key);\n }\n }\n _deleteOrder(key) {\n const index = this._order.indexOf(key);\n if (index >= 0) {\n this._order.splice(index, 1);\n }\n }\n _appendOrder(key) {\n this._order.push(key);\n }\n}\n", "import { Layer, project32, picking, UNIT } from '@deck.gl/core';\nimport { Geometry } from '@luma.gl/engine';\nimport { Model } from '@luma.gl/engine';\nimport vs from \"./text-background-layer-vertex.glsl.js\";\nimport fs from \"./text-background-layer-fragment.glsl.js\";\nconst defaultProps = {\n billboard: true,\n sizeScale: 1,\n sizeUnits: 'pixels',\n sizeMinPixels: 0,\n sizeMaxPixels: Number.MAX_SAFE_INTEGER,\n padding: { type: 'array', value: [0, 0, 0, 0] },\n getPosition: { type: 'accessor', value: (x) => x.position },\n getSize: { type: 'accessor', value: 1 },\n getAngle: { type: 'accessor', value: 0 },\n getPixelOffset: { type: 'accessor', value: [0, 0] },\n getBoundingRect: { type: 'accessor', value: [0, 0, 0, 0] },\n getFillColor: { type: 'accessor', value: [0, 0, 0, 255] },\n getLineColor: { type: 'accessor', value: [0, 0, 0, 255] },\n getLineWidth: { type: 'accessor', value: 1 }\n};\nclass TextBackgroundLayer extends Layer {\n getShaders() {\n return super.getShaders({ vs, fs, modules: [project32, picking] });\n }\n initializeState() {\n this.getAttributeManager().addInstanced({\n instancePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getPosition'\n },\n instanceSizes: {\n size: 1,\n transition: true,\n accessor: 'getSize',\n defaultValue: 1\n },\n instanceAngles: {\n size: 1,\n transition: true,\n accessor: 'getAngle'\n },\n instanceRects: {\n size: 4,\n accessor: 'getBoundingRect'\n },\n instancePixelOffsets: {\n size: 2,\n transition: true,\n accessor: 'getPixelOffset'\n },\n instanceFillColors: {\n size: 4,\n transition: true,\n type: 'unorm8',\n accessor: 'getFillColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceLineColors: {\n size: 4,\n transition: true,\n type: 'unorm8',\n accessor: 'getLineColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceLineWidths: {\n size: 1,\n transition: true,\n accessor: 'getLineWidth',\n defaultValue: 1\n }\n });\n }\n updateState(params) {\n super.updateState(params);\n const { changeFlags } = params;\n if (changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n this.getAttributeManager().invalidateAll();\n }\n }\n draw({ uniforms }) {\n const { billboard, sizeScale, sizeUnits, sizeMinPixels, sizeMaxPixels, getLineWidth } = this.props;\n let { padding } = this.props;\n if (padding.length < 4) {\n padding = [padding[0], padding[1], padding[0], padding[1]];\n }\n const model = this.state.model;\n model.setUniforms(uniforms);\n model.setUniforms({\n billboard,\n stroked: Boolean(getLineWidth),\n padding,\n sizeUnits: UNIT[sizeUnits],\n sizeScale,\n sizeMinPixels,\n sizeMaxPixels\n });\n model.draw(this.context.renderPass);\n }\n _getModel() {\n // a square that minimally cover the unit circle\n const positions = [0, 0, 1, 0, 1, 1, 0, 1];\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-fan-webgl',\n vertexCount: 4,\n attributes: {\n positions: { size: 2, value: new Float32Array(positions) }\n }\n }),\n isInstanced: true\n });\n }\n}\nTextBackgroundLayer.defaultProps = defaultProps;\nTextBackgroundLayer.layerName = 'TextBackgroundLayer';\nexport default TextBackgroundLayer;\n", "export default `\\\n#version 300 es\n#define SHADER_NAME text-background-layer-vertex-shader\nin vec2 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceRects;\nin float instanceSizes;\nin float instanceAngles;\nin vec2 instancePixelOffsets;\nin float instanceLineWidths;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\nuniform int sizeUnits;\nout vec4 vFillColor;\nout vec4 vLineColor;\nout float vLineWidth;\nout vec2 uv;\nout vec2 dimensions;\nvec2 rotate_by_angle(vec2 vertex, float angle) {\nfloat angle_radian = radians(angle);\nfloat cos_angle = cos(angle_radian);\nfloat sin_angle = sin(angle_radian);\nmat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\nreturn rotationMatrix * vertex;\n}\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = positions;\ngeometry.pickingColor = instancePickingColors;\nuv = positions;\nvLineWidth = instanceLineWidths;\nfloat sizePixels = clamp(\nproject_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\nsizeMinPixels, sizeMaxPixels\n);\ndimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\nvec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\npixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\npixelOffset += instancePixelOffsets;\npixelOffset.y *= -1.0;\nif (billboard) {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = vec3(pixelOffset, 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\nDECKGL_FILTER_SIZE(offset_common, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\nDECKGL_FILTER_COLOR(vFillColor, geometry);\nvLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\nDECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n`;\n", "export default `\\\n#version 300 es\n#define SHADER_NAME text-background-layer-fragment-shader\nprecision highp float;\nuniform bool stroked;\nin vec4 vFillColor;\nin vec4 vLineColor;\nin float vLineWidth;\nin vec2 uv;\nin vec2 dimensions;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nvec2 pixelPosition = uv * dimensions;\nif (stroked) {\nfloat distToEdge = min(\nmin(pixelPosition.x, dimensions.x - pixelPosition.x),\nmin(pixelPosition.y, dimensions.y - pixelPosition.y)\n);\nfloat isBorder = smoothedge(distToEdge, vLineWidth);\nfragColor = mix(vFillColor, vLineColor, isBorder);\n} else {\nfragColor = vFillColor;\n}\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n", "import IconLayer from \"../icon-layer/icon-layer.js\";\nimport ScatterplotLayer from \"../scatterplot-layer/scatterplot-layer.js\";\nimport TextLayer from \"../text-layer/text-layer.js\";\nimport PathLayer from \"../path-layer/path-layer.js\";\nimport SolidPolygonLayer from \"../solid-polygon-layer/solid-polygon-layer.js\";\nexport const POINT_LAYER = {\n circle: {\n type: ScatterplotLayer,\n props: {\n filled: 'filled',\n stroked: 'stroked',\n lineWidthMaxPixels: 'lineWidthMaxPixels',\n lineWidthMinPixels: 'lineWidthMinPixels',\n lineWidthScale: 'lineWidthScale',\n lineWidthUnits: 'lineWidthUnits',\n pointRadiusMaxPixels: 'radiusMaxPixels',\n pointRadiusMinPixels: 'radiusMinPixels',\n pointRadiusScale: 'radiusScale',\n pointRadiusUnits: 'radiusUnits',\n pointAntialiasing: 'antialiasing',\n pointBillboard: 'billboard',\n getFillColor: 'getFillColor',\n getLineColor: 'getLineColor',\n getLineWidth: 'getLineWidth',\n getPointRadius: 'getRadius'\n }\n },\n icon: {\n type: IconLayer,\n props: {\n iconAtlas: 'iconAtlas',\n iconMapping: 'iconMapping',\n iconSizeMaxPixels: 'sizeMaxPixels',\n iconSizeMinPixels: 'sizeMinPixels',\n iconSizeScale: 'sizeScale',\n iconSizeUnits: 'sizeUnits',\n iconAlphaCutoff: 'alphaCutoff',\n iconBillboard: 'billboard',\n getIcon: 'getIcon',\n getIconAngle: 'getAngle',\n getIconColor: 'getColor',\n getIconPixelOffset: 'getPixelOffset',\n getIconSize: 'getSize'\n }\n },\n text: {\n type: TextLayer,\n props: {\n textSizeMaxPixels: 'sizeMaxPixels',\n textSizeMinPixels: 'sizeMinPixels',\n textSizeScale: 'sizeScale',\n textSizeUnits: 'sizeUnits',\n textBackground: 'background',\n textBackgroundPadding: 'backgroundPadding',\n textFontFamily: 'fontFamily',\n textFontWeight: 'fontWeight',\n textLineHeight: 'lineHeight',\n textMaxWidth: 'maxWidth',\n textOutlineColor: 'outlineColor',\n textOutlineWidth: 'outlineWidth',\n textWordBreak: 'wordBreak',\n textCharacterSet: 'characterSet',\n textBillboard: 'billboard',\n textFontSettings: 'fontSettings',\n getText: 'getText',\n getTextAngle: 'getAngle',\n getTextColor: 'getColor',\n getTextPixelOffset: 'getPixelOffset',\n getTextSize: 'getSize',\n getTextAnchor: 'getTextAnchor',\n getTextAlignmentBaseline: 'getAlignmentBaseline',\n getTextBackgroundColor: 'getBackgroundColor',\n getTextBorderColor: 'getBorderColor',\n getTextBorderWidth: 'getBorderWidth'\n }\n }\n};\nexport const LINE_LAYER = {\n type: PathLayer,\n props: {\n lineWidthUnits: 'widthUnits',\n lineWidthScale: 'widthScale',\n lineWidthMinPixels: 'widthMinPixels',\n lineWidthMaxPixels: 'widthMaxPixels',\n lineJointRounded: 'jointRounded',\n lineCapRounded: 'capRounded',\n lineMiterLimit: 'miterLimit',\n lineBillboard: 'billboard',\n getLineColor: 'getColor',\n getLineWidth: 'getWidth'\n }\n};\nexport const POLYGON_LAYER = {\n type: SolidPolygonLayer,\n props: {\n extruded: 'extruded',\n filled: 'filled',\n wireframe: 'wireframe',\n elevationScale: 'elevationScale',\n material: 'material',\n _full3d: '_full3d',\n getElevation: 'getElevation',\n getFillColor: 'getFillColor',\n getLineColor: 'getLineColor'\n }\n};\nexport function getDefaultProps({ type, props }) {\n const result = {};\n for (const key in props) {\n result[key] = type.defaultProps[props[key]];\n }\n return result;\n}\nexport function forwardProps(layer, mapping) {\n const { transitions, updateTriggers } = layer.props;\n const result = {\n updateTriggers: {},\n transitions: transitions && {\n getPosition: transitions.geometry\n }\n };\n for (const sourceKey in mapping) {\n const targetKey = mapping[sourceKey];\n let value = layer.props[sourceKey];\n if (sourceKey.startsWith('get')) {\n // isAccessor\n value = layer.getSubLayerAccessor(value);\n result.updateTriggers[targetKey] = updateTriggers[sourceKey];\n if (transitions) {\n result.transitions[targetKey] = transitions[sourceKey];\n }\n }\n result[targetKey] = value;\n }\n return result;\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 { log } from '@deck.gl/core';\n/**\n * \"Normalizes\" complete or partial GeoJSON data into iterable list of features\n * Can accept GeoJSON geometry or \"Feature\", \"FeatureCollection\" in addition\n * to plain arrays and iterables.\n * Works by extracting the feature array or wrapping single objects in an array,\n * so that subsequent code can simply iterate over features.\n *\n * @param {object} geojson - geojson data\n * @param {Object|Array} data - geojson object (FeatureCollection, Feature or\n * Geometry) or array of features\n * @return {Array|\"iteratable\"} - iterable list of features\n */\nexport function getGeojsonFeatures(geojson) {\n // If array, assume this is a list of features\n if (Array.isArray(geojson)) {\n return geojson;\n }\n log.assert(geojson.type, 'GeoJSON does not have type');\n switch (geojson.type) {\n case 'Feature':\n // Wrap the feature in a 'Features' array\n return [geojson];\n case 'FeatureCollection':\n // Just return the 'Features' array from the collection\n log.assert(Array.isArray(geojson.features), 'GeoJSON does not have features array');\n return geojson.features;\n default:\n // Assume it's a geometry, we'll check type in separateGeojsonFeatures\n // Wrap the geometry object in a 'Feature' object and wrap in an array\n return [{ geometry: geojson }];\n }\n}\n// Linearize\nexport function separateGeojsonFeatures(features, wrapFeature, dataRange = {}) {\n const separated = {\n pointFeatures: [],\n lineFeatures: [],\n polygonFeatures: [],\n polygonOutlineFeatures: []\n };\n const { startRow = 0, endRow = features.length } = dataRange;\n for (let featureIndex = startRow; featureIndex < endRow; featureIndex++) {\n const feature = features[featureIndex];\n const { geometry } = feature;\n if (!geometry) {\n // geometry can be null per specification\n continue; // eslint-disable-line no-continue\n }\n if (geometry.type === 'GeometryCollection') {\n log.assert(Array.isArray(geometry.geometries), 'GeoJSON does not have geometries array');\n const { geometries } = geometry;\n for (let i = 0; i < geometries.length; i++) {\n const subGeometry = geometries[i];\n separateGeometry(subGeometry, separated, wrapFeature, feature, featureIndex);\n }\n }\n else {\n separateGeometry(geometry, separated, wrapFeature, feature, featureIndex);\n }\n }\n return separated;\n}\nfunction separateGeometry(geometry, separated, wrapFeature, sourceFeature, sourceFeatureIndex) {\n const { type, coordinates } = geometry;\n const { pointFeatures, lineFeatures, polygonFeatures, polygonOutlineFeatures } = separated;\n if (!validateGeometry(type, coordinates)) {\n // Avoid hard failure if some features are malformed\n log.warn(`${type} coordinates are malformed`)();\n return;\n }\n // Split each feature, but keep track of the source feature and index (for Multi* geometries)\n switch (type) {\n case 'Point':\n pointFeatures.push(wrapFeature({\n geometry\n }, sourceFeature, sourceFeatureIndex));\n break;\n case 'MultiPoint':\n coordinates.forEach(point => {\n pointFeatures.push(wrapFeature({\n geometry: { type: 'Point', coordinates: point }\n }, sourceFeature, sourceFeatureIndex));\n });\n break;\n case 'LineString':\n lineFeatures.push(wrapFeature({\n geometry\n }, sourceFeature, sourceFeatureIndex));\n break;\n case 'MultiLineString':\n // Break multilinestrings into multiple lines\n coordinates.forEach(path => {\n lineFeatures.push(wrapFeature({\n geometry: { type: 'LineString', coordinates: path }\n }, sourceFeature, sourceFeatureIndex));\n });\n break;\n case 'Polygon':\n polygonFeatures.push(wrapFeature({\n geometry\n }, sourceFeature, sourceFeatureIndex));\n // Break polygon into multiple lines\n coordinates.forEach(path => {\n polygonOutlineFeatures.push(wrapFeature({\n geometry: { type: 'LineString', coordinates: path }\n }, sourceFeature, sourceFeatureIndex));\n });\n break;\n case 'MultiPolygon':\n // Break multipolygons into multiple polygons\n coordinates.forEach(polygon => {\n polygonFeatures.push(wrapFeature({\n geometry: { type: 'Polygon', coordinates: polygon }\n }, sourceFeature, sourceFeatureIndex));\n // Break polygon into multiple lines\n polygon.forEach(path => {\n polygonOutlineFeatures.push(wrapFeature({\n geometry: { type: 'LineString', coordinates: path }\n }, sourceFeature, sourceFeatureIndex));\n });\n });\n break;\n default:\n }\n}\n/**\n * Simple GeoJSON validation util. For perf reasons we do not validate against the full spec,\n * only the following:\n - geometry.type is supported\n - geometry.coordinate has correct nesting level\n */\nconst COORDINATE_NEST_LEVEL = {\n Point: 1,\n MultiPoint: 2,\n LineString: 2,\n MultiLineString: 3,\n Polygon: 3,\n MultiPolygon: 4\n};\nexport function validateGeometry(type, coordinates) {\n let nestLevel = COORDINATE_NEST_LEVEL[type];\n log.assert(nestLevel, `Unknown GeoJSON type ${type}`);\n while (coordinates && --nestLevel > 0) {\n coordinates = coordinates[0];\n }\n return coordinates && Number.isFinite(coordinates[0]);\n}\n", "import { calculatePickingColors } from \"./geojson-binary.js\";\nfunction createEmptyLayerProps() {\n return {\n points: {},\n lines: {},\n polygons: {},\n polygonsOutline: {}\n };\n}\nfunction getCoordinates(f) {\n return f.geometry.coordinates;\n}\nexport function createLayerPropsFromFeatures(features, featuresDiff) {\n const layerProps = createEmptyLayerProps();\n const { pointFeatures, lineFeatures, polygonFeatures, polygonOutlineFeatures } = features;\n layerProps.points.data = pointFeatures;\n layerProps.points._dataDiff = featuresDiff.pointFeatures && (() => featuresDiff.pointFeatures);\n layerProps.points.getPosition = getCoordinates;\n layerProps.lines.data = lineFeatures;\n layerProps.lines._dataDiff = featuresDiff.lineFeatures && (() => featuresDiff.lineFeatures);\n layerProps.lines.getPath = getCoordinates;\n layerProps.polygons.data = polygonFeatures;\n layerProps.polygons._dataDiff =\n featuresDiff.polygonFeatures && (() => featuresDiff.polygonFeatures);\n layerProps.polygons.getPolygon = getCoordinates;\n layerProps.polygonsOutline.data = polygonOutlineFeatures;\n layerProps.polygonsOutline._dataDiff =\n featuresDiff.polygonOutlineFeatures && (() => featuresDiff.polygonOutlineFeatures);\n layerProps.polygonsOutline.getPath = getCoordinates;\n return layerProps;\n}\nexport function createLayerPropsFromBinary(geojsonBinary, encodePickingColor) {\n // The binary data format is documented here\n // https://github.com/visgl/loaders.gl/blob/master/modules/gis/docs/api-reference/geojson-to-binary.md\n // It is the default output from the `MVTLoader` and can also be obtained\n // from GeoJSON by using the `geojsonToBinary` utility function.\n const layerProps = createEmptyLayerProps();\n const { points, lines, polygons } = geojsonBinary;\n const customPickingColors = calculatePickingColors(geojsonBinary, encodePickingColor);\n layerProps.points.data = {\n length: points.positions.value.length / points.positions.size,\n attributes: {\n ...points.attributes,\n getPosition: points.positions,\n instancePickingColors: {\n size: 3,\n value: customPickingColors.points\n }\n },\n properties: points.properties,\n numericProps: points.numericProps,\n featureIds: points.featureIds\n };\n layerProps.lines.data = {\n length: lines.pathIndices.value.length - 1,\n startIndices: lines.pathIndices.value,\n attributes: {\n ...lines.attributes,\n getPath: lines.positions,\n instancePickingColors: {\n size: 3,\n value: customPickingColors.lines\n }\n },\n properties: lines.properties,\n numericProps: lines.numericProps,\n featureIds: lines.featureIds\n };\n layerProps.lines._pathType = 'open';\n layerProps.polygons.data = {\n length: polygons.polygonIndices.value.length - 1,\n startIndices: polygons.polygonIndices.value,\n attributes: {\n ...polygons.attributes,\n getPolygon: polygons.positions,\n pickingColors: {\n size: 3,\n value: customPickingColors.polygons\n }\n },\n properties: polygons.properties,\n numericProps: polygons.numericProps,\n featureIds: polygons.featureIds\n };\n layerProps.polygons._normalize = false;\n if (polygons.triangles) {\n layerProps.polygons.data.attributes.indices = polygons.triangles.value;\n }\n layerProps.polygonsOutline.data = {\n length: polygons.primitivePolygonIndices.value.length - 1,\n startIndices: polygons.primitivePolygonIndices.value,\n attributes: {\n ...polygons.attributes,\n getPath: polygons.positions,\n instancePickingColors: {\n size: 3,\n value: customPickingColors.polygons\n }\n },\n properties: polygons.properties,\n numericProps: polygons.numericProps,\n featureIds: polygons.featureIds\n };\n layerProps.polygonsOutline._pathType = 'open';\n return layerProps;\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBA,kBAAgD;AAChD,oBAAyB;AACzB,IAAAA,iBAAsB;;;ACFtB,IAAO,gCAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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,eAAeA;AAC5B,IAAO,wBAAQ;", "names": ["import_engine", "import_core", "import_engine", "import_core", "defaultProps", "import_core", "import_engine", "import_core", "DEFAULT_COLOR", "defaultProps", "import_core", "import_engine", "DEFAULT_COLOR", "defaultProps", "import_core", "import_engine", "DEFAULT_COLOR", "defaultProps", "import_core", "import_engine", "DEFAULT_COLOR", "defaultProps", "import_core", "import_engine", "import_core", "import_engine", "DEFAULT_COLOR", "defaultProps", "import_core", "import_engine", "defaultProps", "import_core", "import_engine", "import_core", "import_polygon", "DEFAULT_COLOR", "defaultProps", "import_core", "import_core", "import_engine", "import_polygon", "earcut", "import_core", "import_polygon", "isCut", "DEFAULT_COLOR", "defaultProps", "ATTRIBUTE_TRANSITION", "defaultProps", "import_core", "import_core", "import_core", "DEFAULT_BUFFER", "defaultProps", "import_core", "import_core", "nextPowOfTwo", "buildMapping", "char", "buildMapping", "TinySDF", "import_core", "import_engine", "defaultProps", "DEFAULT_COLOR", "defaultProps", "import_core", "defaultProps"] }