Create a new PhotoSearchOptions class.

PhotoSearchOptions options = new PhotoSearchOptions();


Set its BoundaryBox property to a newly created object.

options.BoundaryBox = new BoundaryBox(-1.7, 54.9, -1.4, 55.2); // Roughly Newcastle upon Type, England


Or use one of the example BoundaryBox instances provided as static properties.

options.BoundaryBox = BoundaryBox.Canada;


If you want the latitude and longitude returned you'll need to add the PhotoSearchExtras.Geo enum to the Extras property.

options.Extras |= PhotoSearchExtras.Geo;


Then perform your search.

PhotoCollection photos = flickr.PhotosSearch(options);
foreach(Photo photo in photos)
{
  Console.WriteLine(String.Format("Photo \"{0}\" is at {1},{2}", photo.Title, photo.Latitude, photo.Longitude);
}

Last edited Mar 23, 2010 at 3:51 PM by samjudson, version 3

Comments

No comments yet.