新增等值线图样式自定义功能

This commit is contained in:
JIANG
2025-12-19 11:43:33 +08:00
parent 9953fc5bd8
commit ac966242e7
4 changed files with 119 additions and 69 deletions
-15
View File
@@ -111,21 +111,6 @@ export class DeckLayer extends Layer {
// 替换为新的 layer 实例
return layerOrProps;
}
// 否则假定传入的是 props 对象,使用现有 layer.clone(props) 创建新实例
try {
return layer.clone(layerOrProps);
} catch (err) {
// 如果 clone 失败,作为降级策略尝试手动复制 props 到新对象(保留原 layer
// 这通常不应该发生,但保证不会抛出而破坏整个 layers 列表
const newLayer = layer.clone
? layer.clone(layerOrProps)
: {
...layer,
props: { ...(layer.props || {}), ...(layerOrProps || {}) },
};
return newLayer;
}
});
this.deck.setProps({ layers: updatedLayers });