antvis / antvis/L7

uniapp 出现 TypeError: (0 , _tslib.__spreadArray) is not a function

Open
#2,690 2 comments 1 reaction 1 assignee Claimed by @lzxue View on GitHub
question
Dominant language
TypeScript
Stars
4.1k
Forks
656
PR merge metrics
No merged PRs in 30d

Description

`###` 问题描述

Uncaught (in promise) TypeError: (0 , _tslib.__spreadArray) is not a function
at Device_GL.checkLimits (pages-map-map.js:97325:85)
at new Device_GL (pages-map-map.js:97271:10)
at WebGLDeviceContribution. (pages-map-map.js:98881:31)
at step (pages-map-map.js:58949:23)
at Object.next (pages-map-map.js:58930:53)
at pages-map-map.js:58923:71
at new Promise ()
at __awaiter (pages-map-map.js:58919:12)
at WebGLDeviceContribution.createSwapChain (pages-map-map.js:98859:33)
at DeviceRendererService._callee3$ (pages-map-map.js:44616:43)

### 重现链接

_No response_

### 重现步骤

```
{
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@antv/l7": "^2.8.41",
"@antv/l7-draw": "^2.2.37",
"@antv/l7-maps": "2.8.41",
"@turf/turf": "6.5.0",
"tslib": "^1.14.1",
"typescript": "^4.5.5"
}
}
```

```



import { Scene } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
import { multiPolygonList } from './mock.ts';

// Your existing code using feature, multiPolygon, and polygon

export default {
name: 'Demo',
data() {
return {
mapId: `map-${Math.random()}`,
polygonDrawer: null,
scene: null
};
},
mounted() {
this.scene = new Scene({
id: this.mapId,
map: new GaodeMap({
center: [120.151634, 30.244831],
pitch: 0,
style: 'dark',
zoom: 10,
token: '8eefc214b06b5ddbdd2d4917b9f8d9cf',
}),
logoVisible: false, //去除logo
});

this.scene.on('loaded', () => {
// 关闭默认 L7 Logo
const tileLayer = new AMap.TileLayer.Satellite();
tileLayer.setMap(this.scene.map);

const drawer = new DrawPolygon(this.scene, {
initialData: multiPolygonList,
editable: false,
});

this.polygonDrawer = drawer;
drawer.disable();

drawer.on(DrawEvent.Change, console.log);
});
},
beforeDestroy() {
if (this.polygonDrawer) {
this.polygonDrawer.disable();
}
if (this.scene) {
this.scene.destroy();
}
}
};

/* 可以添加全局样式 */

```
### 预期行为

_No response_

### 平台

- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]

### 屏幕截图或视频(可选)

_No response_

### 补充说明(可选)

_No response_``

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.