Not saying it's right, but this is pretty standard practice -- it's likely mentioned in their privacy policy somewhere.
edit: I asked Bard about this, and it told me that websites can get the approx. location of their visitors via the Google Geolocation API:
> To use the Google Geolocation API, a website must first obtain a Google Maps API key. Once they have a key, they can add the following code to their website:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script>
<script>
function getGeolocation() {
var location = navigator.geolocation.getCurrentPosition();
if (location) {
var lat = location.latitude;
var lng = location.longitude;
// Do something with the location information.
}
}
</script>