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

czmap

v0.0.1-alpha.97

Published

- 提供统一的API 实现不同的地图(百度、高德、腾讯)应用 丝滑切换 - 主要实现功能 - 基础地图展示 - 路径 - 围栏 #### 相关API使用

Readme

CZMap

  • 提供统一的API 实现不同的地图(百度、高德、腾讯)应用 丝滑切换
  • 主要实现功能
    • 基础地图展示
    • 路径
    • 围栏: circle 圆形 polygon 多边型 district 行政区域(百度和高德实现) polyline 线形围栏数据(百度和高德实现 )

相关API使用id:

    // html
    <div id="map"></div>
    // js
    const options = {
        id: 'map', // 配置地图的着陆点  id
        mapAk: '', // 写入Ak
        poiText: true, //是否显示POI信息 - 仅百度
        poiIcon: true, //是否显示POI图标信息 - 仅百度
        type: 'BMAP', // 设置使用地图的类型 BMAP 百度地图、 TMAP 腾讯、AMAP 高德
        points: [116.307503, 39.984104], // 中心点设置 
        areaName: '上海市', // 中心城市 - 仅百度
        zoom: 11, // 缩放级别 
        enableScrollWheel: false, // 开启滚轮 
        isScaleCtrl: true, // 添加比例尺控件
        isZoomCtrl: true, // 添加缩放控件
        navi3DCtrl: true, // 添加3D控件 
        // drivingType: 'path', // 使用路径搜索展示
        //展示轨迹路线
        // drivingPath:[{ 
        //     'lng': 116.297611,
        //     'lat': 40.047363
        // }, {
        //     'lng': 116.302839,
        //     'lat': 40.048219
        // }, {
        //     'lng': 116.308301,
        //     'lat': 40.050566
        // }, {
        //     'lng': 116.305732,
        //     'lat': 40.054957
        // }, {
        //     'lng': 116.304754,
        //     'lat': 40.057953
        // }, {
        //     'lng': 116.306487,
        //     'lat': 40.058312
        // }, {
        //     'lng': 116.307223,
        //     'lat': 40.056379
        // }],
        // 行政区域围栏
        // 围栏信息圆形
        enclosure: {  
            strokeColor: "#6699FF",  
            strokeWeight: 2,
            strokeOpacity: 1, 
            proname: '北京',  // 百度地图 行政区域参数
            adcodes:[310000], // 高德地图 行政区域参数
            type: 'district', // // circle 圆形   polygon 多边型  district 行政区域(百度和高德实现) polyline 线形围栏数据(百度和高德实现 )
        },
        // 圆形
        // enclosure: {  
        //     strokeColor: "#6699FF",  
        //     strokeWeight: 2,
        //     strokeOpacity: 1, 
        //     type: 'circle', // circle 圆形   polygon 多边型  district 行政区域(百度和高德实现) polyline 线形围栏数据(百度和高德实现 )
        //     point:[116.387112, 39.920977],
        //     radius: 2000
        // },
        // 围栏信息 多边形
        // enclosure: {
        //     strokeColor: "#6699FF", 
        //     strokeWeight: 4,
        //     strokeOpacity: 1, 
        //     type: 'polyline', // circle 圆形   polygon 多边型  district 行政区域(百度和高德实现) polyline 线形围栏数据(百度和高德实现 )
        //     offset: 100,  // 线性的范围 - 百度和高德实现 
        //     points:[
        //         {'lng': 116.387112, 'lat':39.920977},
        //         {'lng': 116.385243, 'lat':39.913063},
        //         {'lng': 116.394226, 'lat':39.917988},
        //         {'lng': 116.401772, 'lat':39.921364},
        //         {'lng': 116.41248, 'lat':39.927893}
        //     ]
        // }
    }
    const cmap = new CMap(options)

文件结构

深层功能开发

  • 插件实例化之后 会有一个map的属性对外暴露了 真实地图的实例 可以是使用 这个数据去做一些 对应地图的功能

参考