public double getLongitude(string zipcode) { string zURL = string.Format("http://maps.googleapis.com/maps/api/geocode/xml?address={0}", zipcode); WebRequest latlongRequest = WebRequest.Create(zURL); Stream latlongStream = latlongRequest.GetResponse().GetResponseStream(); XMLParser myParser = new XMLParser(latlongStream); return myParser.getLongitude(); }
public List<string> findHealthcare(string zipcode) { Tuple<double, double> latlon = new Tuple<double,double>(getLatitude(zipcode), getLongitude(zipcode)); string hURL = string.Format("https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location={0},{1}&radius=8000&types=hospital&&key=AIzaSyDi63HmrxBC4Dfu9TF_z3avqxEryE0ZaDE", latlon.Item1, latlon.Item2); WebRequest searchRequest = WebRequest.Create(hURL); Stream resultsStream = searchRequest.GetResponse().GetResponseStream(); XMLParser myParser = new XMLParser(resultsStream); return myParser.parseHealthcareLocations(); }