Hi Rashid, The answer to your question depends on how you are storing the points (hotels in your example). If each hotel is a marker on your map, you could iterate through each marker and calculate the distance between the marker's location and the center of the map using the Haversine formula (a rather complex series of math). Then, if the marker is outside the appropriate distance, you can hide it.
A more elegant solution would be to store your points in a database and query for only the ones within the allotted distance. This can be done with any database, also using the Haversine formula. However, there are now platforms that perform these "spatial queries" for you. Some potential examples are SimpleGeo, Factual and Google's own Fusion Tables. For the last of these, you can see the documentation for "<spatial_condition>" here: http://code.google.com/apis/fusiontables/docs/developers_reference.html#Select If the city is dynamic (ie, not always Valencia), you'll also need to convert the city name to a latitude and longitude point before doing any of the above. Best of luck! --Adam DuVander http://mapscripting.com On Apr 27, 11:30 pm, rashid herrera <[email protected]> wrote: > Hello. > > I have a business directory, when someone go to one category, for example > hotels in city=valencia then I want show a list of hotels in valencia, at > the right side a google map with all those hotels and a little bar or drop > down menu that say: > View hotels near: > 5km, 10km, 20 km, 30km, 40 km, 50km, 70 km, 90 km, 120km. > Then in the map the zoom change and the hotels are showed. > > What I don´t have any idea is how to do that? is there any manual available? > > thanks. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
