diff --git a/packages/component/src/popup.ts b/packages/component/src/popup.ts index cdb736eb22..5dbcd35627 100644 --- a/packages/component/src/popup.ts +++ b/packages/component/src/popup.ts @@ -214,13 +214,16 @@ export default class Popup extends EventEmitter implements IPopup { } // 高德地图需要阻止事件冒泡 // 测试mapbox 地图不需要添加 - ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick'].forEach( - (type) => { - this.container.addEventListener(type, (e) => { - e.stopPropagation(); - }); - }, - ); + const { stopPropagation } = this.popupOption; + if (stopPropagation) { + ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick'].forEach( + (type) => { + this.container.addEventListener(type, (e) => { + e.stopPropagation(); + }); + }, + ); + } } if (maxWidth && this.container.style.maxWidth !== maxWidth) { this.container.style.maxWidth = maxWidth; diff --git a/packages/layers/src/utils/__tests__/extrude_polyline.spec.ts b/packages/layers/src/utils/__tests__/extrude_polyline.spec.ts index 9cea6c49ce..c2ce9a7eb7 100644 --- a/packages/layers/src/utils/__tests__/extrude_polyline.spec.ts +++ b/packages/layers/src/utils/__tests__/extrude_polyline.spec.ts @@ -18,6 +18,6 @@ describe('extrude polyline', () => { coord[1] = lat; }); const mesh = extrude.extrude(coords); - expect(mesh.indices.length).toBe(6); + expect(mesh.indices.length).toBe(12); }); }); diff --git a/packages/layers/src/utils/extrude_polyline.ts b/packages/layers/src/utils/extrude_polyline.ts index 4c0a668e2e..be92556998 100644 --- a/packages/layers/src/utils/extrude_polyline.ts +++ b/packages/layers/src/utils/extrude_polyline.ts @@ -97,7 +97,7 @@ export default class ExtrudePolyline { this.normal = null; this.totalDistance = 0; // 去除数组里重复的点 - points = getArrayUnique(points); + // points = getArrayUnique(points); const total = points.length; let count = complex.startIndex; for (let i = 1; i < total; i++) { diff --git a/packages/maps/package.json b/packages/maps/package.json index b58c0fcd70..09b5049141 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@types/gl-matrix": "^2.4.5", - "@types/mapbox-gl": "^0.54.3", + "@types/mapbox-gl": "^1.11.2", "@types/viewport-mercator-project": "^6.1.0" }, "gitHead": "20154fe30d512024b03ac5e40f77731bc0580bb0", diff --git a/stories/React/components/Scene.tsx b/stories/React/components/Scene.tsx index 544d8857fd..d7e9e0dc75 100644 --- a/stories/React/components/Scene.tsx +++ b/stories/React/components/Scene.tsx @@ -2,6 +2,8 @@ import { AMapScene, LayerContext, LineLayer, + PolygonLayer, + MapboxScene, Marker, Popup, SceneContext, @@ -45,14 +47,14 @@ export default React.memo(function Map() { option={{ closeOnClick: false, }} - lnglat={[110.1938, 50.25] as number[]} + lnglat={[110.1938, 30.25] as number[]} > -
122222
+122224
-122222
+tes