code:

 

/*
 * Google Places
 */
CtpGglPlaces.Core.SearchUrlParameter param = new CtpGglPlaces.Core.SearchUrlParameter();
param.KeyProvider = new CtpGgl.API.GoogleAPIKeysProvider();
param.Location = new CtpGglPlaces.Impl.GeoPointImpl(marker.Point.Lat, marker.Point.Lng);
param.Radius = 500;
param.Sensor = false;

CtpGglPlaces.Impl.PlacesResult presult = CtpGglPlaces.Searcher.GetPlaces(param, "json");
if (presult.Status == "OK")
{
	List<String> s = new List<string>();
	foreach (CtpGglPlaces.Impl.PlaceObj obj in presult.Results)
	{
		s.Add(obj.Name + Environment.NewLine);
	}
	this.lBPlaces.DataSource = s;
}

 

CtpGglPlaces.Core.DetailUrlParameter param = new CtpGglPlaces.Core.DetailUrlParameter();
param.KeyProvider = new CtpGgl.API.GoogleAPIKeysProvider();
param.Reference = placesPairs[name];
param.Sensor = false;

CtpGglPlaces.Impl.PlaceDetailsResult presult = CtpGglPlaces.Searcher.GetDetail(param, "json");
Console.WriteLine(presult.Result.FormattedAddress);
StringBuilder sbttext = new StringBuilder();
sbttext.AppendLine(" -- " + presult.Result.Name + " -- "+Environment.NewLine);
sbttext.AppendLine(" Vicinity: " + presult.Result.Vicinity);
sbttext.AppendLine(" Phone: " + presult.Result.FormattedPhoneNumber );
sbttext.AppendLine(" Address: " + presult.Result.FormattedAddress);

download:

early preview version

Last edited May 16, 2011 at 7:10 AM by jebberwocky, version 3

Comments

No comments yet.