All threads / Geo-spatial Search with Geocoder and Google Maps Discussion

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Geo-spatial Search with Geocoder and Google Maps Discussion

Awesome episode! Really enjoying the maps and geolocation episodes!

Thanks, Chris!

Reply

I really love de geolocation series,

Are you going to keep uploading more videos about this series?

Sure can, do you have any topics you're curious about?

hello!!
yes, I would like to know how to refresh the markers each time that the map is dragged without refresh the whole map.

that would be amazing

regards!

Reply
Reply

Love this episode!! Thanks Chris! Question though are there any disadvantage in using geocoder? And instead relying on Google Maps Javascript API?

Reply

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

Reply
Reply

Would be awesome if it does the "Redo Search in this area" without clicking on the button

Reply

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.

Let me rephrase my question :)

Does this series cover displaying of route between two markers? Suppose I select Marker A and then select Marker B then the route should be displayed between the two, is this feature covered in this series?

Not at the moment, but that's as simple as adding a couple lines of code to your JS. Check out the route examples: https://hpneo.github.io/gma...

Reply

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

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 35,699+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.