How to draw a rectangular area on a large google map and query database to find locations/points that exist inside the rectangle?

Looks like this question was asked (and answered) a few months before Google posted about the new drawing tools in v3 API ...

I have to say that using the API's drawing tools gives a better user experience than @rcravens solution. Here's a very specific implementation that lets you "select" an area on the map by drawing a rectangle or polygon, and then checking to see if a marker is inside the shape: http://jsfiddle.net/JsAJA/306/.


Interesting question. I love the google maps api. Here is a jsFiddle with your solution:

http://jsfiddle.net/JsAJA/2/

You will have to query your database for points between the minimum/maximum lat and lngs. Hope this helps.

Bob

P.S. Note that this breaks the natural user experience of google maps. The map is no longer dragged when you mouse down. It needs a better user experience.