Home

Awesome

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 Leaflet 1.7.x.

Installation

Install using npm:

npm install leaflet.nontiledlayer

Or yarn:

yarn add leaflet.nontiledlayer

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

The supported options

The pane and zIndex properties allow to fine-tune the layer ordering. For example, it is possible to insert a NonTiledLayer between two layers of 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.