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

🐛 [BUG] #238

Open
CanonLs opened this issue Sep 11, 2024 · 4 comments
Open

🐛 [BUG] #238

CanonLs opened this issue Sep 11, 2024 · 4 comments

Comments

@CanonLs
Copy link

CanonLs commented Sep 11, 2024

PolygonLayerProps 配置 raisingHeight高度无效

const layerOptions: Omit<PolygonLayerProps, 'source'> = {
    autoFit: true,
    shape: 'fill',
    color: "#0DCCFF",
    state: {
        active: true,
    },
    style: {
        raisingHeight: 200000,
        opacity: 0.5,
    },
};

需要手动在源文件中增加才可以
/Users/canonls/Desktop/CanonLs/tempReact/node_modules/.pnpm/@AntV+l7-composite-layers@0.17.1_@antv[email protected]/node_modules/@antv/l7-composite-layers/dist/lib/core-layers/polygon-layer/types.d.ts

import { CoreLayerOptions } from '../../core/core-layer';
/**
 * 面图层 图形形状
 */
export type PolygonShape = 'fill' | 'line' | 'extrude';
/**
 * 面图层 图层样式
 */
export type PolygonLayerStyleOptions = {
    opacity?: number;
/**
 * !!!!!! 在这里手动添加⬇️
 */
    raisingHeight?:number
};
/**
 * 面图层配置
 */
export interface PolygonLayerOptions extends CoreLayerOptions {
    /**
     * 图形形状
     */
    shape?: PolygonShape;
    /**
     * 图层样式
     */
    style?: PolygonLayerStyleOptions;
}

🐛 Bug description [Please make everyone to understand it]

Please provide a link by forking these links LarkMap or GitHub repo, a minimal reproduction.

  • Required Link to minimal reproduction:

📷 Step to reproduce

🏞 Expected result

🚑 Any additional [like screenshots]

  • LarkMap Version:
  • Platform:
@lvisei
Copy link
Member

lvisei commented Sep 11, 2024

是指类型问题是吧

@CanonLs
Copy link
Author

CanonLs commented Sep 11, 2024

指的是类型问题吧

对的 type PolygonLayerStyleOptions 在源文件里面之定义了 opacity?: number; 并没有raisingHeight 等其他属性 所以我不知道怎么使用raisingHeight 就手动改源文件了。这个是就这样设计的吗 还是说我用错了..

@CanonLs
Copy link
Author

CanonLs commented Sep 11, 2024

是指类型问题是吧

就像这段代码

const layerOptions: Omit<TextLayerProps, 'source'> = {
    autoFit: true,
    field: 'text',
    style: {
        fill: {
            field: 't',
            value: [
                '#ffba08',
                '#faa307',
                '#f48c06',
                '#e85d04',
                '#dc2f02',
                '#d00000',
                '#9d0208',
                '#6a040f',
                '#370617',
                '#03071e',
            ],
        },
        opacity: 1,
        fontSize: 18,
        textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left
        spacing: 2, // 字符间距
        padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近
        stroke: '#0ff', // 描边颜色
        strokeWidth: 0.2, // 描边宽度
        textAllowOverlap: true,
        raisingHeight: 200000 + 150000 + 10000,

    },
};

style属性raisingHeight 会报错 提示如图
截屏2024-09-12 04 28 29

所以 是我的用法错了吗。。。。

@lvisei
Copy link
Member

lvisei commented Sep 12, 2024

类型没有更新,可以来提 PR 帮忙加一下~

代码在这个仓库里 https://github.com/antvis/L7Plot/blob/main/packages/composite-layers/src/core-layers/text-layer/types.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants