Giter Site home page Giter Site logo

khumam / polarmap.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geosensorweblab/polarmap.js

0.0 0.0 0.0 1 MB

Custom Leaflet layer for re-projecting maps and map features

License: BSD 2-Clause "Simplified" License

JavaScript 98.41% CSS 1.42% HTML 0.17%

polarmap.js's Introduction

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.

Leaflet Version PolarMap.js Version
0.7.x 1.1.x
1.0.x 2.0.x

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).

polarmap.js's People

Contributors

openfirmware avatar liangsteve avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.