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.0.0

Published

A simple GIS map library built on OpenLayers.

Readme

simple-map

simple-map is a Vite-powered JavaScript GIS map library built on OpenLayers.

Install

npm install @its-cool/simple-map

依赖(olproj4@turf/turfechartsol-echarts)已写在包的 dependencies 里,npm install @its-cool/simple-map 会一并安装,无需再手写一串 peer 包。若宿主项目已安装同名依赖,npm 通常会尽量提升/复用同一版本;若两端 major 冲突,可能出现两份副本,此时再在宿主里对齐版本即可。

Usage

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

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

Webpack 宿主项目

Webpack 5 里直接 import { Map, Draw } from '@its-cool/simple-map' 即可;包里的 exports 会解析到 dist/simple-map.js(ESM)。运行时依赖会随 @its-cool/simple-map 自动安装。

样式:对 import '@its-cool/simple-map/style.css' 配置 css-loader(再配合 style-loaderMiniCssExtractPlugin),与处理其它 npm 包里的 CSS 相同。

静态资源:默认样式里图标路径是 /image/...。请把本包构建产物里的 dist/image/ 拷到你应用的静态目录(例如 public/image/),或继续用下面「Assets」里的 CSS 变量改成你的 CDN 路径。

Webpack 4:对 package.jsonexports 支持不完整(建议 4.37+ 或升级到 5)。若解析异常,可在 resolve.alias 里显式指定:

// webpack.config.js
resolve: {
  alias: {
    '@its-cool/simple-map': path.resolve(__dirname, 'node_modules/@its-cool/simple-map/dist/simple-map.js'),
    '@its-cool/simple-map/style.css': path.resolve(__dirname, 'node_modules/@its-cool/simple-map/dist/style.css')
  }
}

链到本地源码调试(可选):把 @its-cool/simple-map 指到本仓库的 src/index.js,并在宿主里为 @its-cool/simple-map/style.css 指到 src/style.css;同时宿主 public 里要有 /image,与 Vite 侧说明一致。

Dependencies(随包安装)

@its-cool/simple-mappackage.jsondependencies 包含:olproj4@turf/turfechartsol-echarts。宿主只需依赖 @its-cool/simple-map,除非要主动对齐或与宿主已有的 GIS 栈共用单一版本时再额外声明同名依赖。

Assets

Marker styles reference Vite public assets under /image by default. If your app serves assets from a different path, override the CSS variables:

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

Publish(维护者)

包名为作用域包 @its-cool/simple-mappublishConfig.access 已为 public。发布到 npm 官方源:

npm run build
npm publish

若全局 registry 指向镜像,可显式指定:npm publish --registry=https://registry.npmjs.org/package.json 里已配置 publishConfig.registry)。

Build

npm install
npm run build

Project Layout

  • playground/ is a Vue 3 + Vite + Router + Pinia + Element Plus app for local feature testing (see playground/README.md).
  • src/ contains the modern Vite library source.
  • public/image/ contains static assets copied to dist/image during build.
  • src/utils/mapTools/ contains shared utility code.
  • legacy/simpleMap/ keeps the original pre-Vite implementation for reference only.

Runtime And Build Environment

This package currently supports Node.js >=14.18.0 and uses Vite 4 for compatibility with older environments. For new development environments, Node.js 18/20 is recommended; after upgrading the team runtime, Vite can be upgraded to the latest major version.