Skip to content

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

Closed
@Krilwya

Description

@Krilwya

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions