@Override
    public GeoLocationResponse locate(final Double latitude, final Double longitude) {
        if (latitude == null || longitude == null) {
            LOGGER.debug("latitude/longitude must not be null in order for geolocation to proceed");
            return null;
        }

        val r = new GeoLocationResponse();
        r.setLatitude(latitude);
        r.setLongitude(longitude);

        val latlng = new LatLng(latitude, longitude);
        try {
            val results = reverseGeocode(latlng);
            if (results != null && results.length > 0) {
                Arrays.stream(results)
                    .map(result -> result.formattedAddress)
                    .forEach(r::addAddress);
                return r;
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return r;
    }
This is {@link GoogleMapsGeoLocationService}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-geolocation-googlemaps/src/main/java/org/apereo/cas/support/geo/google/GoogleMapsGeoLocationService.java