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

v1.0.9

Published

A leaflet layer for non-tiled overlays

Downloads

8,747

Readme

Leaflet.NonTiledLayer

Build status NPM version Leaflet compatible!

Purpose

While Leaflet handles the de-facto standard for stitching a map from tiles very well, there is no concept for imagery data that cannot be queried in tiles.

Not all imagery providers can handle tiles properly, for example if they render labels dynamically. So we've added a Leaflet.NonTiledLayer, which gets the imagery for the complete map viewport whenever it changes. Leaflet.NonTiledLayer.WMS is the implementation that makes WMS requests, similar to the TileLayer.WMS.

You can see a demo here:

https://ptv-logistics.github.io/Leaflet.NonTiledLayer/index.html

It uses the WMS service of PTV xServer internet, which requires a tiled/non-tiled hybrid approach (and that is the reason we've built this). The sample also displays some 3rd-party WMS overlays that also cannot be requested in tiles.

The layer supports both Leaflet 0.7.x and Leaflet 1.0.x. The demo for 0.7 can be viewed here:

https://ptv-logistics.github.io/Leaflet.NonTiledLayer/test.0.7.html

How to build

npm install

or use the latest build at https://unpkg.com/leaflet.nontiledlayer/dist/

The supported options

  • attribution - the attribution text for the layer data. Default: ''
  • opacity - the opacity value between 0.0 and 1.0. Default: 1.0
  • minZoom - the minimum zoom level for which the overlay is requested. Default: 0
  • maxZoom - the maximum zoom level for which the overlay is requested. Default: 18
  • bounds - the geographic bounds of the layer. Default: L.latLngBounds([-85.05, -180], [85.05, 180])
  • zIndex - z-index of the overlay. Default: undefined
  • pane - the name of the pane where the child div is inserted. Default: 'overlayPane'
  • pointerEvents - the pointer-events style for the overlay. Default: null
  • errorImageUrl - the url of the image displayed when the layer fails to load (invalid request or server error). Default: 1px transparent gif data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw==
  • useCanvas - use the canvas to render the images, fixes flickering issues with Firefox, doesn't work on IE8. Setting it to undefined will use canvas, if available. Default: undefined
  • detectRetina - doubles the actual image size requested, if the Browser is in retina mode. Default: false
  • crossOrigin - enables cross origin capabilities. Valid values are 'anonymous' and 'use-credentials'. Default: undefined

The pane and zIndex properties allow to fine-tune the layer ordering. For example, it is possible to insert a NonTiledLayer between two layers the tilePane, like the labels here, or on top of the vector shapes, like the labels here or here.

You can build your own NonTiledLayer by inheriting from NonTiledLayer and implementing either the function getImageUrl or getImageUrlAsync. The getImageUrl just returns an uri and is used by the WMS implementation. The getImageUrlAsync can be used for services that not only return images, but also additional context information for interaction. The project here uses this method.