Let me try to address your questions as you asked them. 1. Is there an AJAX control that will [calculate the distance between a known address and user-provided zip code]?
Not that I'm aware of, right off hand, but it wouldn't be terribly involved to implement one. There would just be a couple of questions about the implementation and traffic rates, etc., before you could figure out the best way to do it. For instance, are you going to be doing this for multiple addresses and/or zip codes in very short order? Do you already know the lat/lng coordinates for the vendor addresses? Are you already loading the Google Maps API? If you're using the Maps API already, all you have to do to get the straight- line distance between to lat/lng pairs is convert them in the GLatLng objects and call latlng1.getDistance(latlng2); 2. If I'm using a web-service - how do I get the Ajax control to communicate with it? Skip the AJAX part. Use the Search API's RESTful side to run geocode requests and write your own distance calculation. The straight-line math is readily available on the internet for either linear or great- circle calculations. Jeremy R. Geerdes Effective website design & development Des Moines, IA For more information or a project quote: http://jgeerdes.home.mchsi.com http://jgeerdes.blogspot.com http://jgeerdes.wordpress.com [email protected] Unless otherwise noted, any price quotes contained within this communication are given in US dollars. If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church! And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com ! On Mar 12, 2009, at 12:36 PM, WISEMANOFNARNIA wrote: > > I am working on a website that wants the following: > 1. given some addresses submitted by vendors, find out how far they > are from a zip code (this zipcode is submitted by a user). What I > need is to know how to get started. For instance, is there an Ajax > control somewhere that I can just plug into a page? Or is it more > involved than that? And if I got longitude and latitude for a > zipcode, how does that convert to miles from a different longitude and > latitude? > And if I''m using a web-service - how do I get the Ajax control to > communicate with it? > Thanks, > Marv > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google AJAX APIs" 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-AJAX-Search-API?hl=en -~----------~----~----~----~------~----~------~--~---
