Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement - Location is in Daylight #3

Open
Danny-SS opened this issue Mar 1, 2018 · 0 comments
Open

Enhancement - Location is in Daylight #3

Danny-SS opened this issue Mar 1, 2018 · 0 comments

Comments

@Danny-SS
Copy link

Danny-SS commented Mar 1, 2018

I stumbled across this looking for a map overlay for MapKit to show daylight/night over map of the world. I am glad to see a solid foundation in this project.

Here's an enhancement I'd like to see:

Given a longitude and latitude, at the current time, is that location in daylight or darkness.

[User could choose what they consider daylight from the SolarEvent enum. It would be great if we did not have to worry about time zone and just a location on earth at the current time.]

So maybe something like:

let currentLocation = CLLocationCoordinate2D(latitude: 40.642, longitude: -74.017)
let inDaylight: Bool = currentLocation.inDaylight(usingDawn: .civilDawn, andDusk: .civilDusk)

I'll be playing around with what you have. Beats starting from NASA's codeI've seen since this is already migrated to Swift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant