The application I’m developing allows people to create events in their
local
area; as part of this feature I want to display a list of, say, the five
most recent events within 30 miles of a person’s location.
I have a User model and a Profiles model which contains the user’s
location
(city, state, zip code) among other non-related personal information.
So
what I would like to do is be able to do is to get a list of upcoming
events
relative to that person’s location, and display it on their “control
panel”
when they log in to the site.
Also, at some point in the future I want to integrate with Google Maps
to
display a map of the Event’s location on a particular event’s detail
page
(i.e. “show” action in the controller); this isn’t required for the Beta
version of the site, but it’s something to consider since it will be a
feature later.
I’ve been looking at the Google Maps API but I’m not sure if it would
let me
do what I really need, which is to query for all zip codes within 30
miles
of a given zip code, so I can display the events to users who live
within
that radius and hopefully get them to attend.
I have the book “RailsSpace”, and it implements something similar to
what I
want with a database, but if I go this route will it prevent me from
using
Google Maps at a later date? I haven’t really looked yet to see if
there
are any plugins that can help me out with this - I want to get a handle
on
the concepts I need, and then work on the implementation.
To summarize, what I want to be able to do is:
- Display a list of the five most recent events within 30 miles of a
user’s
location on their profile page - Send an email to all users within 30 miles of an event upon creation,
notifying them that a new event has been scheduled in their area (this
one I
can probably figure out myself once I have the location part done) - Enable a user to search for upcoming events within a specified radius
of a
zip code - At some point in the future, integrate with Google Maps to display a
map
of the event in question; presumably this would be based on the event’s
zip
code
Anyone have any pointers on how to accomplish this? My main point of
concern is I’m not sure if I should use the approach of the RailsSpace
book,
which as I recall is to set up a database containing the location data,
and
do some funky math to get the radius, or if there’s some third-party API
available that I could mash-up with and leverage, especially if it would
make future integration easier.
Any help would be appreciated.
–
Wayne M.
[email protected]