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 ( -