Skip to content

A JavaScript mapping library for the National Park Service, built as a Leaflet plugin.

License

Notifications You must be signed in to change notification settings

ctbarna/npmap.js

Repository files navigation

NPS Arrowhead

NPMap.js

Extends Leaflet to include functionality and a look-and-feel built specifically for the National Park Service.

This is beta software. Feel free to play around, but keep this in mind -- and please help test and report issues.

NPMap.js will eventually take the place of the NPMap JavaScript library.

Thanks

Heavily inspired (cough cough) by MapBox.js, and, of course, built on the great Leaflet library. Standing on the shoulders of giants.

Versioning

NPMap.js is versioned using semantic versioining. This means that releases are numbered: major.minor.patch and follow these guidelines:

  • Breaking backward compatibility bumps the major (and resets the minor and patch to zero)
  • New additions that don't break backward compatibility bumps the minor (and resets the patch to zero)
  • Bug fixes and miscellaneous changes bumps the patch

Changelog

Hosted Version

NPMap.js is hosted on the National Park Service's content delivery network. Feel free to load the library directly from there. You can access hosted versions at http://www.nps.gov/npmap/npmap.js/major.minor.patch/. You should replace "major.minor.patch" with the number of the version you want to access.

Building

You must have node.js installed to run the build. After installing node.js:

git clone https://github.com/nationalparkservice/npmap.js.git
cd npmap.js
npm install

Then use Grunt to build the library:

grunt build

Internally, the Grunt task uses browserify to combine dependencies. It is installed locally, along with other required packages, when you run npm install. The build task also uses uglify and cssmin to create minified versions in dist/.

Testing

NPMap.js uses the Mocha JavaScript test framework and PhantomJS to run the tests. You can run the tests with the following command:

grunt test

Documentation

Take a look at API.md. Ignore the random notes at the bottom; they will be cleaned up and turned into complete thoughts soon.

Examples

Simple and targeted examples reside in the examples directory.

Some of the examples have two versions: a version with -api at the end of the file name and a version with -bootstrap at the end of the file name. This reflects the two different ways NPMap.js can be used:

  1. Like "traditional" mapping APIs. This works well if you are familiar with JavaScript and have access to include JavaScript and CSS files in the web page your map is going to be included in. These examples use npmap.js directly, and utilize the API to build the map.
  2. Indirectly, through the use of bootstrap.js. This allows you to configure your map using the NPMap variable. This is the recommended approach for non-technical users and/or those who don't have access to the web page the map is going to be included in (which is the case if you are using the National Park Service content management system). This is also the approach used by the NPMap Builder.

Support

You can get in touch with the NPMap team by contacting us via Twitter (@npmap) or email ([email protected]). We are happy to help with any questions, and feedback is welcome as well!

Code Status

Build Status ![Dependencies](https://david-dm.org/nationalparkservice/npmap.js .png) Dev Dependencies Built with Grunt

About

A JavaScript mapping library for the National Park Service, built as a Leaflet plugin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published