From a03b41787b160d9d71303b2cb5a705684e6c5cfb Mon Sep 17 00:00:00 2001 From: YiQianYao <42212176+2912401452@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:55:31 +0800 Subject: [PATCH] Shihuidev (#1043) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: fillImage 支持自由设置图标的旋转角度 * style: lint style * feat: 增加对 pointLayer 的 shape 切换支持 --- packages/layers/src/utils/updateShape.ts | 6 ++++++ stories/Map/components/mapCenter.tsx | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/layers/src/utils/updateShape.ts b/packages/layers/src/utils/updateShape.ts index 49ad412d20..b29f37a6ce 100644 --- a/packages/layers/src/utils/updateShape.ts +++ b/packages/layers/src/utils/updateShape.ts @@ -23,10 +23,16 @@ export function updateShape( typeof currentShape === 'string' && lastShape !== currentShape ) { + if(layer.type === 'PointLayer') { + layer.dataState.dataSourceNeedUpdate = true; + return; + } + shapeUpdateList.map((shapes) => { if (shapes.includes(lastShape) && shapes.includes(currentShape)) { // TODO: dataSourceNeedUpdate 借用数据更新时更新 layer model 的工作流 layer.dataState.dataSourceNeedUpdate = true; + return; } }); } diff --git a/stories/Map/components/mapCenter.tsx b/stories/Map/components/mapCenter.tsx index 87fbe4a16f..fb6dc16eaf 100644 --- a/stories/Map/components/mapCenter.tsx +++ b/stories/Map/components/mapCenter.tsx @@ -70,6 +70,10 @@ export default class GaodeMapComponent extends React.Component { }, }, ) + // - cylinder + // - triangleColumn + // - hexagonColumn + // - squareColumn, .shape('circle') // .shape('cylinder') // .color('#0f9') @@ -108,6 +112,11 @@ export default class GaodeMapComponent extends React.Component { // }) // .active({ color: '#00f' }); + setTimeout(() => { + layer.shape('triangleColumn') + scene.render(); + }, 2000) + this.scene = scene; // console.log('layer', layer)