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

leaflet-ptv-developer

v1.0.3

Published

Extended Leaflet classes for PTV Developer

Readme

Leaflet compatible!

Purpose

leaflet-ptv-developer provides classes to add PTV Developer specific features to Leaflet.

Components

How to build

npm install

or use the latest build at https://unpkg.com/leaflet-ptv-developer/dist/

L.TileLayer.PtvDeveloper

The Layer class L.TileLayer.PtvDeveloper can be used to make PTV Developer data-tiles elements clickable or request tiles with specific parameters.

Additional options

  • disableMouseEvents - disables all mouse click and hover events. Default: false

Integration as single raster map

The easiest way to add a clickable layer is to use the class L.TileLayer.PtvDeveloper, append a clickable data-tiles layer (e.g. restrictions or trafficIncidents) to the profile and set the api key. The icons of the layer can now be clicked to display the object information. The options are the same as for L.TileLayer

var map = L.map('map').setView(new L.LatLng(49.012, 8.4044), 17);

var interactiveTileLayer =  L.tileLayer.ptvDeveloper(
            'https://api.myptv.com/rastermaps/v1/data-tiles/{z}/{x}/{y}' +
            '?apiKey={token}&layers={layers}', {
                attribution: '© ' + new Date().getFullYear() + ' PTV Group, HERE',
                layers: 'background,transport,labels,restrictions',
                token: window.apiKey,
                maxZoom: 22,
                pane: 'tilePane'
            }).addTo(map);

Integration as layered raster map

It's also possible to split the PTV Developer raster tiles into separate Leaflet layers. This sample creates a image-tiles base map layer and a clickable restrictions data-tiles overlay.

var map = L.map('map').setView(new L.LatLng(49.012, 8.4044), 17);

map.createPane('clickableTiles');
map.getPane('clickableTiles').style.zIndex = 500;

var basemapLayer = L.tileLayer(
    'https://api.myptv.com/rastermaps/v1/image-tiles/{z}/{x}/{y}' +
    '?apiKey={token}&layers={layers}', {
        attribution: '© ' + new Date().getFullYear() + ' PTV Group, HERE',
        layers: 'background,transport',
        token: window.apiKey,
        maxZoom: 22,
        pane: 'tilePane'
    }).addTo(map);

var restrictionsLayer = L.tileLayer.ptvDeveloper(
    'https://api.myptv.com/rastermaps/v1/data-tiles/{z}/{x}/{y}' +
    '?apiKey={token}&layers={layers}', {
        layers: 'restrictions,labels',
        token: window.apiKey,
        maxZoom: 22,
        pane: 'clickableTiles'
    }).addTo(map);

Integration as a layered vector map

Another possiblity is to mashup a clickable data-tiles layer with a vector-tiles base map layer.

var map = L.map('map').setView(new L.LatLng(49.012, 8.4044), 17);

var vectorLayer = L.maplibreGL({
        attribution: '© ' + new Date().getFullYear() + ' PTV Group, HERE',
        interactive:false,
        style: 'https://vectormaps-resources.myptv.com/styles/latest/standard.json',
        transformRequest: (url, resourceType) => {
        if (resourceType === 'Tile' && url.startsWith('https://api.myptv.com')) {
            return {
            url: url + '?apiKey=' + window.apiKey
            }
        }
        }
    }).addTo(map);
    
map.createPane('clickableTiles');
map.getPane('clickableTiles').style.zIndex = 500;

var restrictionsLayer = L.tileLayer.ptvDeveloper(
    'https://api.myptv.com/rastermaps/v1/data-tiles/{z}/{x}/{y}' +
    '?apiKey={token}&layers={layers}', {
        layers: 'restrictions',
        token: window.apiKey,
        maxZoom: 22,
        pane: 'clickableTiles'
    }).addTo(map);