During a glorious summer in Edinburgh , spent researching the Ordnance Survey 's precursor - a Military Survey of Scotland , conducted in the wake of the 1745 Rebellion - an old map came to light in the archives of the illustrious Dundas dynasty , at their Midlothian mansion .