First decide what you want to do. If you want the searched data to fill the displayed map, at the client- side get the bounds of the displayed map and send to the server (two corners wiil do) for a simple rectangular search. That's just a simple min > x > max comparison.
If you want the search to be within-a-radius, send the centre point and the radius to the server. In php, write a routine to use the haversine forumula to determine the bounds of the area by lat/long. Search your database by that, as a simple rectangle, for speed. If you really want a true radius, process the results further by calculating the distance from the centre for each and discarding "the ones in the corners". If you auto-zoom and centre the map to fit the returned data, be aware that the zoom comes in discrete steps so the plot may not exactly fit the map. If there are few results at the edges, the map may zoom in tighter than the searched area, and/or may not be centered at the 'target' centre. You might want to control that in some way. One way would be NOT to auto-fit the returned data at all, but to stay focussed on the original centre and 'radius'. Going back to your older posts, you seem to want to geocode some centre point,and work out the map bounds to fit. Andrew gave the answer for that - calculate client-side using haversine to get top/ bottom/left/right limits. Create a GBounds with those and zoom/centre the map on that. If you want to use the simple search method, you send those limits to your server for the search params. cheers, Ross K --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
