function _ip_geoloc_reinit_location in IP Geolocation Views & Maps 8
Same name and namespace in other branches
- 7 ip_geoloc.module \_ip_geoloc_reinit_location()
Reinitialises the supplied location array.
File
- ./
ip_geoloc.module, line 310 - IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported and available through this module. Using a number of optional sources IPGV&M also retrieves…
Code
function _ip_geoloc_reinit_location(array &$location, $reverse_geocode_client_timeout) {
$location = [
'fixed_address' => isset($location['fixed_address']) ? (int) $location['fixed_address'] : NULL,
'regions' => isset($location['regions']) ? $location['regions'] : NULL,
];
// Calls below are synchronous, $location is filled upon return.
if (ip_geoloc_use_smart_ip_if_enabled($location) || ip_geoloc_use_geoip_api_if_enabled($location)) {
if ($reverse_geocode_client_timeout) {
watchdog('IPGV&M', 'Location timeout (waited %sec s). Fallback: %address.', [
'%sec' => number_format($reverse_geocode_client_timeout, 1),
'%address' => isset($location['formatted_address']) ? $location['formatted_address'] : '',
], WATCHDOG_NOTICE);
}
}
else {
ip_geoloc_debug(t('Smart IP and GeoIP API fallbacks NOT enabled.'));
}
}