ITsolutionWizard
asked on
MVC, Google Place Type, import
I start with the following codes with mvc/json/c#
and I just want to know how to get the following items
Or there is easier way to get everything inside of json file. that will be great.
rating
open now
weekday text
viewport
photos height
photos html_attributions
https://developers.google.com/places/web-service/search
and I just want to know how to get the following items
Or there is easier way to get everything inside of json file. that will be great.
rating
open now
weekday text
viewport
photos height
photos html_attributions
https://developers.google.com/places/web-service/search
WebClient wc = new WebClient();
string jsonStr = wc.DownloadString("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.753,-122.443&radius=10000&type=rv_park&key=AIzaSyCietasdfasdfasdfasdfxzD65Uc19X6DgrJFumdi-nCZYSHjg");
GooglePlacesResponse gpr = (GooglePlacesResponse)JsonConvert.DeserializeObject<GooglePlacesResponse>(jsonStr);
Response.Write(gpr.status + "<br><br>");
ASKER
so what I need to do with the classes you posted?
use it the same way you did it for the status : gpr.status
so, for exampel :
so, for exampel :
if(gpr.results.length>0)
{
if(gpr.results[0].photos.length>0)
{
Response.Write(gpr.results[0].photos[0].photo_reference + "<br><br>");
ASKER
it just returns one record from your codes., do you know how to get all of them?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
leakim971 got me best solution
Open in new window