开发者

Dragging map changes search results

开发者 https://www.devze.com 2023-03-23 07:49 出处:网络
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 #l=g:-122.4776458740

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 #l=g:-122.47764587402344,37.75225820732335,-122.37464904785155,37.83419172060041 and pass those bounds through to the search.

B开发者_高级运维tw, this is for a Rails project.


Here's the Map reference: http://code.google.com/apis/maps/documentation/javascript/reference.html#Map

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消