let l;
let lat;
let lng;
firebase.database().ref('/geofire/' + currentUser.uid).once('value').then(function(snapshot) {
console.log(snapshot.val());
l = snapshot.val().l;
lat = l[0];
lng = l[1];
});
const geoQuery = geoFire.query({
center: [lat, lng],
radius: 10 //kilometers
});
This does not seem to be working. The center property is not accepting the lat and lng I am referencing from firebase. I did a type check on the lat and lng values and they seem compatible as numbers.
Hello, I am basically trying to pass location as variables to the query function.
So instead of hardcoding the center array like this:
I am doing the following:
I have even tried the following:
This does not seem to be working. The center property is not accepting the lat and lng I am referencing from firebase. I did a type check on the lat and lng values and they seem compatible as numbers.
Any help would be appreciated. Thanks