Skip to content
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

Point Layer 是否支持自定义的shape? #1803

Closed
seanzb1985 opened this issue Aug 29, 2023 · 5 comments
Closed

Point Layer 是否支持自定义的shape? #1803

seanzb1985 opened this issue Aug 29, 2023 · 5 comments
Labels
👀 need more info issue 需要提供更多描述信息

Comments

@seanzb1985
Copy link

目前 PointLayer 只支持一些内置的shape 类型,如
// shape 支持的各种形状
type IFillShape =
| 'circle'
| 'square'
| 'hexagon'
| 'triangle'
| 'pentagon'
| 'octogon'
| 'hexagram'
| 'rhombus'
| 'vesica';

请问Point Layer是否可以支持自定义的Shape 类型,如果支持,请给一个参考示例。

@lzxue
Copy link
Contributor

lzxue commented Aug 29, 2023

完全自定义可以使用 Marker,如果希望基于 Pointlayer 自定义可以说一下详细需求,我看看有什么方案

@seanzb1985
Copy link
Author

seanzb1985 commented Aug 29, 2023

Marker 是可以自定义,但是需要完全自定义dom, 不宜使用,数据量大时,可能出现性能问题,最重要的是,集成的时候,想获得和PointLayer 一样的使用体验,所以,有这样的需求:

  1. 提供一个svg 的path, 这个path 描述一个自定义的几何图形,且保证这个图形是封闭的,用户可以注册这个svg icon 作为内置形状的扩展。
  2. 可以在PointLayer中使用这个新注册的自定义shape。
  3. 设置size属性时,可以改变大小;设置color属性时,可以对自定义shape进行颜色填充。

@lzxue
Copy link
Contributor

lzxue commented Aug 31, 2023

这种两种方式实现:

  • 如果是单色的图标可以使用 iconfont ,可以做支持数据映射。
    -使用图片图层,但是需要先把 SVG 改成不同样式的图标,图片图层其实也可以跟进颜色映射,但是对普通要求可以试试。

@lzxue lzxue added the 👀 need more info issue 需要提供更多描述信息 label Sep 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

Hello @seanzb1985. Please provide a online reproduction by forking codesandbox of @antv/l7 demo template Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @seanzb1985, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 @antv/l7 demo 模板 3 天内未跟进此 issue 将会被自动关闭。

@github-actions
Copy link
Contributor

由于该 issue 被标记为需要更多信息,却 15 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

Since the issue was labeled as "👀 need more info" but no response was received for 15 days. Now close the issue. If you have any questions, feel free to comment.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 need more info issue 需要提供更多描述信息
Projects
None yet
Development

No branches or pull requests

2 participants