Hello All,
I want to put this in the simplest terms as i've spent so long looking at something that i think is relatively simple, and i don't want to waste anybody else's (or my own time) any longer if necessary.
Using the geolocation service (i.e. my current location) i want to pull back the two nearest items contained within a database.
If i hard code the latitude and longitude (as shown) then i can get the application to return a set of data as expected.
In its simplest terms i want to use the latitude and longitude from the geolocation service in order to determine what is the nearest item.
I have created a local storage variable and i can see from other users that you need to create the code along the lines of:
{ "Geolocation" : { "$nearSphere" : [currentlat, currentlong] } }
What i would like somebody to explain is how it is possible to use the geolocation service, latitude and longitude, and enter that into the query above?
Please please please help me!!!
Many thanks.
Ian