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

@webgeodatavore/express-simplestyle-spec

v0.2.0

Published

This project is intended to provide a map icons API for [simplestyle-spec](https://github.com/mapbox/simplestyle-spec) (a simple styling convention for GeoJSON data)

Downloads

3

Readme

express-simplestyle-spec

This project is intended to provide a map icons API for simplestyle-spec (a simple styling convention for GeoJSON data)

It's only a minimal library to integrate in any Express project or use in a minimal standalone Express project.

The intent is to have a standalone server for map markers. In fact, the simplestyle spec is open but the server to load icons isn't. You need a Mapbox account to consume these icons like illustrated in this example. To be fair, Mapbox does provide the library makiwich to generate images from parameters matching the spec.

We borrowed 90% of the code from the project @kartotherian/maki intended for use with Karthotherian, the vector tiles server project by Wikimedia Foundation, used within Wikipedia. For markers, their code relies on makizushi, the predecessor of makiwich. We made some adaptation to use makiwich, a more recent Mapbox library that works with latest Maki icons.

If you goal is to support together vector tiles, static maps and markers, you may consider using Kartotherian instead.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You will need Node.js installed. As some dependencies are related to Mapnik Node bindings, we use nvm to set Node version to latest 6.x series (aka LTS version)

Installing

To try the demo

Install dependencies

npm install

And to run demo

npm start

Then, open your browser to http://localhost:3000/v4/marker/[email protected]

The URL schema is matched to the one used by the mapbox.js.

http://.../v4/marker/[email protected]
http://.../v4/marker/ {base} - {size:s|m|l} [-{letter-or-digit-or-icon-name}] + {color} [@2x] .png

At this point, only "pin" is supported for the base. The color is a 3 digit or 6 digit hex number. Optional scaling can only be 2x. Beyond the pre-defined maki icons, you may give a number (0-99), a single letter (a-z), or nothing.

To use in your own Express project

npm install @webgeodatavore/express-simplestyle-spec

To get the logic, you just have to replace in the demo code the following:

var markers = require('./../index');

with

var markers = require('@webgeodatavore/express-simplestyle-spec');

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Thomas Gratier - Integration work

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details

Aknowledgements

  • Mapbox for the spec itself and for the makizushi library that do most of the job for this library
  • Wikimedia Foundation and Yuri Astrakhan as the author of the markers server related code from Kartotherian