From 82fac041de89a3dc3cbda84a7e7744eab294cb79 Mon Sep 17 00:00:00 2001 From: Stanislav Kutasevits Date: Fri, 8 Mar 2024 12:51:43 +0200 Subject: [PATCH] Adding Lat and Long fetch to DawaAddress --- CHANGELOG.md | 2 ++ .../os2forms_dawa/src/Entity/DawaAddress.php | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d63471c..68fbaf0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/modules/os2forms_dawa/src/Entity/DawaAddress.php b/modules/os2forms_dawa/src/Entity/DawaAddress.php index db09efed..723dde3e 100644 --- a/modules/os2forms_dawa/src/Entity/DawaAddress.php +++ b/modules/os2forms_dawa/src/Entity/DawaAddress.php @@ -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. * @@ -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]; } } @@ -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; + } + }