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

polarmap

v1.2.1

Published

Leaflet library for polar map projection switching

Downloads

6

Readme

PolarMap.js

A JavaScript library that can re-project Leaflet maps and map features.

PolarMap.js is part of the Arctic Connect project, specifically the Arctic Web Map module. We thank CANARIE for the funding support.

There are two layers to PolarMap.js: the lower-level Leaflet.PolarMap plugin, and the basic PolarMap library. Each has their advantages depending on the situation. The basic PolarMap library has the default loadout of plugins and configuration for Arctic Connect tiles and services. The Leaflet.PolarMap plugin lets the developer pick and choose their integrations, at the trade-off of more code/configuration.

Requirements

The Leaflet.PolarMap plugin and PolarMap library both require the following JavaScript libraries to be available:

Support for other versions of these libraries are not currently known, use at your own risk of bugs or unexpected behaviour.

Using PolarMap.js

PolarMap.js has a very similar API to Leaflet, so you should feel right at home. First include the stylesheets:

<link rel="stylesheet" href="css/leaflet.css" />
<link rel="stylesheet" href="css/polarmap.css" />

Then require the JavaScript:

<script src="js/jquery.js"></script>
<script src="js/leaflet.js"></script>
<script src="js/proj4.js"></script>
<script src="js/proj4leaflet.js"></script>
<script src="js/polarmap-src.js"></script>

And then initialize a map the way you would a Leaflet map:

<body onload="init()">
...
<script>
  function init() {
    var map = PolarMap('mapContainer');
  }
</script>

And you should be up and running with PolarMap.js. For a more detailed explanation of the API and customization options, please see the API Documentation.

Building

It is recommended to download the latest version of PolarMap.js directly from our site. But you can build your own copy from source if you prefer.

To generate a distribution copy of PolarMap.js, you will need to set up the build environment. This requires Node.js. Once Node is installed, you can use NPM to set up the dependencies:

$ npm install -g jake
$ npm install

And then generate the build products:

$ jake build

Two copies of PolarMap.js will be generated in the dist directory, one with comments and the other compressed with uglifier-js.

Examples

See the examples directory for more information on how to use PolarMap.js with various Leaflet plugins and features.

Development

To run a local webserver for testing the app, use the packaged Node http-server:

$ jake server

It will serve the local directory over HTTP on port 8080.

Tests

This library has tests for the lower-level plugin that run using Mocha, Sinon, and Expect.js. They can be run in the browser by opening spec/index.html or on the command line with jake test.

Compatibility

Different versions of PolarMap.js are available for different versions of Leaflet.

A version of PolarMap.js for Leaflet 1.0.x is not yet available.

Code Reuse

This library contains modified code from the leaflet-hash project. Leaflet-hash is MIT Licensed.

Support

PolarMap.js is maintained by James Badger (@openfirmware) and the GeoSensorWeb Lab. If you have issues with the JavaScript library portion, please post an issue on the PolarMap.js issue tracker.

If you are having issue with the underlying map data, such as map inaccuracies, missing data, or general style comments, then please post an issue on the Web Map issue tracker.

License

PolarMap.js is released under the BSD 2-Clause license (same as Leaflet).