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 🙏

© 2024 – Pkg Stats / Ryan Hefner

leaflet-clippedwms

v0.5.3

Published

A leaflet extension for TileLayer.WMS which allows you to use a large clip region parameter

Downloads

17

Readme

leaflet-clippedWms

leaflet-clippedWms 用于加载一个『裁剪』过的 wms 图层。

裁剪:对于一个图层,给定一个多边形区域,只保留区域内部分。

使用

ClippedWMS 继承自 L.TileLayer.WMS,使用方法与它完全相同,只是额外加入了 clip 参数,用于传入所需裁剪的区域。

  • clip 参数的值是一个 geojson geometry 对象,类型必须为 Polygon 或 MultiPolygon。
  • 如果不传入 clip(或者为 null),图层将不会被裁剪。

示例

// 裁剪区域
const geometry = {
  type: 'Polygon',
  coordinates: [
    [
      [125.90806629, 46.83817821],
      [125.89487407, 46.82173077],
      [125.91543337, 46.80596864],
      [125.97282808, 46.79757359],
      [125.9829364, 46.82532865],
      [125.90806629, 46.83817821],
    ],
  ],
};

clippedWMS('http://geoserversh.nydsju.com/geoserver/sample/wms', {
  layers: 'integration_space:growth_qinggang_202208',
  format: 'image/png',
  transparent: true,
  version: '1.1.0',
  crs: L.CRS.EPSG4326,
  clip: geometry, // 唯一额外添加的参数
}).addTo(this.map);