Many animals learn to follow habitual routes between important locations, but how they encode their routes is still largely unknown. Desert ants traveling between their nest and a food site develop stable, visually guided routes that can wind through desert scrub without the use of trail pheromones. Their route memories are sufficiently robust that if a nest-bound ant is caught at the end of its route and replaced somewhere earlier along it, the ant will recapitulate the route from the release site. Insects appear to use panoramas to recognize when they are on a familiar route. I examine here the cues then used for their guidance. Several mechanisms are known for straight segments of a route; but how does an ant encode a curved route along which both the views it sees, and the directions it takes, are constantly changing? The results here suggest that when an ant travels past a landmark on a familiar route, it uses the gradually changing direction of the landmark to trigger a set of associated learned heading directions. A route through a complex 2D environment could thus be encoded and followed economically if it is divided into panorama-defined segments, with each segment controlled by such a 1D mapping. The solution proposed for the ants would be simple to implement in an autonomous robot.