Skip to content

Canvas simulates gradient path #2423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 14, 2024
Merged

Canvas simulates gradient path #2423

merged 5 commits into from
Oct 14, 2024

Conversation

deyihu
Copy link
Collaborator

@deyihu deyihu commented Sep 13, 2024

fix #2123
fix #1712

canvas模拟webgl 渐变的线条

{Y W4OQG6RM91_0XG CZ${0

利用颜色插值绘制多个小的的线段,所以性能会比较差,不适合大规模的数据

@fuzhenn
Copy link
Member

fuzhenn commented Sep 19, 2024

需要增加一个简单的测试用例

@deyihu
Copy link
Collaborator Author

deyihu commented Sep 24, 2024

@fuzhenn 测试已经添加

@deyihu deyihu requested a review from fuzhenn September 24, 2024 01:36
@fuzhenn
Copy link
Member

fuzhenn commented Sep 29, 2024

建议和LineStringLayer以及VectorTileLayer统一一下gradients的定义方式,这种定义方式有个好处是,同样的数据放在VectorLayer,LineStringLayer和VectorTileLayer里都能获得同样的渐变样式:

const line = new maptalks.LineString([[0, 1], [1, 1]], {
    symbol: {
        lineGradientProperty: 'gradients',
        lineWidth: 20,
    },
    properties: {
        gradients: [0, 'red', 0.7, 'yellow', 1, 'green']
    }
});

@deyihu
Copy link
Collaborator Author

deyihu commented Oct 6, 2024

lineGradientProperty support added

@fuzhenn fuzhenn merged commit 8cdaea8 into maptalks:master Oct 14, 2024
1 check passed
@deyihu deyihu deleted the 2123 branch October 14, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants