{"id":13609518,"url":"https://github.com/joergdietrich/Leaflet.Terminator","last_synced_at":"2025-04-12T20:32:02.840Z","repository":{"id":11018323,"uuid":"13346752","full_name":"joergdietrich/Leaflet.Terminator","owner":"joergdietrich","description":"Night and day regions on Earth","archived":false,"fork":false,"pushed_at":"2024-05-11T12:15:01.000Z","size":42,"stargazers_count":122,"open_issues_count":6,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T03:51:45.783Z","etag":null,"topics":["days","earth","leaflet","leaflet-map","mapping","night","sunrise","sunset"],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joergdietrich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-05T14:48:42.000Z","updated_at":"2025-01-22T19:41:15.000Z","dependencies_parsed_at":"2024-05-11T13:30:24.426Z","dependency_job_id":"23c89bda-cd63-48d0-aafb-763fce38375f","html_url":"https://github.com/joergdietrich/Leaflet.Terminator","commit_stats":{"total_commits":35,"total_committers":4,"mean_commits":8.75,"dds":"0.34285714285714286","last_synced_commit":"e7e1175f4cb509f8e5db0c81747fc9bf0cc75c0c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joergdietrich%2FLeaflet.Terminator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joergdietrich%2FLeaflet.Terminator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joergdietrich%2FLeaflet.Terminator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joergdietrich%2FLeaflet.Terminator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joergdietrich","download_url":"https://codeload.github.com/joergdietrich/Leaflet.Terminator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248629780,"owners_count":21136310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["days","earth","leaflet","leaflet-map","mapping","night","sunrise","sunset"],"created_at":"2024-08-01T19:01:35.556Z","updated_at":"2025-04-12T20:32:02.355Z","avatar_url":"https://github.com/joergdietrich.png","language":"CSS","funding_links":[],"categories":["CSS"],"sub_categories":[],"readme":"Leaflet.Terminator\n==================\n\nOverlay day and night regions on a Leaflet Earth map.\n\nDemo: http://joergdietrich.github.io/Leaflet.Terminator/\n\nLeaflet.Terminator extends the Polygon class. Adding the terminator to a leaflet map is as easy as \n\n```html\n\u003cscript src=\"https://unpkg.com/leaflet\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/@joergdietrich/leaflet.terminator\"\u003e\u003c/script\u003e\n```\n```js\nvar map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));\nL.terminator().addTo(map)\n```\n\nOr with npm:\n\n```js\nimport L from 'leaflet';\nimport terminator from '@joergdietrich/leaflet.terminator';\n\nvar map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'))\nterminator().addTo(map);\n```\n\n\nIn addition to all Polygon options, Leaflet.Terminator has a new\noption `resolution`, which gives the step size at which the terminator\npoints are computed. The step size is 1°/resolution, i.e. higher\nresolution values have smaller step sizes and more points in the\npolygon. The default value is 2.\n\nLeaflet.Terminator computes the terminator from longitudes -360° to +360°\n(a range of 720°), covering the Earth twice. To limit the terminator\nlongitude range, the `longitudeRange` option is available.\n\n```js\nvar sunlightOverlay = L.terminator({resolution: 5, longitudeRange:360});\n```\n\nYou can pass the `time` option in the constructor or use the `setTime()`\nmethod to control the reference time and date for the terminator; the\nvalue can be anything accepted by the `Date()` constructor. By default,\nthe current time will be used.\n\nIn the same way, you can use the `setTime()` method without an argument\nto refresh the terminator to the current time. This can be done\nautomatically, for example using a timer:\n\n```js\nvar map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));\nvar terminator = L.terminator().addTo(map);\nsetInterval(function() {\n\tterminator.setTime();\n}, 60000); // Every minute\n\n```\n\nIf you don't like background timers running even when the page is\ninactive, you can also set the terminator to be refreshed only when the\nuser interacts with the map:\n\n```js\nvar map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));\nvar terminator = L.terminator().addTo(map);\nmap.addEventListener('zoomstart movestart popupopen', function(e) {\n\tterminator.setTime();\n});\n```\n\nYou can customize and complete this code by listing\nadditional map interaction events, described in the Leaflet\n[documentation](https://leafletjs.com/reference-1.6.0.html#map-event).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoergdietrich%2FLeaflet.Terminator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoergdietrich%2FLeaflet.Terminator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoergdietrich%2FLeaflet.Terminator/lists"}