0

I'm trying out the google places api.

I can search for hotels or whatever i want and can save these locations in my database with any information that google places API serves. My plan is that any user can save their actually location. In the next step, the user should see, wich other users are in the nearby.

How can i do this? Is there any method do calculate with die longitude and latitude of google maps?

Hope that you understand my good english :D

Tobias
  • 4,921
  • 4
  • 31
  • 40
  • I don't see why you would need the Places library to save a user location. In what is *searching for hotels or whatever* related to displaying a user location? – MrUpsidown Feb 19 '14 at 10:03
  • Well, you could search for an hotel around the world and then you could register your next trip there - via google maps/places... the next user which is looking for the same town should see which user is there at the same time.. I hope you know what i mean...:D My Problem is, that i don't know how to do that... – Tobias Feb 19 '14 at 13:48
  • Ok. But the two things are unrelated. I assume you want to know how to save a user location to a database? What DB will you use? What backend language? We need more information to help you with that. – MrUpsidown Feb 19 '14 at 13:54
  • I know how i can save the location to my db. I'm using RoR with Sqlite. But i don't know how i can show users which are in the same town. I.e. if you want to travel to London you would search for London (of course^^) and then Google Places will show London mit some markers which represent difference hotels. And then you should see people markers which represent other users < i don't know how i can do this - i have to look in my db but i don't know with which parameters etc... i don't know how i can identify users in the near of 5 miles etc... – Tobias Feb 19 '14 at 14:41

1 Answers1

0

As per your last comment: you want to know how to query your database to return markers within a specific range (or radius).

Please see my answer here: https://stackoverflow.com/a/21043061/1238965

Hope this helps.

Community
  • 1
  • 1
MrUpsidown
  • 21,592
  • 15
  • 77
  • 131