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

ngx-leaflet-gridlayer

v1.0.0

Published

This is a library used to easily create grid layers according to the data entered by the user in leaflet maps.

Readme

ngx-leaflet-gridlayer

This is a library for angular in support of @asymmetrik/ngx-leaflet to facilitate the process of building grid layers on top of the map and visualize aggregator data on each tile. The library aims to remove the burden of such tasks while keeping the performance and being responsive.

Demo

Demo

Installation

Install ngx-leaflet-gridlayer with npm

  npm install ngx-leaflet-gridlayer

Import 'NgxLeafletGridlayerModule' in the module you are using the map or top module.

import { NgxLeafletGridlayerModule } from 'ngx-leaflet-gridlayer';

@NgModule({
  declarations: [
    // ...
  ],
  imports: [
    // ...
    NgxLeafletGridlayerModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})

In the component where this should be integrated import 'NgxLeafletGridlayerService'.

import { NgxLeafletGridlayerService } from 'ngx-leaflet-gridlayer';

// Add map property which will hold the map reference
map!: Map;

// Add the service in the constructor for use
constructor(private _gridlayerService: NgxLeafletGridlayerService) {}

// onMapReady is a method that is triggered when the map is ready, so use it to get the reference to the map and pass it to createGridLayer() together with the data which should be of type InputData.
onMapReady(map: Map): void {
    this.map = map;   
    this._gridlayerService.createGridLayer(inputData, this.map)
};

Data type

The service should be supplied with data of the following format:

interface InputData {
    data: Data[],
    tileOutlineColor: string,   
    backgroundColor: {
        fewItems: {
            numberOfItems: number,
            backgroundColor: string
        },
        someItems: {
            numberOfItems: number,
            backgroundColor: string
        },
        manyItems: {
            numberOfItems: number,
            backgroundColor: string
        }
    },
    hoverBackgroundColor: string,
    hoverOutlineColor: string,
}

interface Data {
  title: string,
  description: string,
  boundingCoordinates: BoundingCoordinates,
}

interface BoundingCoordinates {
  eastBoundingCoordinate: number, 
  westBoundingCoordinate: number,
  northBoundingCoordinate: number,
  southBoundingCoordinate: number
};

where different color can be provided for different total number of items as well as the number itself.

Here is an example of data:

data= {
  tileOutlineColor: 'red',
  backgroundColor: {
    fewItems: {
      numberOfItems: 3,
      backgroundColor: 'green'
    },
    someItems: {
      numberOfItems: 6,
      backgroundColor: 'purple'
    },
    manyItems: {
      numberOfItems: 9,
      backgroundColor: 'yellow'
    }
  },
  hoverBackgroundColor: 'brown',
  hoverOutlineColor: 'orange',
  data: [
    { 
      title: 'test1',
      description: 'test2',
      boundingCoordinates: {
        eastBoundingCoordinate: 18,
        westBoundingCoordinate: 22,
        northBoundingCoordinate: 17,
        southBoundingCoordinate: 16
      }
    },
    { 
      title: 'test1',
      description: 'test2',
      boundingCoordinates: {
        eastBoundingCoordinate: 30,
        westBoundingCoordinate: 40,
        northBoundingCoordinate: 35,
        southBoundingCoordinate: 64
      }
    }
  ]
}

Authors

Contributing

Contributions are always welcome!

See contributing.md in the repo for more details.

Please adhere to this project's code of conduct.

License

See LICENSE in repository for details.