{"_id":"@andy123321/wind-gl-core","_rev":"5-f78305e5297ee2592a37a539e6e6cee1","name":"@andy123321/wind-gl-core","dist-tags":{"latest":"2.0.2-custom.5"},"versions":{"2.0.2-custom.1":{"name":"@andy123321/wind-gl-core","version":"2.0.2-custom.1","keywords":["weather","wind","3d","webgl","map","vis","gis"],"author":{"name":"andy123321","email":"1197840434@qq.com"},"license":"MIT","_id":"@andy123321/wind-gl-core@2.0.2-custom.1","maintainers":[{"name":"andy123321","email":"1197840434@qq.com"}],"homepage":"https://github.com/sakitam-fdd/wind-layer#readme","bugs":{"url":"https://github.com/sakitam-fdd/wind-layer/issues"},"dist":{"shasum":"07d8a58642732e8935908734cc300758fd816aa5","tarball":"https://registry.npmjs.org/@andy123321/wind-gl-core/-/wind-gl-core-2.0.2-custom.1.tgz","fileCount":9,"integrity":"sha512-JNr0i01PPw5RpzjWzHoSPDbPDkh5hFhOmM+uhPszl0LoeyEoZVuJni0guylZCyARx9rN5uoAMAOkgp8Uc+KCCw==","signatures":[{"sig":"MEYCIQD+DUMFF+lBwMGhcN66hZeFysTpuWYeDvVcSXLmoqKKagIhAMQc39W4F0FNfYu1pv0eGt4SFXD1I+RbYSeuIJA1rtxo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2783682},"main":"dist/wind-gl-core.js","types":"dist/index.d.ts","unpkg":"dist/wind-gl-core.js","module":"dist/wind-gl-core.esm.js","exports":{".":{"node":{"import":{"default":"./dist/wind-gl-core.esm.js","production":"./dist/wind-gl-core.esm.js","development":"./dist/wind-gl-core.esm.js"},"require":{"default":"./dist/wind-gl-core.cjs.js","production":"./dist/wind-gl-core.cjs.js","development":"./dist/wind-gl-core.cjs.js"}},"types":"./dist/index.d.ts","import":"./dist/wind-gl-core.esm.js","require":"./dist/wind-gl-core.cjs.js"},"./dist/*":"./dist/*","./package.json":"./package.json"},"gitHead":"bf11d2108459e11fa50e1590ee448a09d075138c","private":false,"scripts":{"api":"typedoc","dev":"cross-env NODE_ENV=development rollup -wm -c rollup.config.ts --configPlugin esbuild","lint":"eslint \"src/**/*.{js,jsx,mjs,ts,tsx}\"","test":"pnpm run build && pnpm run test-only","build":"rollup --c rollup.config.ts --configPlugin esbuild","clean":"rimraf dist","coverage":"vitest run --coverage","prettier":"prettier --parser=typescript --write **/*.{js,ts,md}","test-only":"vitest run","build:minify":"cross-env MINIFY=true rollup --c rollup.config.ts --configPlugin esbuild"},"_npmUser":{"name":"andy123321","email":"1197840434@qq.com"},"commonjs":"dist/wind-gl-core.cjs.js","namespace":"WindGl","repository":{"url":"git+https://github.com/quaner123321/wind-layer.git","type":"git","directory":"packages/gl-core"},"_npmVersion":"10.8.2","description":"leaflet wind","directories":{},"sideEffects":false,"_nodeVersion":"18.20.5","dependencies":{"earcut":"^2.2.4","wind-gl-worker":"^2.0.2","@sakitam-gis/vis-engine":"^1.5.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/earcut":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/wind-gl-core_2.0.2-custom.1_1765273041963_0.30838124002998124","host":"s3://npm-registry-packages-npm-production"}},"2.0.2-custom.2":{"name":"@andy123321/wind-gl-core","version":"2.0.2-custom.2","keywords":["weather","wind","3d","webgl","map","vis","gis"],"author":{"name":"andy123321","email":"1197840434@qq.com"},"license":"MIT","_id":"@andy123321/wind-gl-core@2.0.2-custom.2","maintainers":[{"name":"andy123321","email":"1197840434@qq.com"}],"homepage":"https://github.com/sakitam-fdd/wind-layer#readme","bugs":{"url":"https://github.com/sakitam-fdd/wind-layer/issues"},"dist":{"shasum":"a815afeedf8d772422ee1a54d2a2890330d43464","tarball":"https://registry.npmjs.org/@andy123321/wind-gl-core/-/wind-gl-core-2.0.2-custom.2.tgz","fileCount":9,"integrity":"sha512-hLZmovS60VMbm11TzQDV+vVn3W6ZPgjeVVRkaMs7JEV9FvSyzGfGSiL+NRB1hfL2vIXGweBYW4aA5xQoXr7Czw==","signatures":[{"sig":"MEQCIDhpqKBUVEI5PAXmLYEyYZ41IUfcjF5/nHPonmM9hdUwAiBbx/Inmfu4H1AY1eANOOxgsu+A3fdg4p5L+dPAnNdqSQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2785941},"main":"dist/wind-gl-core.js","types":"dist/index.d.ts","unpkg":"dist/wind-gl-core.js","module":"dist/wind-gl-core.esm.js","exports":{".":{"node":{"import":{"default":"./dist/wind-gl-core.esm.js","production":"./dist/wind-gl-core.esm.js","development":"./dist/wind-gl-core.esm.js"},"require":{"default":"./dist/wind-gl-core.cjs.js","production":"./dist/wind-gl-core.cjs.js","development":"./dist/wind-gl-core.cjs.js"}},"types":"./dist/index.d.ts","import":"./dist/wind-gl-core.esm.js","require":"./dist/wind-gl-core.cjs.js"},"./dist/*":"./dist/*","./package.json":"./package.json"},"gitHead":"bf11d2108459e11fa50e1590ee448a09d075138c","private":false,"scripts":{"api":"typedoc","dev":"cross-env NODE_ENV=development rollup -wm -c rollup.config.ts --configPlugin esbuild","lint":"eslint \"src/**/*.{js,jsx,mjs,ts,tsx}\"","test":"pnpm run build && pnpm run test-only","build":"rollup --c rollup.config.ts --configPlugin esbuild","clean":"rimraf dist","coverage":"vitest run --coverage","prettier":"prettier --parser=typescript --write **/*.{js,ts,md}","test-only":"vitest run","build:minify":"cross-env MINIFY=true rollup --c rollup.config.ts --configPlugin esbuild"},"_npmUser":{"name":"andy123321","email":"1197840434@qq.com"},"commonjs":"dist/wind-gl-core.cjs.js","namespace":"WindGl","repository":{"url":"git+https://github.com/quaner123321/wind-layer.git","type":"git","directory":"packages/gl-core"},"_npmVersion":"10.9.2","description":"leaflet wind","directories":{},"sideEffects":false,"_nodeVersion":"23.4.0","dependencies":{"earcut":"^2.2.4","wind-gl-worker":"^2.0.2","@sakitam-gis/vis-engine":"^1.5.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/earcut":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/wind-gl-core_2.0.2-custom.2_1765354976730_0.19869124792544324","host":"s3://npm-registry-packages-npm-production"}},"2.0.2-custom.3":{"name":"@andy123321/wind-gl-core","version":"2.0.2-custom.3","keywords":["weather","wind","3d","webgl","map","vis","gis"],"author":{"name":"andy123321","email":"1197840434@qq.com"},"license":"MIT","_id":"@andy123321/wind-gl-core@2.0.2-custom.3","maintainers":[{"name":"andy123321","email":"1197840434@qq.com"}],"homepage":"https://github.com/sakitam-fdd/wind-layer#readme","bugs":{"url":"https://github.com/sakitam-fdd/wind-layer/issues"},"dist":{"shasum":"4adeed4cd65eec0f6efa2697c4907418ec7b54aa","tarball":"https://registry.npmjs.org/@andy123321/wind-gl-core/-/wind-gl-core-2.0.2-custom.3.tgz","fileCount":9,"integrity":"sha512-6PhpLN9UjSJN7mwTd5wJvDwbvK9CRcf9lkpsGbuIyw/ofu7QZbqTMh+Vfhq2e4j6POavzvJ6pii9AICFCA2WmA==","signatures":[{"sig":"MEUCIGtHYxRgjrxCMmSNohncpo1lO7qoyejSOs00Xb5CcBNCAiEAhbI5NL7aKxK9ZoOSbd8QyUyM4pv1a44oRQeSe7q7dkU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2785863},"main":"dist/wind-gl-core.js","types":"dist/index.d.ts","unpkg":"dist/wind-gl-core.js","module":"dist/wind-gl-core.esm.js","exports":{".":{"node":{"import":{"default":"./dist/wind-gl-core.esm.js","production":"./dist/wind-gl-core.esm.js","development":"./dist/wind-gl-core.esm.js"},"require":{"default":"./dist/wind-gl-core.cjs.js","production":"./dist/wind-gl-core.cjs.js","development":"./dist/wind-gl-core.cjs.js"}},"types":"./dist/index.d.ts","import":"./dist/wind-gl-core.esm.js","require":"./dist/wind-gl-core.cjs.js"},"./dist/*":"./dist/*","./package.json":"./package.json"},"gitHead":"bf11d2108459e11fa50e1590ee448a09d075138c","private":false,"scripts":{"api":"typedoc","dev":"cross-env NODE_ENV=development rollup -wm -c rollup.config.ts --configPlugin esbuild","lint":"eslint \"src/**/*.{js,jsx,mjs,ts,tsx}\"","test":"pnpm run build && pnpm run test-only","build":"rollup --c rollup.config.ts --configPlugin esbuild","clean":"rimraf dist","coverage":"vitest run --coverage","prettier":"prettier --parser=typescript --write **/*.{js,ts,md}","test-only":"vitest run","build:minify":"cross-env MINIFY=true rollup --c rollup.config.ts --configPlugin esbuild"},"_npmUser":{"name":"andy123321","email":"1197840434@qq.com"},"commonjs":"dist/wind-gl-core.cjs.js","namespace":"WindGl","repository":{"url":"git+https://github.com/quaner123321/wind-layer.git","type":"git","directory":"packages/gl-core"},"_npmVersion":"10.9.2","description":"leaflet wind","directories":{},"sideEffects":false,"_nodeVersion":"23.4.0","dependencies":{"earcut":"^2.2.4","wind-gl-worker":"^2.0.2","@sakitam-gis/vis-engine":"^1.5.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/earcut":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/wind-gl-core_2.0.2-custom.3_1765356834931_0.2915427368963328","host":"s3://npm-registry-packages-npm-production"}},"2.0.2-custom.4":{"name":"@andy123321/wind-gl-core","version":"2.0.2-custom.4","keywords":["weather","wind","3d","webgl","map","vis","gis"],"author":{"name":"andy123321","email":"1197840434@qq.com"},"license":"MIT","_id":"@andy123321/wind-gl-core@2.0.2-custom.4","maintainers":[{"name":"andy123321","email":"1197840434@qq.com"}],"homepage":"https://github.com/sakitam-fdd/wind-layer#readme","bugs":{"url":"https://github.com/sakitam-fdd/wind-layer/issues"},"dist":{"shasum":"0ca49ee650f320856c66e256898f917fa462e678","tarball":"https://registry.npmjs.org/@andy123321/wind-gl-core/-/wind-gl-core-2.0.2-custom.4.tgz","fileCount":9,"integrity":"sha512-nj3XI8rtRJlinUYALnQmADPTJ+v6Gx0mTeeeko/DWf96OQC9ansY2g7amD+EmrpP/oQKJk+Zmkgxa6B/zbNsOA==","signatures":[{"sig":"MEQCIBBIwCWxjGi0/biOUjvBkziqbtvv0LcawgROz+TcLIVnAiA42gKv58QLC28ffyCz8JwGVHIwVce8abdrPNnpq9XUfg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2786295},"main":"dist/wind-gl-core.js","types":"dist/index.d.ts","unpkg":"dist/wind-gl-core.js","module":"dist/wind-gl-core.esm.js","exports":{".":{"node":{"import":{"default":"./dist/wind-gl-core.esm.js","production":"./dist/wind-gl-core.esm.js","development":"./dist/wind-gl-core.esm.js"},"require":{"default":"./dist/wind-gl-core.cjs.js","production":"./dist/wind-gl-core.cjs.js","development":"./dist/wind-gl-core.cjs.js"}},"types":"./dist/index.d.ts","import":"./dist/wind-gl-core.esm.js","require":"./dist/wind-gl-core.cjs.js"},"./dist/*":"./dist/*","./package.json":"./package.json"},"gitHead":"bf11d2108459e11fa50e1590ee448a09d075138c","private":false,"scripts":{"api":"typedoc","dev":"cross-env NODE_ENV=development rollup -wm -c rollup.config.ts --configPlugin esbuild","lint":"eslint \"src/**/*.{js,jsx,mjs,ts,tsx}\"","test":"pnpm run build && pnpm run test-only","build":"rollup --c rollup.config.ts --configPlugin esbuild","clean":"rimraf dist","coverage":"vitest run --coverage","prettier":"prettier --parser=typescript --write **/*.{js,ts,md}","test-only":"vitest run","build:minify":"cross-env MINIFY=true rollup --c rollup.config.ts --configPlugin esbuild"},"_npmUser":{"name":"andy123321","email":"1197840434@qq.com"},"commonjs":"dist/wind-gl-core.cjs.js","namespace":"WindGl","repository":{"url":"git+https://github.com/quaner123321/wind-layer.git","type":"git","directory":"packages/gl-core"},"_npmVersion":"10.9.2","description":"leaflet wind","directories":{},"sideEffects":false,"_nodeVersion":"23.4.0","dependencies":{"earcut":"^2.2.4","wind-gl-worker":"^2.0.2","@sakitam-gis/vis-engine":"^1.5.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/earcut":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/wind-gl-core_2.0.2-custom.4_1765361397153_0.22914719149105633","host":"s3://npm-registry-packages-npm-production"}},"2.0.2-custom.5":{"name":"@andy123321/wind-gl-core","version":"2.0.2-custom.5","description":"leaflet wind","keywords":["weather","wind","3d","webgl","map","vis","gis"],"author":{"name":"andy123321","email":"1197840434@qq.com"},"license":"MIT","main":"dist/wind-gl-core.js","module":"dist/wind-gl-core.esm.js","unpkg":"dist/wind-gl-core.js","commonjs":"dist/wind-gl-core.cjs.js","namespace":"WindGl","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","node":{"import":{"production":"./dist/wind-gl-core.esm.js","development":"./dist/wind-gl-core.esm.js","default":"./dist/wind-gl-core.esm.js"},"require":{"production":"./dist/wind-gl-core.cjs.js","development":"./dist/wind-gl-core.cjs.js","default":"./dist/wind-gl-core.cjs.js"}},"import":"./dist/wind-gl-core.esm.js","require":"./dist/wind-gl-core.cjs.js"},"./dist/*":"./dist/*","./package.json":"./package.json"},"private":false,"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/quaner123321/wind-layer.git","directory":"packages/gl-core"},"scripts":{"api":"typedoc","clean":"rimraf dist","dev":"cross-env NODE_ENV=development rollup -wm -c rollup.config.ts --configPlugin esbuild","build":"rollup --c rollup.config.ts --configPlugin esbuild","build:minify":"cross-env MINIFY=true rollup --c rollup.config.ts --configPlugin esbuild","lint":"eslint \"src/**/*.{js,jsx,mjs,ts,tsx}\"","prettier":"prettier --parser=typescript --write **/*.{js,ts,md}","test":"pnpm run build && pnpm run test-only","test-only":"vitest run","coverage":"vitest run --coverage"},"bugs":{"url":"https://github.com/sakitam-fdd/wind-layer/issues"},"homepage":"https://github.com/sakitam-fdd/wind-layer#readme","dependencies":{"@sakitam-gis/vis-engine":"^1.5.3","earcut":"^2.2.4","wind-gl-worker":"^2.0.2"},"devDependencies":{"@types/earcut":"^2.1.4"},"publishConfig":{"access":"public"},"_id":"@andy123321/wind-gl-core@2.0.2-custom.5","gitHead":"bf11d2108459e11fa50e1590ee448a09d075138c","_nodeVersion":"23.4.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-CCfugh0MA3J7+0xmPbYF3HbC1YL5b/4TS5fUGXVHalVApSubAInkcLHMWAT4ZTfEeBJ8BLeC4XGghsU5mjs/7w==","shasum":"ded73802effca12f9d381b0074481f5f6f56dcd8","tarball":"https://registry.npmjs.org/@andy123321/wind-gl-core/-/wind-gl-core-2.0.2-custom.5.tgz","fileCount":9,"unpackedSize":2918898,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDmuNexqE0T6oliuHXZdXcMwIobiBGrv7VTm7gSLG2rOgIgNTGJQveaxh6kGy/M/4+wgrFPiikAHbwCvs11nZlZ6U8="}]},"_npmUser":{"name":"andy123321","email":"1197840434@qq.com"},"directories":{},"maintainers":[{"name":"andy123321","email":"1197840434@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wind-gl-core_2.0.2-custom.5_1765719930682_0.3602761405692956"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-09T09:37:21.815Z","modified":"2025-12-14T13:45:31.079Z","2.0.2-custom.1":"2025-12-09T09:37:22.247Z","2.0.2-custom.2":"2025-12-10T08:22:56.905Z","2.0.2-custom.3":"2025-12-10T08:53:55.118Z","2.0.2-custom.4":"2025-12-10T10:09:57.389Z","2.0.2-custom.5":"2025-12-14T13:45:30.868Z"},"bugs":{"url":"https://github.com/sakitam-fdd/wind-layer/issues"},"author":{"name":"andy123321","email":"1197840434@qq.com"},"license":"MIT","homepage":"https://github.com/sakitam-fdd/wind-layer#readme","keywords":["weather","wind","3d","webgl","map","vis","gis"],"repository":{"type":"git","url":"git+https://github.com/quaner123321/wind-layer.git","directory":"packages/gl-core"},"description":"leaflet wind","maintainers":[{"name":"andy123321","email":"1197840434@qq.com"}],"readme":"# `wind-gl-core`\r\n\r\n> wind-gl-core core\r\n\r\n## Usage\r\n\r\n```ts\r\nimport { OrthographicCamera, Renderer, Scene, utils } from '@sakitam-gis/vis-engine';\r\n\r\nimport type { UserOptions, SourceType } from 'wind-gl-core';\r\nimport { BaseLayer, LayerSourceType, RenderType, TileID, polygon2buffer } from 'wind-gl-core';\r\n\r\nthis.renderer = new Renderer(gl, {\r\n  autoClear: false,\r\n  extensions: [\r\n    'OES_texture_float',\r\n    'OES_texture_float_linear',\r\n    'WEBGL_color_buffer_float',\r\n    'EXT_color_buffer_float',\r\n  ],\r\n});\r\n\r\nthis.scene = new Scene();\r\nthis.sync = new CameraSync(this.map, 'perspective', this.scene);\r\nthis.planeCamera = new OrthographicCamera(0, 1, 1, 0, 0, 1);\r\n\r\nthis.layer = new BaseLayer(\r\n  this.source,\r\n  {\r\n    renderer: this.renderer,\r\n    scene: this.scene,\r\n  },\r\n  {\r\n    renderType: this.options.renderType,\r\n    renderFrom: this.options.renderFrom,\r\n    styleSpec: this.options.styleSpec,\r\n    displayRange: this.options.displayRange,\r\n    widthSegments: this.options.widthSegments,\r\n    heightSegments: this.options.heightSegments,\r\n    wireframe: this.options.wireframe,\r\n    picking: this.options.picking,\r\n    mask: this.processMask(),\r\n    getZoom: () => this.map?.getZoom() as number,\r\n    triggerRepaint: () => {\r\n      this.map?.triggerRepaint();\r\n    },\r\n    getTileProjSize: (z: number) => {\r\n      const w = 1 / Math.pow(2, z);\r\n      return [w, w];\r\n    },\r\n    getPixelsToUnits: (): [number, number] => {\r\n      const pixel = 1;\r\n      const y = canvas.clientHeight / 2 - pixel / 2;\r\n      const x = canvas.clientWidth / 2 - pixel / 2;\r\n      const left = mapboxgl.MercatorCoordinate.fromLngLat(m.unproject([x, y]));\r\n      const right = mapboxgl.MercatorCoordinate.fromLngLat(m.unproject([x + pixel, y + pixel]));\r\n\r\n      return [Math.abs(right.x - left.x), Math.abs(left.y - right.y)];\r\n    },\r\n    getPixelsToProjUnit: () => [\r\n      (this.map as any)?.transform.pixelsPerMeter,\r\n      (this.map as any)?.transform.pixelsPerMeter,\r\n    ],\r\n    getViewTiles: (source: SourceType, renderType: RenderType) => {\r\n      let { type } = source;\r\n      // @ts-ignore\r\n      type = type !== LayerSourceType.timeline ? type : source.privateType;\r\n      const map = this.map as any;\r\n      if (!map) return [];\r\n      const { transform } = map;\r\n      const wrapTiles: TileID[] = [];\r\n      if (type === LayerSourceType.image) {\r\n        // @ts-ignore\r\n        const cornerCoords = source.coordinates.map((c: any) =>\r\n          mapboxgl.MercatorCoordinate.fromLngLat(c),\r\n        );\r\n        const tileID = getCoordinatesCenterTileID(cornerCoords);\r\n        if (source.wrapX) {\r\n          transform.getVisibleUnwrappedCoordinates(tileID).forEach((unwrapped) => {\r\n            const { canonical, wrap } = unwrapped;\r\n            const { x, y, z } = canonical;\r\n            wrapTiles.push(\r\n              new TileID(z, wrap, z, x, y, {\r\n                getTileBounds: () => [\r\n                  (source as any).coordinates[0][0],\r\n                  (source as any).coordinates[2][1],\r\n                  (source as any).coordinates[1][0],\r\n                  (source as any).coordinates[0][1],\r\n                ],\r\n                getTileProjBounds: () => ({\r\n                  left: tileID.extent[0] + wrap,\r\n                  top: tileID.extent[1],\r\n                  right: tileID.extent[2] + wrap,\r\n                  bottom: tileID.extent[3],\r\n                }),\r\n              }),\r\n            );\r\n          });\r\n        } else {\r\n          const x = tileID.x;\r\n          const y = tileID.y;\r\n          const z = tileID.z;\r\n          const wrap = 0;\r\n          wrapTiles.push(\r\n            new TileID(z, wrap, z, x, y, {\r\n              getTileBounds: () => [\r\n                (source as any).coordinates[0][0],\r\n                (source as any).coordinates[2][1],\r\n                (source as any).coordinates[1][0],\r\n                (source as any).coordinates[0][1],\r\n              ],\r\n              getTileProjBounds: () => ({\r\n                left: tileID.extent[0] + wrap,\r\n                top: tileID.extent[1],\r\n                right: tileID.extent[2] + wrap,\r\n                bottom: tileID.extent[3],\r\n              }),\r\n            }),\r\n          );\r\n        }\r\n      } else if (type === LayerSourceType.tile) {\r\n        const opts = {\r\n          tileSize: utils.isNumber(this.source.tileSize)\r\n            ? source.tileSize\r\n            : source.tileSize?.[0] || 512,\r\n          // for mapbox\r\n          minzoom: source.minZoom,\r\n          maxzoom: source.maxZoom,\r\n          roundZoom: source.roundZoom,\r\n        };\r\n\r\n        // eslint-disable-next-line no-empty\r\n        const tiles = transform.coveringTiles(opts);\r\n\r\n        for (let i = 0; i < tiles.length; i++) {\r\n          const tile = tiles[i];\r\n          const { canonical, wrap } = tile;\r\n          const { x, y, z } = canonical;\r\n          if (source.wrapX) {\r\n            wrapTiles.push(\r\n              new TileID(z, wrap, z, x, y, {\r\n                getTileBounds,\r\n                getTileProjBounds,\r\n              }),\r\n            );\r\n          } else if (tile.wrap === 0) {\r\n            wrapTiles.push(\r\n              new TileID(z, wrap, z, x, y, {\r\n                getTileBounds,\r\n                getTileProjBounds,\r\n              }),\r\n            );\r\n          }\r\n        }\r\n\r\n        // 针对粒子图层，需要补齐所需瓦片，避免采样出现问题\r\n        if (renderType === RenderType.particles) {\r\n          wrapTiles.push(...expandTiles(wrapTiles));\r\n        }\r\n      }\r\n\r\n      return wrapTiles;\r\n    },\r\n    getExtent: () => {\r\n      const map = this.map as any;\r\n      const bounds: any = map?.getBounds().toArray();\r\n\r\n      const xmin = bounds[0][0];\r\n      const ymin = bounds[0][1];\r\n      const xmax = bounds[1][0];\r\n      const ymax = bounds[1][1];\r\n      const minY = Math.max(\r\n        ymin,\r\n        map.transform.latRange ? map.transform.latRange[0] : map.transform.minLat,\r\n      );\r\n      const maxY = Math.min(\r\n        ymax,\r\n        map.transform.latRange ? map.transform.latRange[1] : map.transform.maxLat,\r\n      );\r\n      const p0 = mapboxgl.MercatorCoordinate.fromLngLat(new mapboxgl.LngLat(xmin, maxY));\r\n      const p1 = mapboxgl.MercatorCoordinate.fromLngLat(new mapboxgl.LngLat(xmax, minY));\r\n      return [p0.x, p0.y, p1.x, p1.y];\r\n    },\r\n    getGridTiles: (source: any) => {\r\n      const tileSize = source.tileSize;\r\n      const wrapX = source.wrapX;\r\n      const map = this.map as any;\r\n      if (!map) return [];\r\n      const { transform } = map;\r\n\r\n      const opts = {\r\n        tileSize: tileSize ?? 256,\r\n        minzoom: map.getMinZoom(),\r\n        maxzoom: map.getMaxZoom(),\r\n        roundZoom: false,\r\n      };\r\n\r\n      const tiles = transform.coveringTiles(opts);\r\n      const wrapTiles: TileID[] = [];\r\n\r\n      for (let i = 0; i < tiles.length; i++) {\r\n        const tile = tiles[i];\r\n        const { canonical, wrap } = tile;\r\n        const { x, y, z } = canonical;\r\n        if (wrapX) {\r\n          wrapTiles.push(\r\n            new TileID(z, wrap, z, x, y, {\r\n              getTileBounds,\r\n              getTileProjBounds,\r\n            }),\r\n          );\r\n        } else if (tile.wrap === 0) {\r\n          wrapTiles.push(\r\n            new TileID(z, wrap, z, x, y, {\r\n              getTileBounds,\r\n              getTileProjBounds,\r\n            }),\r\n          );\r\n        }\r\n      }\r\n\r\n      return wrapTiles;\r\n    },\r\n  },\r\n);\r\n```\r\n","readmeFilename":"README.md"}