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 🙏

© 2025 – Pkg Stats / Ryan Hefner

krite

v1.2.0

Published

Toolkit for interactive maps

Readme

krite

Krite is a collection of tools for quickly setting up interactive maps. It consists of various generic and reusable components that facilitate various common tasks. For instance:

  • managing map state
  • interacting with the map
  • working with projection systems
  • interfacing with data sources.

Krite uses the excellent Leaflet library for the actual rendering of the map.

Structure

The functionality of krite for the most part divided into two parts: services and data sources.

Services

Most functionality in krite is subdivided into services. These are dependencies that perfom a specific role such as talking to an API or wrapping around external modules.

  • LocationService - helper for geolocation
  • MapService - wrapper for a Leaflet map
  • NominatimService - wrapper for Openstreetmap Nominatim
  • PdokLocatieserverService - wrapper for Dutch search service
  • XMLService - helper for common xml tasks

Data Sources

Data sources are connectors for interfacing with geospatial data sources. The included data sources wrap different kinds of web services with the same consistent API. This allows you to combine map data from multiple data sources without worrying about implementation details.

Included in this repository you can find connectors for:

  • OGC OWS endpoints (WMS/WFS)
  • OGC WMTS
  • Geoserver (WMS/WFS using cql_filters)
  • ESRI Tiled Map Layers
  • Basemaps from the Dutch PDOK
  • Openstreetmap

Installation

npm install krite

Usage

A bundle file is provided in /dist/ but since we don't use it internally it's not properly tested. I recommend you include from lib and bundle yourself.

To create a new krite instance:

import Krite from 'krite/lib/krite';

const krite = new Krite();

Adding services

import { InspectorService } from 'krite/lib/services/inspector';

krite.addService('InspectorService', new InspectorService);

// Or
krite.addServices({
    InspectorService: new InspectorService(),
    ...
})

Get service instances

krite.getService('DrawService');
krite.tryService('DrawService');
krite.promiseService('DrawService').then((service) => {
    // Do something    
});

Creating the map

krite.addService('MapService', new MapService({
    container: '#map-container',
    leaflet: {
        minZoom: 3,
        maxZoom: 16,
        center: [0, 0],
        zoom: 3,
        preferCanvas: true,
    },
}));

Adding data sources

import { OWSSource } from 'krite/lib/sources/ows/source';

krite.addSource('Boundless Geoserver', new OWSSource 'https://demo.boundlessgeo.com/geoserver/ows'));

// or
krite.addSources({
    'Boundless Geoserver': new OWSSource('https://demo.boundlessgeo.com/geoserver/ows'),
    ...
})

Reading data sources

const source = krite.getSource('Boundless Geoserver');

source.getLayerNames().then((names) => {
    console.log(names);
});

source.getLayer('Countries of the World').then((layer) => {
    krite.map.addLayer(layer);
});

Interaction

krite.map.on('click', (point) => {
    console.log(`Clicked on ${point.x}, ${point.y}`);
});

Highlighting

krite.map.on('click', async (point) => {
    // You can also get the layer from the source
    const layer = krite.map.getLayer('Countries of the World');
    
    // Point is in the chosen CRS
    const featureCollection = await layer.intersectsPoint(point);
    
    if (featureCollection.features.length > 0) {
        krite.map.highlight(featureCollection.features[0]);
    }
});

More examples

For development and testing purposes there are some examples views in /views/. You can run them by starting vite with vite dev or npm run dev and going to the provided local url.

Development

Clone this repository and run npm install. Run tsc -d to compile the typescript source files.

Used by (in dutch)

Gratis Kadastrale Kaart

Gratis Vastgoedkaart

License

Krite is licensed under the Apache 2.0 license