New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

amap-js

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amap-js

AMap高德地图API加载器。

latest
Source
npmnpm
Version
2.4.0
Version published
Weekly downloads
4K
-1.34%
Maintainers
1
Weekly downloads
 
Created
Source

AMapJS

基于AMap高德地图构建的API加载器。

GitHub CI npm version npm downloads npm license

🔥 文档网站    💡 国内镜像文档

特性

  • 开箱即用的高质量 Loader。
  • 友好指定 API 版本。
  • 支持按需引入。
  • 支持插件模块加载。
  • 可以 Loader 队列加载。
  • 允许多次执行加载操作,网络资源不会重复请求。

安装

# 通过 npm 安装
npm i amap-js -S

# 通过 yarn 安装
yarn add amap-js

快速入手

import AMapJS from 'amap-js';
// or
// import { AMapLoader, AMapUILoader, LocaLoader, ... } from 'amap-js';

// 创建AMapLoader
const loader = new AMapJS.AMapLoader({
  key: '您申请的高德Key值',
  version: '2.0',
  plugins: [],
});

// 调用 load 方法完成加载并调用执行回调。
loader
  .load()
  .then(() => {
    // 加载完成
    console.log(AMap);
  })
  .catch(e => {
    // 加载失败
  });

AMapJS 支持按需引入、CDN 引入等方式,详细说明见 快速上手.

浏览器支持

ChromeFirefoxSafariOperaEdgeIE
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔9+ ✔

AMapJS 支持 现代浏览器以及所有兼容 ECMAScript 5 的浏览器.

许可

MIT

Keywords

amap

FAQs

Package last updated on 07 Dec 2021

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