diff --git a/.changeset/witty-wombats-doubt.md b/.changeset/witty-wombats-doubt.md new file mode 100644 index 0000000..a9b5f10 --- /dev/null +++ b/.changeset/witty-wombats-doubt.md @@ -0,0 +1,5 @@ +--- +"@watergis/maplibre-gl-sky": patch +--- + +fix: improved algorithm to get the correct time's sky definition. update sky when move map if location is not specified. diff --git a/packages/maplibre-gl-sky/README.md b/packages/maplibre-gl-sky/README.md index b18c19a..20dd891 100644 --- a/packages/maplibre-gl-sky/README.md +++ b/packages/maplibre-gl-sky/README.md @@ -21,14 +21,14 @@ import { SkyControl } from '@watergis/maplibre-gl-sky'; const map = new Map(); const sky = new SkyControl(); -sky.addToMap(map); +sky.addTo(map); ``` - add specific sky color ```ts const sky = new SkyControl(); -sky.addToMap(map, { +sky.addTo(map, { timeType: 'sunset' }); ``` @@ -37,7 +37,7 @@ sky.addToMap(map, { ```ts const sky = new SkyControl(); -sky.addToMap(map, { +sky.addTo(map, { date: new Date() }); ``` @@ -51,7 +51,7 @@ const newOptions = defaultSkyOptions; // edit your options for `newOptions` const sky = new SkyControl(newOptions); -sky.addToMap(map); +sky.addTo(map); ``` ## License diff --git a/packages/maplibre-gl-sky/index.html b/packages/maplibre-gl-sky/index.html index f3697c3..71b1712 100644 --- a/packages/maplibre-gl-sky/index.html +++ b/packages/maplibre-gl-sky/index.html @@ -40,7 +40,7 @@ >