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

@polar/plugin-layer-chooser

v1.2.0

Published

Plugin LayerChooser

Downloads

3

Readme

LayerChooser

The tool offers layer selection to the user.

Scope

The LayerChooser offers an additive (usually Overlays, technically named with type: 'mask') and an exclusive (usually background maps, type: 'background') selection of layers to the users.

Order of layers within a layer is currently always as initially configured.

Configuration

The tool does not require any configuration for itself, but is based on the mapConfiguration.layers array. It will infer its options from there, and change layer visibility and availability depending on minZoom and maxZoom.

Each object in mapConfiguration.layers array fits this definition:

| fieldName | type | description | | ---------- | -------------------------- | -------------------------------------------------------------------------------------- | | id | string | Service register id. | | visibility | boolean | Initial visibility. | | type | enum["background", "mask"] | Layer handling. Backgrounds are mutually exclusive, masks ("overlays") can be stacked. | | name | string | Display name in UI. | | minZoom | ?number | If set, layer only available (and selectable) from this zoom level on. | | maxZoom | ?number | If set, layer only available (and selectable) to this zoom level. | | options | options | Shows a layer-specific sub-menu; its contents are configurable. |

mapConfiguration.layers.options

An option wheel will appear in the layer chooser that allows opening a sub-menu with configured configuration options for the end user.

| fieldName | type | description | | --------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | layers | Boolean | layers | If truthy, all configured layers of the layer for can be turned off and on by the user. ⚠️ Only implemented for WMS. Only implemented for top layers; that is, only first level of nesting is considered. |

mapConfiguration.layers.options.layers

This field is named like this to match the OGC specification for their name; that is, layers have layers that may have layers that may have layers, and so on. However, only the first level (a layer's layers) is currently implemented.

| fieldName | type | description | | --------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | order | ?string | Optional. If not given, field layers from service description will be used, and defines order of options. If layer defined in service description's layers and order, it's initially on. If only in order, it's initially off. If only in layers, it's always-on. If in neither, it's always-off. | | title | Boolean | Record<name, layerName> | Title to be displayed for sub-layer. If false, layer name itself will be used as given in service description 'layers' field. If true, it is assumed a name exists in the layer's GetCapabilities, and that will be used. If Record, it maps the layer name to an arbitrary display name given by the configuration. The layerName can be any string. | | legend | Boolean | Record<name, legendUrl> | Legend image to be used for sub-layer. If false, no image is displayed. If true, it is assumed an image exists in the layer's GetCapabilities, and that will be used. If Record, it maps the layer name to a linked image. The legendUrl can be any valid reachable image URL. |