Given a pair of lat/lng values, how do I determine if the pair is within a polygon? I need to do this in PHP. I see that Google Maps API has a containsLocation
As you said in your question, this method is related to the geometric library of the Google Maps API V3, so the objects cannot be handle from PHP, the solution that could works it's to make an ajax called to the server, asking for your lat and long, returns the data (go to the data base do your stuff) and in the event success (with the library of google maps already loaded) check if the points contains that point. And maybe if you need to save this in some point make another ajax sending the result for the current position asked.