From 7c32dd1b4d863bc5c54e9e9ea550f068160210fc Mon Sep 17 00:00:00 2001 From: lvisei Date: Fri, 8 Dec 2023 20:18:23 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E5=8F=8C=E5=B1=8F?= =?UTF-8?q?=E6=A1=88=E4=BE=8B=20(#203)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: 双屏对比方案 * docs: 更新高度 --- src/components/SyncScene/demos/default.tsx | 74 ++++++++++++++++++++-- src/components/SyncScene/demos/zoomGap.tsx | 2 +- 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/src/components/SyncScene/demos/default.tsx b/src/components/SyncScene/demos/default.tsx index 9bb2e8ef..0813029b 100644 --- a/src/components/SyncScene/demos/default.tsx +++ b/src/components/SyncScene/demos/default.tsx @@ -2,8 +2,9 @@ * compact: true */ import type { Scene } from '@antv/l7'; -import { LarkMap, SyncScene } from '@antv/larkmap'; -import React from 'react'; +import { HeatmapLayer, LarkMap, PointLayer, SyncScene } from '@antv/larkmap'; +import { useRequest } from 'ahooks'; +import React, { useMemo } from 'react'; export default () => { const [sceneArray, setSceneArray] = React.useState([]); @@ -11,26 +12,85 @@ export default () => { setSceneArray((oldValue) => [...oldValue, scene]); }; + const { data } = useRequest(() => + fetch('https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json').then((res) => + res.json(), + ), + ); + + const sourc1 = useMemo( + () => ({ + data: data ?? { type: 'FeatureCollection', features: [] }, + parser: { + type: 'geojson', + }, + }), + [data], + ); + + const sourc2 = useMemo( + () => ({ + data: data ?? { type: 'FeatureCollection', features: [] }, + parser: { + type: 'geojson', + }, + transforms: [ + { + type: 'hexagon', + size: 400, + field: 'h12', + method: 'sum', + }, + ], + }), + [data], + ); + + if (!data) return null; + return (
-
+
-

地图1

+

方案 1

+
-

地图2

+

方案 2

+
diff --git a/src/components/SyncScene/demos/zoomGap.tsx b/src/components/SyncScene/demos/zoomGap.tsx index df04bd62..dfff5f5d 100644 --- a/src/components/SyncScene/demos/zoomGap.tsx +++ b/src/components/SyncScene/demos/zoomGap.tsx @@ -20,7 +20,7 @@ export default () => { return (
设置zoomGap: -
+