JSPM

@watergis/maplibre-gl-sky

0.0.9
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q36724F
  • License MIT

This repository is to add sky color to maplibre-gl-js smartly

Package Exports

  • @watergis/maplibre-gl-sky

Readme

malibre-gl-sky

License CI Netlify Status GitHub repo size

This repository is to add sky color to maplibre-gl-js smartly

plugin-image

Installation

npm i -D @watergis/maplibre-gl-sky

Usage

  • Basic usage

This way, it will fetch the sun calc time from map center and try to get the right color palette for sky.

import maplibregl, { Map } from 'maplibre-gl';
import { SkyControl } from '@watergis/maplibre-gl-sky';

const map = new Map();

const sky = new SkyControl();
sky.addTo(map);
  • add specific sky color
const sky = new SkyControl();
sky.addTo(map, {
    timeType: 'sunset'
});
  • add specific date
const sky = new SkyControl();
sky.addTo(map, {
    date: new Date()
});
  • Customise sky colors
import { defaultSkyOptions, SkyControl } from '@watergis/maplibre-gl-sky';

const newOptions = defaultSkyOptions;
// edit your options for `newOptions`

const sky = new SkyControl(newOptions);
sky.addTo(map);

Contribution

See CONTRIBUTING

License

MIT License