Ian Usher7109531
Posts: 0
Joined: Tue Sep 16, 2014 6:57 pm

Gecoding - Find nearest 3 based on lat long held in database.

Hi Yurii,

What i want to do now is use the geolocation service to decide what lat and long should be queried. For example within the attached picture, i want to be able to use the Latitude and Longitude from the geolocation service rather than having to enter one in. Again hope this makes sense, its the last bit that im really struggling with currently! :)

Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Gecoding - Find nearest 3 based on lat long held in database.

Hi -

Yes. You will need to fill data from geolocation service in the nearSphear parameter, cause DB doesn't know about your currentLat and currLong parameters.

Ian Usher7109531
Posts: 0
Joined: Tue Sep 16, 2014 6:57 pm

Gecoding - Find nearest 3 based on lat long held in database.

Thanks illya,

How do i reference these? Is it a standard currentlat and currentlong that is used, or is it something i specify? If it is something i specify, where and how can i do this? Could you provide a basic example or screenshot of how to do this please?

Many thanks,

Ian

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Gecoding - Find nearest 3 based on lat long held in database.

Ian,

Map corresponding field to nearSphear parameter http://devcenter.appery.io/documentat....

[quote:]Is it a standard currentlat and currentlong that is used, or is it something i specify?[/quote]
Please clarify this question. As I can see these are yours defined parameters.

Ian Usher7109531
Posts: 0
Joined: Tue Sep 16, 2014 6:57 pm

Gecoding - Find nearest 3 based on lat long held in database.

Ok...so at the minute when this service runs...it uses my parameter that ive set.

What i want to do is use the geolocation service Coordinates rather than a set that i have defined.

So when the geolocation is run i want the coordinates from the geolocation service to be used, rather than the ones that i have defined In the query.

Does that clarify the question?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Gecoding - Find nearest 3 based on lat long held in database.

Hello Ian,

We are very sorry for the radio silence here.
You should change your where parameter upon calling your service:
1) please go to the page
2) open the before mapping
3) add js there
prereturn "{'Geolocation':{ '$nearSphere':[" + currLat + "," + currLong + "]}}"/pre

Ian Usher7109531
Posts: 0
Joined: Tue Sep 16, 2014 6:57 pm

Gecoding - Find nearest 3 based on lat long held in database.

Hi Evgene/Yurii,

I have finally managed to get this working. I appreciated your assistance (and persistence) with this.

Many thanks,

Ian

Return to “Issues”