Skip to content

GeoPoint storing as strings if constructed by a string array #592

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

Closed
Krilwya opened this issue Jul 4, 2018 · 5 comments
Closed

GeoPoint storing as strings if constructed by a string array #592

Krilwya opened this issue Jul 4, 2018 · 5 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@Krilwya
Copy link

Krilwya commented Jul 4, 2018

I encountered an issue using near after migrating string gps positions into GeoPoints.

So basically when you do something like :
new Parse.GeoPoint(["48.84023", "2.33334"])
it returns :
ParseGeoPoint {_latitude: "48.84023", _longitude: "2.33334"}

So it passes through the constuctor of the Geopoint, it shall be more efficient in the _validate method of the Geopoint to check typeof latitude == "number" and same with longitude or try to cast those into parseFloat or whatever.

Knowing all of that, having string geopoints break all near, withinKilometers, and so on functions as mongodb would look for floats.

@flovilmart
Copy link
Contributor

@Krilwya are you willing to open a PR with the failing test and add additional validation?

@flovilmart flovilmart added type:bug Impaired feature or lacking behavior that is likely assumed good first task labels Jul 4, 2018
@Krilwya
Copy link
Author

Krilwya commented Jul 9, 2018

Sure, I runned the jest test on my changes locally, that succeed them, if you could explain to me the procedure to ask for a pull request as it's my first time on github that'd be great. I am only used to vsts.

@flovilmart
Copy link
Contributor

flovilmart commented Jul 9, 2018

Did you check the github pull request guide? https://help.github.com/articles/creating-a-pull-request/

Usually:

  1. Fork the project
  2. in your local clone, add your remote with git remote add fork https://github.com/USENAME/Parse-SDK-JS.git
  3. CreAte a new branch: git checkout -b my-feature-branch-name
  4. Commit your changes git add .; git commit -a
  5. Push to your fork: git push fork my-feature-branch-name
  6. Open github.com/Parse-community/Parse-SDK-JS and you should be able to open the Pull request

@Krilwya
Copy link
Author

Krilwya commented Jul 9, 2018

Thank you for your answer, I think I did all the requirement to do so. If you need anything else to verify or something seems wrong I'd be pleased to hear from you.

@dplewis
Copy link
Member

dplewis commented Feb 11, 2019

Closing via #671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants