Using geolocation data of websocket users on a specific server, I’m trying to restrict visibility of chat comments sent through the websocket. The websocket would look something like this:
http://html5demos.com/web-socket
I’m trying to restrict the visibility of the comments to only those simultaneously viewing the chat room who are in a defined proximity to one another (say, 100 feet).
How would I use the geolocation data of users pulled from something like this:
and use it to restrict the visibility of chat comments sent by a single user to only those viewing the same websocket who are within 100 feet of this user?
Anything pointing me in the right direction would be helpful.
Thank you!
Use navigation.getlocation API to get the user location:
https://developer.mozilla.org/En/Using_geolocation
Send the location of all users to the server via websocket.
Filter passed through messages at the server end by calculating distance difference between different users.