Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/gitdedalo/v6.4.0_beta' int…
Browse files Browse the repository at this point in the history
…o v6.4.0_beta
  • Loading branch information
Paco committed Jan 23, 2025
2 parents 5d98b41 + 81991be commit 59fe8a7
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions core/component_geolocation/class.component_geolocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,60 @@ public function regenerate_component() : bool {



/**
* GET_LATITUDE
* Get the latitude of the component, if the data has the default data, return null
* @return float $latitude
*/
public function get_latitude() : ?float {

$dato = $this->get_dato();
if (empty($dato) || empty($dato[0]) ) {
return null;
}

$dato = $dato[0];
$data_latitude = $dato->lat ?? null;

if(empty($data_latitude)){
return null;
}
$latitude = strval($data_latitude)==='39.462571'
? null
: floatval($data_latitude);

return $latitude;
}//end get_latitude



/**
* GET_LONGITUDE
* Get the longitude of the component, if the data has the default data, return null
* @return float $longitude
*/
public function get_longitude() : ?float {

$dato = $this->get_dato();
if (empty($dato) || empty($dato[0]) ) {
return null;
}

$dato = $dato[0];
$data_longitude = $dato->long ?? null;

if(empty($data_longitude)){
return null;
}
$longitude = strval($data_longitude)==='-0.376295'
? null
: floatval($data_longitude);

return $longitude;
}//end get_longitude



/**
* GET_DIFFUSION_VALUE_SOCRATA
* Calculate current component diffusion value for target field in socrata
Expand Down

0 comments on commit 59fe8a7

Please sign in to comment.