We have implemented a search query to display database content 40 metres from users location based on this java script:
params.criteria = {
"location" : {
"$nearSphere" : [48.208, 16.373],
"$maxDistanceInMiles" : 80
}
};
We would like the query to pull content based on the users current location, we store the users current location in a storage variables " userLng" and "userLat".
This is what what we changed it to:
params.criteria = {
"location" : {
"$nearSphere" : [localStorage.getItem("userLat"), localStorage.getItem("userLng")],
"$maxDistanceInKilometers" : 0.4
}
};
However its is still not working, any advice as to the proper script to pull information from the storage variables "userLat" and "userLng" would be much appreciated?