npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lch-vue-amap-plus-test

v1.0.5

Published

vue3 component of amap

Downloads

11

Readme

使用

  • 安装
npm install -S @wintoo/vue-amap-plus
  • 快速上手

Vue项目文件入口中引入 @wintoo/vue-amap-plus

// main.ts
import VueAMapPlus, { VueAmapPlusOptions } from '@wintoo/vue-amap-plus';
import '@wintoo/vue-amap-plus/dist/style.css'
// 添加ts类型声明
import '@wintoo/vue-amap-plus/types'

const options: VueAmapPlusOptions = {
  key: 'YOUR_KEY',
  v: '2.0',
  plugins: []
};
Vue.use(VueAMapPlus, options);
  • Volar 支持
// tsconfig.json
{
  "compilerOptions": {
    // ...
    "types": ["@wintoo/vue-amap-plus/types/global"]
  }
}

项目支持.d.ts类型声明文件,在vite.config.ts添加如下配置

export default defineConfig({
  plugins: [vue()],
  resolve: {
    extensions: ['.ts', '.d.ts'],
  },
});

在组件中引入地图组件, 注意,地图组件父元素需设置宽高,地图才能正常显示

<template>
	<div class="map-container">
      <amap-map></amap-map>
    </div>
</template>

<style>
.map-container {
    height: 400px;
    width: 100%
}
</style>

组件列表总览

已实现的组件

地图

  • 地图组件 amap-map
<div class="map-container">
  <amap-map></amap-map>
</div>

覆盖物

  • 点标记 amap-marker
  • 文本标记 amap-text
  • 圆形 amap-circle
  • 圆点标记 amap-circle-marker
  • 折线 amap-polyline
  • 多边形 amap-polygon
  • 信息窗体 amap-infowindow
  • 矩形 amap-rectangle
  • 椭圆 amap-ellipse
  • 海量点标记 mass-marks
  • 标注及标注图层 amap-labels-layeramap-label-marker

图层

  • 路网图层 amap-roadnet
  • 卫星图层 amap-satellite
  • 标准图层 amap-tilelayer
  • 交通图层 amap-traffic
  • 楼快图层 amap-buildings

插件

  • 地图控件 amap-controlbar
  • 图层切换 amap-maptype
  • 比例尺 amap-scale
  • 工具条 amap-toolbar
  • 鹰眼 amap-overview
  • 折线编辑插件 amap-polyline-editor
  • 多边形编辑插件 amap-polygon-editor
  • 矩形编辑插件 amap-rectangle-editor
  • 圆形编辑插件 amap-circle-editor
  • 椭圆编辑插件 amap-ellipse-editor

Loca 数据可视化

  • 图层的容器和控制器 loca
  • 基本热力图 loca-heatmap
  • 蜂窝热力图 loca-hexagon

未实现的组件

高德地图 JS API 加载

  • 顺序同步加载

与高德官方一致,在 Vue项目 public/index.html文件中引入

<script src="https://webapi.amap.com/maps?v=1.4.15&key=您申请的key值"></script>
  • 异步加载

不在 public/index.html文件中引入,在 main.js 中,此时会以异步的方式加载 JS API

import Vue from 'vue';
import VueAMap from '@wintoo/vue-amap-plus';

const options = {
  key: 'YOUR_KEY',
  v: '1.4.15',
  plugins: []
};
Vue.use(VueAMap, options);

VueAmap API

  • AMap 对象获取, amapLoader
<script>
  import { amapLoader } from '@wintoo/vue-amap-plus'
  export default {
    mounted(){
      amapLoader.then(AMap => {
        // code
        console.log(AMap)
      })
    }
  }
</script>
  • Loca 对象获取
<script>
  import { locaLoader } from '@wintoo/vue-amap-plus'
  export default {
    mounted(){
      locaLoader.then(Loca => {
        // code
        console.log(Loca)
      })
    }
  }
</script>