Page 1 of 5

Google places Rankby Distance

Posted: Wed Dec 03, 2014 5:39 pm
by Cristian Hidalgo

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?


Google places Rankby Distance

Posted: Wed Dec 03, 2014 6:21 pm
by Evgene Karachevtsev

Hello Cristian,

Please look at this tutorial:
http://devcenter.appery.io/documentat...


Google places Rankby Distance

Posted: Wed Dec 03, 2014 6:43 pm
by Cristian Hidalgo

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?


Google places Rankby Distance

Posted: Wed Dec 03, 2014 6:46 pm
by Cristian Hidalgo

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...


Google places Rankby Distance

Posted: Wed Dec 03, 2014 9:15 pm
by Cristian Hidalgo

can you pls have a look att my question below.Thx.


Google places Rankby Distance

Posted: Wed Dec 03, 2014 9:26 pm
by Evgene Karachevtsev

Cristian,

We are working on it and will get back to you withe the update.


Google places Rankby Distance

Posted: Wed Dec 03, 2014 10:20 pm
by Cristian Hidalgo

thx


Google places Rankby Distance

Posted: Thu Dec 04, 2014 2:26 am
by Yurii Orishchuk

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.


Google places Rankby Distance

Posted: Thu Dec 04, 2014 2:51 am
by Cristian Hidalgo

Image

Get this error message


Google places Rankby Distance

Posted: Thu Dec 04, 2014 2:53 am
by Cristian Hidalgo