
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@uiw/react-amap-api-loader
Advanced tools
用于加载高德地图 SDK 依赖,加载完成,全局将会有 window.AMap
对象。
import { APILoader } from '@uiw/react-amap';
// 或者单独安装使用
import { APILoader } from '@uiw/react-amap-api-loader';
Map 的父组件必须具有宽度和高度;
import ReactDOM from 'react-dom';
import { Map, APILoader } from '@uiw/react-amap';
const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<APILoader akay="a7a90e05a37d3f6bf76d4a9032fc9129">
<Map />
</APILoader>
</div>
);
ReactDOM.render(<Demo />, _mount_);
import ReactDOM from 'react-dom';
import { Map, APILoader } from '@uiw/react-amap';
const Demo = () => (
<div style={{ width: '100%', height: 300 }}>
<APILoader akay="a7a90e05a37d3f6bf76d4a9032fc9129">
<Map style={{ height: 100, marginBottom: 10 }} />
<div style={{ border: '1px solid red' }}>
<Map style={{ height: 100 }} />
</div>
</APILoader>
</div>
);
ReactDOM.render(<Demo />, _mount_);
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
akay | 必填 您需先申请密钥(ak)才可使用该服务。⚠️ 注意申请 Web端(JS API) | string | - |
version | SDK 版本 | string | 2.0 |
protocol | 协议,默认是根据当前网站协议的 | http /https | window.location.protocol |
hostAndPath | 请求 SDK 的前半部分 | string | webapi.amap.com/maps |
callbackName | 回调函数 | string | load_amap_sdk |
plugin | 加载一个或者多个插件 AMap.ToolBar,AMap.Driving | string | - |
FAQs
用于加载高德地图 SDK 依赖,加载完成,全局将会有 **`window.AMap`** 对象。
The npm package @uiw/react-amap-api-loader receives a total of 117 weekly downloads. As such, @uiw/react-amap-api-loader popularity was classified as not popular.
We found that @uiw/react-amap-api-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.