From 2cc1d5ac4edd902a9ba066a78d9114ecad2c4dc8 Mon Sep 17 00:00:00 2001 From: Duy Dung Date: Mon, 8 Jun 2026 15:01:01 +0700 Subject: [PATCH] Support focus KCN --- example/src/App.js | 35 ++- src/components/MFMapView.js | 42 ++-- src/components/MFPolygonFocus.js | 23 ++ src/components/extends/AreaFocuser.js | 333 ++++++++++++++++++++++---- src/components/extends/BoundHelper.js | 43 ++++ 5 files changed, 408 insertions(+), 68 deletions(-) create mode 100644 src/components/MFPolygonFocus.js create mode 100644 src/components/extends/BoundHelper.js diff --git a/example/src/App.js b/example/src/App.js index 1ff8fa0..4a53d8b 100644 --- a/example/src/App.js +++ b/example/src/App.js @@ -22,7 +22,7 @@ function App() { console.log('Press Building:', e.nativeEvent) } - const onFocusWithHighlight = async () => { + const onFocusProvince = async (highlight) => { const areaFocuser = mapRef.current?.areaFocuser if (!areaFocuser) { return @@ -30,7 +30,7 @@ function App() { await areaFocuser.focusProvince({ name: 'Ha Noi', - highlight: true, + highlight: highlight, }) } @@ -43,10 +43,39 @@ function App() { await areaFocuser.focusProvince(null) } + const onFocusIndustrialZone = async () => { + const areaFocuser = mapRef.current?.areaFocuser + if (!areaFocuser) { + return + } + + await areaFocuser.focus({ + id: 2, + type: 'industrial', + display: 'normal', + }) + } + + const onFocusIndustrialZoneHighlight = async () => { + const areaFocuser = mapRef.current?.areaFocuser + if (!areaFocuser) { + return + } + + await areaFocuser.focus({ + id: 2, + type: 'industrial', + display: 'highlight', + }) + } + return ( -