maptalks / maptalks/maptalks.gridlayer

vue里的内存泄漏

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

from yumgis:

在vue中,如果按照以下方式添加图层,会有内存泄漏,即内存不正常的增长。
```js
this.gridLayer = new maptalks.GridLayer('bdGridLayer', grid, options).addTo(mapObj);
```
但改成如下方式添加,就是正常的:
```js
this.gridLayer = new maptalks.GridLayer('bdGridLayer', grid, options);
this.gridLayer.addTo(mapObj);
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the memory growth in Vue using the two GridLayer construction and addTo forms shown in the issue. Compare the chained call with the separate call while inspecting the GridLayer addTo path and memory behavior. Done means both forms add the layer without abnormal memory growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.