Gathering detailed insights and metrics for @uiw/react-baidu-map-overview-map-control
Gathering detailed insights and metrics for @uiw/react-baidu-map-overview-map-control
Gathering detailed insights and metrics for @uiw/react-baidu-map-overview-map-control
Gathering detailed insights and metrics for @uiw/react-baidu-map-overview-map-control
基于 React 封装的百度地图组件,支持 React Hook,帮助你轻松的接入地图到 React 项目中。
npm install @uiw/react-baidu-map-overview-map-control
Typescript
Module System
Node Version
NPM Version
TypeScript (98.85%)
HTML (0.99%)
Less (0.14%)
Shell (0.03%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
232 Stars
522 Commits
22 Forks
6 Watchers
8 Branches
12 Contributors
Updated on Jul 10, 2025
Latest Version
2.7.3
Package Id
@uiw/react-baidu-map-overview-map-control@2.7.3
Unpacked Size
13.44 kB
Size
3.66 kB
File Count
12
NPM Version
8.19.4
Node Version
20.19.1
Published on
May 02, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
缩略地图控件。你也可以使用 Map
组件 widget
属性来设置控件更方便。
1import { OverviewMapControl, useOverviewMapControl } from '@uiw/react-baidu-map'; 2// 或者单独安装使用 3import OverviewMapControl, { useOverviewMapControl } from '@uiw/react-baidu-map-overview-map-control';
1import React, { useState, useRef } from 'react'; 2import { Map, APILoader, OverviewMapControl } from '@uiw/react-baidu-map'; 3 4const Example = () => { 5 const [show, setShow] = useState(true); 6 return ( 7 <div> 8 <button onClick={() => setShow(!show)}> 9 {show ? '关闭' : '开启'} 10 </button> 11 <Map zoom={13} style={{ height: 300 }}> 12 {show && ( 13 <OverviewMapControl isOpen /> 14 )} 15 <OverviewMapControl 16 isOpen 17 visiable={show} 18 offset={new BMap.Size(40, 40)} 19 anchor={BMAP_ANCHOR_TOP_RIGHT} 20 onViewChanged={() => { 21 console.log('onViewChanged ..') 22 }} 23 /> 24 </Map> 25 </div> 26 ); 27} 28 29const Demo = () => ( 30 <div style={{ width: '100%' }}> 31 <APILoader akay="eYpCTECSntZmw0WyoQ7zFpCRR9cpgHFG"> 32 <Example /> 33 </APILoader> 34 </div> 35); 36 37export default Demo;
overviewMapControl
, setGeolocationControl
1import React from 'react'; 2import { useRef, useEffect, useState } from 'react'; 3import { Map, APILoader, Provider, useMap, useOverviewMapControl } from '@uiw/react-baidu-map'; 4 5const Example = () => { 6 const divElm = useRef(null); 7 const [show, setShow] = useState(true); 8 const { setContainer, map } = useMap(); 9 const { overviewMapControl } = useOverviewMapControl({ 10 map, anchor: BMAP_NAVIGATION_CONTROL_LARGE, visiable: show, isOpen: true, 11 }); 12 13 useEffect(() => { 14 if (divElm.current && !map) { 15 setContainer(divElm.current); 16 } 17 }, [map]); 18 return ( 19 <> 20 <button onClick={() => setShow(!show)}> 21 {show ? '关闭' : '开启'} 22 </button> 23 <div ref={divElm} style={{ height: '100%' }} /> 24 </> 25 ); 26} 27 28const Demo = () => ( 29 <div style={{ width: '100%', height: '300px' }}> 30 <APILoader akay="eYpCTECSntZmw0WyoQ7zFpCRR9cpgHFG"> 31 <Provider> 32 <Example /> 33 </Provider> 34 </APILoader> 35 </div> 36); 37export default Demo;
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
visiable | 覆盖物是否可见。 | boolean | - |
anchor | 控件的位置偏移值。 | ControlAnchor | BMAP_ANCHOR_TOP_RIGHT |
offset | 控件的水平偏移值。 | BMap.Size | - |
size | 缩略地图控件的大小 | BMap.Size | - |
isOpen | 缩略地图添加到地图后的开合状态,默认为关闭。 | boolean | - |
参数 | 说明 | 类型 |
---|---|---|
onViewChanged | 缩略地图开合状态发生变化后触发此事件 | (event: { type: any, target: any, isOpen: boolean }) => void; |
onViewChanging | 缩略地图开合状态发生变化过程中触发此事件 | (event: { type: any, target: any }) => void; |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
packaging workflow detected
Details
Reason
2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More