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

Requiring latitude and longitude to be strictly Number typed impairs ergonomics #139

Closed
sjmiles opened this issue Jun 7, 2015 · 0 comments · Fixed by #140
Closed

Requiring latitude and longitude to be strictly Number typed impairs ergonomics #139

sjmiles opened this issue Jun 7, 2015 · 0 comments · Fixed by #140
Assignees

Comments

@sjmiles
Copy link
Contributor

sjmiles commented Jun 7, 2015

As we know, JavaScript is weakly typed, and it's not uncommon to end up with numeric data that is in String format. In particular, the native <input> returns only String value, even when set to type="Number".

Whenever possible, it's useful for components to liberally accept Strings where numeric data is required, and perform conversion and the point of requirement.

In this case, the _updateCenter method throws if the latitude or longitude properties are not Number type. It will improve ergonomics if we first cast those properties to Number before checking for isNaN.

@sjmiles sjmiles self-assigned this Jun 7, 2015
sjmiles pushed a commit that referenced this issue Jun 7, 2015
… restriction on latitude/longitude properties (fix #139)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant