The city of Ayla was a Nabataean port on the Red Sea, connected
to the city of Petra which was 98 km inland. Under Roman times
there was a Roman military presence there. In Mamluk and Ottoman
times it was a resting place for pilgrims. The original ground
plan of the mosque may have been pre-Umayyad or early Umayyad,
and contained a well-carved arched gateway with arches around
a large enclosure. The town is a combination of a late Byzantine
city and the new Muslims attitudes towards urbanism.
In the photo above, you can see the large fortification with
the mosque in the top right corner. The Qibla wall has been badly
damaged so exact measurement has been difficult.