You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
Thank you very much for this handy library! I was wondering about a feature request that I think would be a useful addition. I have a dark map so using a dark overlay make the map even darker and is hard to distinguish the terminator. I would much rather visualize the light/day side with a white overlay.
How hard would it be to calculate the "inverse" Polygon? Could this possible be added?
The text was updated successfully, but these errors were encountered:
I was able to implement this using Leaflets polygon cutout feature:
letterminatorConfig={stroke: false,fillColor: '#FFFFFF',fillOpacity: 0.15};// get the coordinates of the terminator and flatten them from an array of objects to an array of arraysletterminatorCoords=L.terminator().getLatLngs()[0].map(function(obj){return[obj.lat,obj.lng];});// create the inverse of the terminator to highlight the day sideL.polygon([[[90,-300],[90,300],[-90,300],[-90,-300]],//outer rectterminatorCoords],// terminator cutoutterminatorConfig).addTo(map);
It's a little hacky, but it shows that it is possible to arrive at the inverse of the polygon. So mathematically it should only be some clever subtraction. I think it would still be cool to have a helper function in the library that does it for you :)
Hello!
Thank you very much for this handy library! I was wondering about a feature request that I think would be a useful addition. I have a dark map so using a dark overlay make the map even darker and is hard to distinguish the terminator. I would much rather visualize the light/day side with a white overlay.
How hard would it be to calculate the "inverse" Polygon? Could this possible be added?
The text was updated successfully, but these errors were encountered: