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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vueuse-bmap-vgl

v1.0.0

Published

Vue 3 composition API wrapper for Baidu MapVGL (百度地图GL 可视化图层库)

Readme

vueuse-bmap-vgl

Vue 3 组合式 API (Composition API) 封装的百度地图 MapVGL 可视化库。

npm version license

特性

  • 🚀 高性能渲染:针对海量点/线/面要素进行浅层响应式优化,避免递归代理带来的主线程卡顿。
  • 👁 智能 View 调度:提供统一的 View 实例检索体系(显式传入 -> 祖先注入 -> 默认单例创建),完美保障各图层间的 renderOrder 层级顺序。
  • 🎯 开箱即用鼠标拾取:内置 usePick / 各图层方法,支持便捷获取鼠标悬停或点击命中的地理要素数据。
  • 💎 全量类型支持:内置完整的 TypeScript 类型声明与 JSDoc 注释。

安装

# npm
npm install vueuse-bmap-vgl vueuse-bmap-jsapi mapvgl vue

# pnpm
pnpm add vueuse-bmap-vgl vueuse-bmap-jsapi mapvgl vue

快速上手

<template>
  <div ref="container" style="width: 100%; height: 600px;" />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useBmap } from 'vueuse-bmap-jsapi'
import { useView, useIconLayer, useLineLayer, usePolygonLayer } from 'vueuse-bmap-vgl'

const { container } = useBmap()

// 1. 创建共享的 MapVGL View
const { view } = useView()

// 2. 挂载点标注图层
const { data: iconData, pick: pickIcon } = useIconLayer({
  view,
  renderOrder: 3,
  options: {
    width: 32,
    height: 32,
    offset: [0, -16],
  },
  data: [
    {
      geometry: { type: 'Point', coordinates: [116.404, 39.915] },
      properties: { icon: '/marker.png', title: '示例点位' },
    },
  ],
})
</script>

支持的图层 Hooks

  • useView: 创建或绑定 MapVGL 视图上下文
  • useIconLayer: 图标点图层
  • useLineLayer: 折线/飞线图层
  • usePolygonLayer: 多边形面图层
  • usePick: 全局地图要素鼠标拾取

License

MIT