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

LatLng valid? method returns nil or lat value. #259

Open
JacobGalati opened this issue Aug 11, 2022 · 0 comments
Open

LatLng valid? method returns nil or lat value. #259

JacobGalati opened this issue Aug 11, 2022 · 0 comments

Comments

@JacobGalati
Copy link

JacobGalati commented Aug 11, 2022

The valid? method returns lat && lng which returns the first failed value or last value instead of a boolean as the documentation states.

Geokit::LatLng.new(nil,nil).valid?
# => nil
Geokit::LatLng.new().valid?
# => nil
Geokit::LatLng.new(49.0, -123.0).valid?
# => -123.0
Geokit::LatLng.new(49.0, nil).valid?
# => nil
Geokit::LatLng.new(nil, -123.0).valid?
# => nil

!!(lat && lng) would work though.

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