maptalks / maptalks/maptalks.js

直线的无线滚动动画在高分辨率的屏幕上会使整个页面卡死

Open
#2,090 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
HTML
Stars
4.5k
Forks
511
Avg merge
3d 58m
Merged PRs (30d)
1

Description

**maptalks's version and what browser you use?**
----
直线的无线滚动动画在高分辨率的屏幕上会使整个页面卡死

**Issue description**
---
let start = [item1.pointList[0].lngWgs, item1.pointList[0].latWgs];
let end = [item1.pointList[1].lngWgs, item1.pointList[1].latWgs];
const line = new maptalks.LineString([start, end], {
symbol: {
linePatternFile,
linePatternDx: 0,
lineWidth: 15,
// linePatternAnimSpeed: 0.25,
},
}).addTo(this.layer);
this.markerArrary[`${index}${index1}`] = line;
this.largePointJsonList[`${index}${index1}`] = line;
function animateLine() {
line.animate(
{
symbol: {
// 20 is the width of pattern.png to ensure seamless animation
linePatternDx: 30,
lineWidth: 15,
linePatternAnimSpeed: 0.25,
},
},
{
// 'duration': 3000, // 动画持续时间,单位毫秒
easing: "linear", // 缓动函数,这里使用线性动画
repeat: true, // 是否循环播放
}
);
}
line.on("animateend", function () {
// 动画结束后立即启动下一次动画
animateLine();
});
animateLine();

});
在高分辨率的屏幕上直接卡死,整个地图页面都卡死,动不了,麻烦作者给看一下
**Please provide a reproduction URL (on any jsfiddle like site)**
----

Contributor guide

Open the contributing guide

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 from the supplied LineString example and reproduce the freeze with the repeating linePattern animation on a high-resolution display. Investigate the interaction between linePatternAnimSpeed, repeated animation callbacks, and rendering load. Done means the animation remains responsive without freezing the map page; no repository file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.