Skip to content

Commit

Permalink
Adding Lat and Long fetch to DawaAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
stankut committed Mar 8, 2024
1 parent bb6b90b commit 82fac04
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- Adding Lat and Long fetching to DataAddress

- CprFetchData adding ajax error fix

## [3.14.0]
Expand Down
36 changes: 36 additions & 0 deletions modules/os2forms_dawa/src/Entity/DawaAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ class DawaAddress {
*/
protected $propertyNumber;

/**
* Latitude of the address.
*
* @var float
*/
protected $latitude;

/**
* Longitude of the address.
*
* @var float
*/
protected $longitude;

/**
* DawaAddress constructor.
*
Expand All @@ -45,6 +59,8 @@ public function __construct(array $json) {
if (isset($json['adgangsadresse']) && is_array($json['adgangsadresse'])) {
$this->municipalityCode = $json['adgangsadresse']['kommune']['kode'];
$this->propertyNumber = $json['adgangsadresse']['esrejendomsnr'];
$this->longitude = $json['adgangsadresse']['adgangspunkt']['koordinater'][0];
$this->latitude = $json['adgangsadresse']['adgangspunkt']['koordinater'][1];
}
}

Expand Down Expand Up @@ -78,4 +94,24 @@ public function getPropertyNumber() {
return $this->propertyNumber;
}

/**
* Gets latitude.
*
* @return float
* property latitude.
*/
public function getLatitude() {
return $this->latitude;
}

/**
* Gets longitude.
*
* @return float
* property longitude.
*/
public function getLongitude() {
return $this->longitude;
}

}

0 comments on commit 82fac04

Please sign in to comment.