All Projects → mapbox → leaflet-terminator

mapbox / leaflet-terminator

Licence: ISC license
Displays a solar terminator on a Leaflet map.

Programming Languages

javascript
184084 projects - #8 most used programming language

leaflet-terminator

Displays a solar terminator on a Leaflet map.

API

terminator(date)

Create a solar terminator. The terminator is a Leaflet L.Path object.

date is optional, and would need to be a JavaScript Date object. Default is now.

terminator.setDate(date)

Recalculate the terminator to a given JavaScript Date object.

Using it

This is built with browserify. If you want a standalone javascript file or UMD module, download leaflet-terminator.js.

If you want to use it with browserify, use npm.

If you have a patch to contribute, change things in index.js or in one of the dependency files. leaflet-terminator.js is a built file, do not change it: your changes will be overwritten.

See Also

This is totally cribbed from Mike Bostock's example, which is itself cribbed from science. Under the hood lie a bunch of libraries that you can use separately, like leaflet-geodesy and spherical.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].