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

nextzen.js

v1.0.0

Published

Javascript SDK for Nextzen products

Downloads

28

Readme

npm

nextzen.js

Warning: README is outdated. Please look at examples/index.html while the doc gets updated.

mapzen.js is an open-source JavaScript SDK and an extension of Leaflet for making maps for the web and mobile devices. mapzen.js simplifies the process of using Mapzen's maps within Leaflet.

mapzen.js builds upon Leaflet's functionality by providing tools for working with Mapzen maps and search. With mapzen.js you can add Mapzen map styles as basemaps, build a customizable geocoder with Mapzen Search, and share links to maps.

The current version of nextzen.js embeds Leaflet v1.3.0. If you need to use another version of Leaflet, please take a look at the standalone build below.

Demos

Basic Usage

Set up a basic Leaflet map with the default Mapzen basemap in three steps.

Step 1: In the <head> of your HTML page, import the mapzen.js JavaScript and CSS files:

<!-- style sheet for mapzen.js -->
<link rel="stylesheet" href="https://mapzen.com/js/mapzen.css">

<!-- latest minified version of mapzen.js -->
<script src="https://mapzen.com/js/mapzen.min.js"></script>

And add a height and width for the map:

<style>
  #map {
    height: 300px;
    width: 600px;
  }
</style>

Step 2: In the <body> of your HTML page, add a "map" div:

<div id="map"></div>

Step 3: At the bottom of your page, add a JavaScript section to set up the map:

<script>
  // Add a map to the 'map' div
  var map = L.Nextzen.map('map', {
    tangramOptions: {
      apiKey: 'your-nextzen-api-key',
      debug: true
    }
  });

  // Set the center of the map to be the San Francisco Bay Area at zoom level 12
  map.setView([37.7749, -122.4194], 12);
</script>

Tip: Don't forget to generate your API key at https://mapzen.com/developers/

Done!

See the full tutorial: Get started with mapzen.js

Documentation

Read the full API documentation at https://mapzen.com/documentation/mapzen-js/.

The source files for the documentation are located in the /docs folder of this repository.

Releases

The most recent mapzen.js release relies on Leaflet v1.0.1 and Tangram v0.13.

Previous mapzen.js releases can be imported by referencing the specific version number:

<script src="https://mapzen.com/js/0.5.0/mapzen.min.js"></script>

See the full list of releases and release notes here.

Builds

There are a few different mapzen.js builds to meet specific needs:

Minified: Use the minified build for most use cases.

<script src="https://mapzen.com/js/mapzen.min.js"></script>

Debugging: Use the unminified version for help with debugging.

<script src="https://mapzen.com/js/mapzen.js"></script>

If you want to load the unminified version of Tangram.js, as well, use the debugTangram option when initializing the map.

Standalone: Use the standalone version if you want to use a different version of Leaflet. Currently, mapzen.js supports Leaflet v.0.7.x and v1.0.x. (Other versions of Leaflet may work, but are not actively tested or supported.)

The standalone build includes a standalone css file, as well.

<!-- style sheet for mapzen.js -->
<link rel="stylesheet" href="https://mapzen.com/js/mapzen.standalone.css">

<!-- latest version of stasndalone mapzen.js-->
<script src="https://mapzen.com/js/mapzen.standalone.js"></script>

<!-- latest minified version of standalone mapzen.js -->
<script src="https://mapzen.com/js/mapzen.standalone.min.js"></script>

See BUILD.md if you want to build locally (requires npm).

Import as module

mapzen.js can be imported as a module using npm:

npm install mapzen.js

Component open-source projects 💕

mapzen.js includes components from these awesome open-source projects: