maletor maletor - 5 months ago 7
Javascript Question

Dragging map changes search results

How would you implement draggable search results with Google maps API v3 akin to the way Yelp does.

My guess is that you would bind to a map move event and link to an anchor like

and pass those bounds through to the search.

Btw, this is for a Rails project.


Here's the Map reference:

The event "bounds_changed" seems to be what you want. When it fires you should get the map boundaries using map.getBounds() and pass that along to your search.