I’ m working on an app and I’d like to calculate and display the distance between the logged in user and the other members.
To calculate the distance between members, I need to use their address. But I don’t want this address to be publicly accessible.
Do you think there is a way to conceal the geographic address of members while using it to calculate the distance between one member and the others? when I use the privacy settings to hide the address, the distance isn’t visible to other members, does anyone have an idea of a workaround ?
I’d love to know more about it, how can we calculate the exact distance between two addresses if we want to keep both addresses or at least one private for the client-side user?
Is there any way to do the calculation server-side maybe?
Perhaps the way to go is to avoid placing the geo field in the user object. Create a separate data type to hold that geo address, call it “address”, add it to the user as field address of type “address”, and apply privacy rules to that data type.
When you need the geo address for distance calcs just look it up and run them server side (if things do not work in browser due to the privacy rules).
My only thought is to do what other companies do and maybe have another field called approximateLocation. Then update that every minute with something more general. Depending on how aproxímate you want it to be. Just extract the city or something. Then you can expose the city field only and do the distance based off of that. Would that work?