Skip to content

query.withinMiles() will not work while query.near() works fine #2075

Closed
@Siraris

Description

@Siraris

I've been trying, to no avail, to get the withinMiles query method to work. From what I can tell, withinMiles calls withinRadians calls near, and the only difference is the $maxDistance property is applied to the query. Below are the methods I'm using for both the withinMiles method and the near method:

query.withinMiles('currentLocation',
      new Parse.GeoPoint(-73.96939568075399, 40.83514669005315), 
      maxDistance
  );

  query.near('currentLocation',
    new Parse.GeoPoint(-73.96939568075399, 40.83514669005315));

Near runs and returns many objects from the database. withinMiles runs and returns an empty array. As you can see, at face value, it's the exact same method call, with the exact same properties, other than the maxDistance argument for withinMiles. maxDistance, for reference, is a Number value as required by the API.

I find it hard to believe that this is a bug, but from everything I can tell, it is. Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions