Determine if Lat/Lng in Bounds
问题 I'm interested in determining if a lat/lng location is within the bounds and looking for recommendations on a algorithm. (javascript or php) Here is what I have so far: var lat = somelat; var lng = somelng; if (bounds.southWest.lat < lat && lat < bounds.northEast.lat && bounds.southWest.lng < lng && lng < bounds.northEast.lng) { 'lat and lng in bounds } will this work? thanks 回答1: The simple comparison in your post will work for coordinates in the US. However, if you want a solution that's