maletor maletor - 2 years ago 63
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download