Socket
Book a DemoInstallSign in
Socket

@uiw/react-amap-control-bar-control

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-amap-control-bar-control

组合了旋转、倾斜、复位在内的地图控件。

7.1.9
latest
Source
npmnpm
Version published
Weekly downloads
272
-23.16%
Maintainers
2
Weekly downloads
 
Created
Source
使用 我的应用 也是一种 支持 我的方式:
Vidwall Mousio Hint Mousio Musicer Audioer FileSentinel FocusCursor Videoer KeyClicker DayBar Iconed RightMenu Master Quick RSS Quick RSS Web Serve Copybook Generator DevTutor for SwiftUI RegexMate Time Passage Iconize Folder Textsound Saver Create Custom Symbols DevHub Resume Revise Palette Genius Symbol Scribe

ControlBarControl 组合了旋转、倾斜、复位在内的地图控件

Buy me a coffee npm version Downloads

组合了旋转、倾斜、复位在内的地图控件。 相关示例

import { ControlBarControl } from '@uiw/react-amap';
// 或者单独安装使用
import { ControlBarControl } from '@uiw/react-amap-control-bar-control';

基本用法

import ReactDOM from 'react-dom';
import React, { useState, useRef } from 'react';
import { Map, APILoader, ControlBarControl } from '@uiw/react-amap';

const Demo = () => {
  const [show, setShow] = useState(true);
  return (
    <>
      <button onClick={() => setShow(!show)}>
        {show ? '关闭' : '开启'}
      </button>
      <div style={{ width: '100%', height: '300px' }}>
        <Map>
          <ControlBarControl
            visible={show}
            offset={[30, 10]}
            position="RT"
          />
          {show && (
            <ControlBarControl
              visible={show}
              offset={[10, 10]}
              position="RB"
            />
          )}
        </Map>
      </div>
    </>
  );
}

const Mount = () => (
  <APILoader akey="a7a90e05a37d3f6bf76d4a9032fc9129">
    <Demo />
  </APILoader>
);

export default Mount;

Props

参数说明类型默认值
visible覆盖物是否可见。boolean-
position控件停靠位置 { top: 5; left: 5; right: 5; bottom: 5 } 或者 'LT': 左上角, 'RT': 右上角, 'LB': 左下角, 'RB': 右下角。`stringobject`
offset相对于地图容器左上角的偏移量,正数代表向右下偏移。默认为 AMap.Pixel(10,10)[number, number]-

Keywords

react-amap

FAQs

Package last updated on 23 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.