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

vue-amap2.x

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-amap2.x

高德地图js api 2.x版本 - Vue

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

vue-amap2.x

Installation

npm install vue-amap2.x --save

Usage

<VueAmap2x :mapOptions="mapOptions" :plugins="plugins" v-on:pluginInstalled="handleGeolocation" mapKey="ccd1e3a84dd69c646c53abd884db7141" v-on:moveend="handleMoveEnd" v-on:complete="handleMapLoaded" :center="center" v-on:zoomend="handleZoomEnd"></VueAmap2x>

mapKey 对应高德开发者中心申请的key

申请key

mapOptions 实例化地图对象构造函数参数

mapOptions = {
  mapStyle: "amap://styles/light",
  center: [],
  zoom: [],
  ...
}

plugins 插件

参考高德地图官方插件文档

注意,plugins是数组类型,此方式是采用异步加载插件,加载完插件后可以监听插件安装完回调事件,v-on:pluginInstalled.

event hooks 钩子回调函数

  • zoomstart
  • zoomchange
  • zoomend
  • movestart
  • mapmove
  • moveend
  • dragstart
  • dragging
  • dragend
  • complete
以上钩子函数可通过v-on监听

center 地图实例化的时候初始化中心点坐标

width 实例化地图设置宽度,字符串类型

height 实例化地图设置的高度,字符串类型

FAQs

Package last updated on 01 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