We may turn a camera as needed, also we have compass, accelerometer, gyroscope and maybe an analog zoom.
https://www.amazon.com/Longitude-Genius-Greatest-Scientific-...
https://en.wikipedia.org/wiki/Longitude_(book)
For a teaser on John Harrison's chronometer and celestial navigation:
https://wornandwound.com/history-of-chronometers-pt-1-origin...
This calculation needs to be adjusted for hemisphere and high altitudes - see, e.g. here: https://astronavigationdemystified.com/latitude-from-the-mid...
Here is the calculation for the sun’s declination. I’m sure you can find more accurate formulae. https://sinovoltaics.com/learning-center/basics/declination-...
def sun_angle(mon,day,hour,min,sec,lat,lon):
import astropy.coordinates as coord
from astropy.time import Time
import astropy.units as u
loc = coord.EarthLocation(lon=lon * u.deg, lat=lat * u.deg)
times = f'2022-{mon}-{day}T{hour}:{min}:{sec}'
now = Time(times, format='isot', scale='utc')
altaz = coord.AltAz(location=loc, obstime=now)
sun = coord.get_sun(now).transform_to(altaz).alt
return sun.degree
https://youtu.be/vw9zyxm860Q I think describes this event
Given the presence of an internet connection, I think it’s easiest to query a time server at midday (detected by detecting the time when the sun is highest above the horizon/shadows are shortest) to get longitude.
(Latitude is relatively simple; one can, for example, use a sextant to measure the height of the pole star above the horizon)
There are a few projects which marry cheap zoom lenses with smartphones (e.g. https://www.instructables.com/ISextant-Project/) to overcome this.
You may also be interested in this app which compares GPS positioning with sextant altitude allowing you easily detect errors with either: http://reednavigation.com/GPSAntiSpoof/
Sunset is a prayer time in Islam, so sunset times in most cities in the world is accurately calculated. Sunrise too. The window for a sunrise and sunset is about 5 min, which should give you decent accuracy.
You still need latitude though.
The time of local solar noon will give you the longitude.
The altitude or the sun (you could use the gyroscope here, or just use a protractor) will allow you to calculate latitude.
The internet connection will allow you to find out how to calculate it.