maplibre-gl-nightlayer
v1.0.0-alpha.5
Published
A Night Layer for MapLibre GL JS
Downloads
328
Maintainers
Readme
A Night Layer for MapLibre GL JS
Adds a simple night shadow (Earth's shadow) on the map.
Install
$ npm install --save-dev maplibre-gl-nightlayer
Usage
import { NightLayer } from 'maplibre-gl-nightlayer';
:
map.on('load', () => {
map.addLayer(new NightLayer());
});
API
type Color = [number, number, number];
type Options = {
date?: Date | null;
opacity?: number;
color?: Color;
twilightSteps?: number;
twilightStepAngle?: number;
twilightAttenuation?: number;
};
class NightLayer implements CustomLayerInterface {
constructor(opts?: Options);
getSubsolarPoint(date: Date): {
subsolarLng: number;
subsolarLat: number;
};
getDate(): Date | null;
setDate(date: Date | null): void;
getOpacity(): number;
setOpacity(opacity: number): void;
getColor(): Color;
setColor(color: Color): void;
getTwilightSteps(): number;
setTwilightSteps(steps: number): void;
getTwilightStepAngle(): number;
setTwilightStepAngle(angle: number): void;
getTwilightAttenuation(): number;
setTwilightAttenuation(attenuation: number): void;
:
}