You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have noticed that in my app the GeoPoint is stored as: {Wa:number, za:number} instead of latitude and longitude as used in your code.
I have modified the "filter" inside the "within" function as follows: var _a = val[field].geopoint, latitude = _a.latitude ? _a.latitude : _a.Wa, longitude = _a.longitude ? _a.longitude :_a.za;
With this is works.
Bye
Luca
The text was updated successfully, but these errors were encountered:
@lucapale can you explain in more detail where you put this?
I also have the problem, that the point object is stored differently in some cases. The pattern I can see on my side so far is that this happens when the created object is set to firestore through a transaction.
Then the object looks like this and I cannot query it with the proposed within query from the documentation:
I have noticed that Firebase stored the information in this way because I was converting all the data to JSON before writing it (i.e. JSON.parse(JSON.stringify(object)) ).
This because Firebase does not accept classes which are not known. Now I keep at least the geolocation information as class inside the object and Firebase stores it in the correct way.
For the previous data I have made a function which converts again the stored object into a Geopoint, before making the query.
Hi,
I have noticed that in my app the GeoPoint is stored as: {Wa:number, za:number} instead of latitude and longitude as used in your code.
I have modified the "filter" inside the "within" function as follows:
var _a = val[field].geopoint, latitude = _a.latitude ? _a.latitude : _a.Wa, longitude = _a.longitude ? _a.longitude :_a.za;
With this is works.
Bye
Luca
The text was updated successfully, but these errors were encountered: