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

@its-cool/simple-map

v2.2.43

Published

A simple GIS map library built on OpenLayers.

Readme

simple-map

基于 OpenLayers 的轻量 GIS 地图库,提供地图初始化、图层、绘制、测量、轨迹等常用能力,可在 Vue、React 或原生 JS 项目中使用。

环境要求

  • Node.js >=14.18.0(推荐 18 / 20)
  • 现代浏览器或支持 ESM 的构建工具(Vite、Webpack 5 等)

安装

npm install @its-cool/simple-map

运行时依赖(OpenLayers、proj4、turf 等)已打包进发布产物,并编译为 ES2015,兼容 Vue CLI 4 / Webpack 4,一般无需单独安装或转译 ol

快速上手

1. 引入样式

import '@its-cool/simple-map/style.css';

2. 创建地图

import { Map } from '@its-cool/simple-map';

const map = new Map('map', {
  centerX: 116.4,
  centerY: 39.9,
  zoom: 12,
  wkid: 3857,
  callback: {}
});

HTML 中准备一个容器:

<div id="map" style="width: 100%; height: 500px;"></div>

3. 使用工具类(可选)

import { Draw, Measure, Track, transformCoord } from '@its-cool/simple-map';

// 坐标转换、绘制、测量、轨迹等能力见 API 与示例

静态资源

默认图标路径为 /image/...。请将包内 dist/image/ 复制到应用的静态目录(如 public/image/),或通过 CSS 变量自定义路径:

:root {
  --simple-map-icon-marker: url('/your-path/icon-marker.png');
}

本地示例

仓库内附带 Vue 3 联调应用,可快速查看各功能效果:

cd playground
npm install
npm run dev

浏览器访问 http://localhost:5173/pipe(History 模式,勿使用 /#/pipe)。详见 playground/README.md

参与开发

克隆仓库后,在根目录安装依赖并构建:

npm install
npm run build

本地联调库源码:

npm run playground

更完整的构建说明、Webpack 集成、发布流程与目录结构,见 devREADME.md

许可证

MIT