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

meta-base-layer-npm

v1.0.0

Published

ol map tools

Readme

MetaBaseMap 底图使用说明

组件 API

版本:v1.5

使用方法

1. 本组件依赖于 openalyers6 以上版本

2. npm 依赖:

  "ol": "8.2.0",
  "axios": "0.27.2",
  "lodash-es": "^4.17.21",
  "@turf/turf": "^6.5.0",
  "geobuf": "^3.0.2",
  "pbf": "^3.2.1",
  "proj4": "^2.15.0",

3. 将 meta-base-layer 文件夹放在程序中

4. main.js 中引入 ol-prototype.js

5. 调用【ol 实例】.addMetaGisBaseMap(['水务图'])即可加载水务图底图

6. 调用【ol 实例】.removeMetaGisBaseMap()即可移除水务图底图

7. 调用【ol 实例】.setCloseMouseOverEvent(mapId, isClose)即可设置是否关闭鼠标经过悬浮事件

8. 调用【ol 实例】.registerMouseClickEvent(mapId, hitTolerance, callback)即可注册鼠标点击事件

mapId:地图id
hitTolerance:点击容差
callback:点击回调函数

代理

请求了后台接口,需要配置代理,代理如下:
如果部署在甲三IP是:192.168.183.78:9992
如果部署在金山云上IP是:http://172.26.68.142/prod-api

开发环境

  "/meta-gis-api": {
    target: "http://192.168.183.78:9992",//甲三号开发环境
    // target: "http://172.26.68.142/prod-api",//金山云开发环境
    changeOrigin: true,
    rewrite: (path) => path.replace(/^\/meta-gis-api/, ""),
  },
  "/admin/profile": {
    target: "http://192.168.183.78:9992",//甲三号开发环境
    // target: "http://172.26.68.142/prod-api",//金山云开发环境
    changeOrigin: true,
  },
  "/profile": {
    target: "http://192.168.183.78:9992/admin",//甲三号开发环境
    // target: "http://172.26.68.142/prod-api/admin",//金山云开发环境
    changeOrigin: true,
  },

部署环境

甲三号代理直接配置http://192.168.183.78:9992就行,金山云代理有写不一样: 金山云部署代理

location /meta-gis-api/{
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://172.16.7.88/prod-api/;
}

location /admin/profile/ {
  proxy_pass http://172.16.7.88/prod-api/admin/profile/;
}

location /profile/ {
  proxy_pass http://172.16.7.88/prod-api/admin/profile/;
}

升级日志

v1.0 (2024-05-15)

  • 初始版本发布
  • 支持加载北京市水务一张图基础底图