I have geopoints on a db, and would need some help on how to use the rankby Distance function to list the three nearesr geopoints to my current location.
Anyone familiar with this that can give me a helping hand?
I have geopoints on a db, and would need some help on how to use the rankby Distance function to list the three nearesr geopoints to my current location.
Anyone familiar with this that can give me a helping hand?
Hello Cristian,
Please look at this tutorial:
http://devcenter.appery.io/documentat...
yes,I looked over there.
{
"location" : {
"$nearSphere" : [48.208, 16.373],
"$maxDistanceInKilometers" : 550
}
}
but the problem I have is how to assign a value from current position into this query..
i.e
{
"location" : {
"$nearSphere" : [+currentlat+,currentlon],
"$maxDistanceInKilometers" : +slider_value
}
}
how should the exact syntax be so that i can retrieve the data .
i have a listservice ,should I add the above paramaters in the request header and then?
and how do I plot the markers of the geolocations in the db tha are closest to my current location.
the nearsphere is a mongodb specific query but how do i achieve the rankbydisatnce using nearsphere?
confused...
can you pls have a look att my question below.Thx.
Cristian,
We are working on it and will get back to you withe the update.
Hi Crisitan,
Here is how to pass actual variables into query object:
pre
{
"location" : {
"$nearSphere" : [currentlat, currentlon],
"$maxDistanceInKilometers" : slider_value
}
}
/pre
Your response will be ordered in accordance to distance to goal point.
See details here: http://devcenter.appery.io/documentat...
http://prntscr.com/5d0cjl/direct
Regards.