Geo-spatial Search with Geocoder and Google Maps Discussion
I really love de geolocation series,
Are you going to keep uploading more videos about this series?
Love this episode!! Thanks Chris! Question though are there any disadvantage in using geocoder? And instead relying on Google Maps Javascript API?
Another cool idea, would be the ability to update the map with locations near a user based on their location/ip address, either automatically or with a manual reload. I know this is difficult to do in development, but would love to see this.
Not as difficult as you might think. The HTML5 geocoding API will get you an IP address quickly, so you can send that over as a different param and pass that into the .near() method. This will be a great screencast. :D
Does this series cover displaying the distance between two markers or coordinates?
I mentioned the geocoder gem comes with some calculations methods. One of those is for distance between two points. You can use that, just check the readme.
Hi, Once again, thanks for the video.
How would I pass parameters into the dragged "l=" bounding box? In your example we use the following:
map.addListener("dragged", function(){
var bounds = map.getBounds();
var location = bounds.getSoutWest().toURL + "," + bounds.getNortEast().toUrlValue();
Turbolinks.visit('/apartments?l=${location}');
}
After doing a normal search with params[:near] and params[:category_id] my url looks like the following: www.site.com/apartments?near=tulsa&category_id=1
Where/How would I pass the parameter of catergory_id so that when I drag the map I still only see apartments that fall in my search criteria?
thanks