From 3403053c26726955096d07c9a7e4a1053819c89c Mon Sep 17 00:00:00 2001 From: yunji Date: Fri, 29 Mar 2024 19:50:01 +0800 Subject: [PATCH] test: vector tile case --- .../{tile.spec.ts => raster-tile.spec.ts} | 3 +- .../layers/__tests__/tile/vector-tile.spec.ts | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) rename packages/layers/__tests__/tile/{tile.spec.ts => raster-tile.spec.ts} (92%) create mode 100644 packages/layers/__tests__/tile/vector-tile.spec.ts diff --git a/packages/layers/__tests__/tile/tile.spec.ts b/packages/layers/__tests__/tile/raster-tile.spec.ts similarity index 92% rename from packages/layers/__tests__/tile/tile.spec.ts rename to packages/layers/__tests__/tile/raster-tile.spec.ts index 2421bb9739..bb76291380 100644 --- a/packages/layers/__tests__/tile/tile.spec.ts +++ b/packages/layers/__tests__/tile/raster-tile.spec.ts @@ -1,12 +1,11 @@ import { TestScene } from '@antv/l7-test-utils'; import RasterLayer from '../../src/raster/index'; -describe('RasterLayer', () => { +describe('raster-tile', () => { let scene: any; beforeEach(() => { scene = TestScene(); }); - // vector data it('rasterLayer raster', async () => { const url1 = 'https://tiles{1-3}.geovisearth.com/base/v1/ter/{z}/{x}/{y}?format=webp&tmsIds=w&token=b2a0cfc132cd60b61391b9dd63c15711eadb9b38a9943e3f98160d5710aef788'; diff --git a/packages/layers/__tests__/tile/vector-tile.spec.ts b/packages/layers/__tests__/tile/vector-tile.spec.ts new file mode 100644 index 0000000000..f050f43c6f --- /dev/null +++ b/packages/layers/__tests__/tile/vector-tile.spec.ts @@ -0,0 +1,30 @@ +import { TestScene } from '@antv/l7-test-utils'; +import PointLayer from '../../src/point'; + +describe('vector-tile', () => { + let scene: any; + beforeEach(() => { + scene = TestScene(); + }); + it('pointLayer vector', async () => { + const layer = new PointLayer({ + featureId: 'COLOR', + sourceLayer: 'ecoregions2', + }); + layer + .source('https://ganos.oss-cn-hangzhou.aliyuncs.com/m2/rs_l7/{z}/{x}/{y}.pbf', { + parser: { + type: 'mvt', + tileSize: 256, + zoomOffset: 0, + maxZoom: 9, + extent: [-180, -85.051129, 179, 85.051129], + }, + }) + .shape('circle') + .color('COLOR') + .size(10); + + scene.addLayer(layer); + }); +});