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

nsc-ol

v2.0.0

Published

react openlayer for nsc

Readme

<Map />

地物

highlight

在 select 和 hover 的情况都需要高亮,可能不同交互级别有不同的高亮样式。 edit 时 feature 的样式也会有改变,Modify 有自己的高亮 style 属性。

高亮方式有几种:

  1. 通过动态改变 feature style (example: https://openlayers.org/en/latest/examples/select-hover-features.html?q=modify)
  2. 添加一个高亮 layer,把需要高亮的 feature 丢进去。(这种方式高亮时无法保持原有的的 z-index 关系)

select

不管是点选、框选还是其他选择(比如通过外部地物树选择),select 的本质都是通过给定一组 feature 的 id, 来对这些 feature 进行一种样式的改变,比如高亮。

hover

需要高亮情况的一种,就是改变某个 id 的 feature 的样式。

edit/modify

考虑 redo/undo edit 操作有:调整、平移、合并、(线)打断、(线)续画

new Modify({ source });

工具栏

有些是主动工具:即用户主动去选择使用,比如:框选 有些是被动工具:即根据用户选中地物状态被动激活使用,比如:合并

通用工具:分类,工具名,工具图标,自定义工具 render,工具浮框,事件,enable condition

选择:点选、框选、已选中(单个可看名称、多个可看列表)、更多 编辑:自由调整、平移、合并、打断、裁切、续画、直径、复制、粘贴、删除、回退、重做 绘制:点、线、面 测量:长度、角度、面积 查询:搜索 转角 查看属性 空间分析 导入、导出 文件夹管理

const ToolContext = {
  map, features, selected, activatedTools, ...
}
const toolManager = new ToolManager({ map })
toolManager.add(new XXTool())
toolManager.activate('xx-tool')
toolManager.disable('xx-tool')

toolManager.refresh()

basemap