Hi,
I just tryed this exact code in a menu item and it gives me a post code:
Code:
private void postcodefromlatlongToolStripMenuItem_Click(object sender, EventArgs e)
{
Map map = MP.ActiveMap;
Location loc = map.GetLocation(51, 4, 1);
FindResults nearby = loc.FindNearby(5);
foreach (object o in nearby) {
loc = o as Location;
if (loc != null && loc.StreetAddress != null && loc.StreetAddress.PostalCode != "")
Console.WriteLine(loc.StreetAddress.PostalCode);
}
}
FindNearby does not find always a postcode. This is because it is designed to search for points of interest which does not nececary have a postal code. Another way is scan the map in code with a vector until you have a postal code.