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

@vectorial1024/leaflet-color-markers

v2.0.4

Published

The standard Leaflet marker icon, but in different color variations, for simple use cases.

Downloads

29

Readme

leaflet-color-markers

package license npm version npm downloads github link github stars github forks

The standard Leaflet marker icon, but in different color variations, for simple use cases.

This is a modernized fork of patrickp-rthinfo/leaflet-color-markers, which is in turn a fork of pointhi/leaflet-color-markers. With this, the first commit to this project can be traced back to late 2013.

Note that the Leaflet marker icon is originally contributed to the Leaflet project, and is not the work of this library. The work here is to make that marker icon available in more colors.

Install

via NPM:

npm install @vectorial1024/leaflet-color-markers

Special Notice

This library is a successor of leaflet-color-markers. That NPM library, for the lack of better words, actually does nothing.

Demo

A demo is included in the same repo. It showcases a simple Leaflet map with a colored marker from this package.

You may try it locally with the following steps:

  1. Clone this repo
  2. npm run build-demo
  3. Open demo.html in your internet browser
  4. See a minimally usable Leaflet map with a colored marker in it

demo image

Example Code

Add a simple marker using the green icon template to a Leaflet map:

import { greenIcon } from "@vectorial1024/leaflet-color-markers";

// we assume the map is already defined
const map = L.map('theMap');

L.marker([51.5, -0.09], { icon: greenIcon }).addTo(map);

What about require()?

We recommend using the more modern ESM style (import) to handle dependencies, but if CJS (require()) is required, you can still do this:

// require() also works, but we recommend using the import if possible
const LCM = require("@vectorial1024/leaflet-color-markers");
const greenIcon = LCM.greenIcon;

Colors

Preset Colors

| Color | Marker | Color Inside | Color Outside | | ------------- |:-----:|:-----:|:-----:| | Blue | Marker Blue | #2A81CB | #3274A3 | | Gold | Marker Gold | #FFD326 | #C1A32D | | Red | Marker Red | #CB2B3E | #982E40 | | Green | Marker Green | #2AAD27 | #31882A | | Orange | Marker Orange | #CB8427 | #98652E | | Yellow | Marker Yellow | #CAC428 | #988F2E | | Violet | Marker Violet | #9C2BCB | #742E98 | | Grey | Marker Grey | #7B7B7B | #6B6B6B | | Black | Marker Black | #3D3D3D | #313131 |