[MUSIC]
Hello, and welcome to our geolocation services demo,
where we integrate the 2D sphere implementation into our Zips application.
And the core focus of this demo will be again on the Mongo Db,
the geolocation services, the 2D sphere creation of an index and
of course, the rails, scaffold and all of that you have done in the past.
So I want to start and begin this by going over a demo and then we'll go back,
and look at the code implementation for each of the different pieces.
Now this is your Zips index page, when you bring up the index application.
Now if you go all the way to the bottom, you will see maps, right,
which is a pretty nice, easy,
cool way of integrating rich geo-location with your application.
So one thing you would need is a gem, which we will see in a minute.
You would need to add that gem and
to integrate the Google Maps into your application,
right, and so you get all this look and feel.
So if I go and click on one of these show, then I will get another view
where you will have the basic information about that city and state, and
the population and all that, and taking the location information.
The latitude and longitude, we will plot that on the map, and
we also have five cities, and that's because of the limit equal to five,
which we'll look at in a minute.
Our defined method will go and get the min distance and apply the min, the max, and
the limit to get this data.
Now you can also go and do additional things like send parameters like for
example, I can go and do this, which is sending the zip code of Baltimore,
right, and then max miles of 500, min miles of 10 and limit of 15,
then it'll go and get all the cities based on that search criteria.
To make it less cluttered, I can go to five, and
that should give me much more distributed because I'm only looking for
the five cities around that Baltimore.
For example, this one is Jacksonville, Baltimore, and this one, Jacksonville,
Maryland, I mean, and this is a different city and so on.
So let's go look at the code to see how all of these have
been integrated into our existing Zips application.
Now the very first thing that you will need is to create an index, right, and
you have all this documentation on the GitHub repository, so
you will have to go and create an index as shown here.
So this has to be done, so we can take advantage of this feature in our
application, and this is the command zip collection drop one,
this is the command so that you can remove this later on.