Repository navigation
Expand file tree
/
Copy pathOpenGeocodingAddress.php
More file actions
87 lines (67 loc) · 1.76 KB
/
Copy pathOpenGeocodingAddress.php
File metadata and controls
87 lines (67 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
declare(strict_types=1);
/*
* This file is part of the OpenGeocoding provider for Geocoder PHP.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
namespace Geocoder\Provider\OpenGeocoding\Model;
use Geocoder\Model\Address;
final class OpenGeocodingAddress extends Address
{
private ?string $displayName = null;
private bool $goodMatch = false;
private ?float $distance = null;
private ?string $layer = null;
public function getDisplayName(): ?string
{
return $this->displayName;
}
public function withDisplayName(?string $displayName): self
{
$new = clone $this;
$new->displayName = $displayName;
return $new;
}
/**
* False for a partial match, such as the street when the house number was not found.
*/
public function isGoodMatch(): bool
{
return $this->goodMatch;
}
public function withGoodMatch(bool $goodMatch): self
{
$new = clone $this;
$new->goodMatch = $goodMatch;
return $new;
}
/**
* Distance in metres from the queried point; reverse geocoding only.
*/
public function getDistance(): ?float
{
return $this->distance;
}
public function withDistance(?float $distance): self
{
$new = clone $this;
$new->distance = $distance;
return $new;
}
/**
* Reverse geocoding only: "address", "street" or "locality".
*/
public function getLayer(): ?string
{
return $this->layer;
}
public function withLayer(?string $layer): self
{
$new = clone $this;
$new->layer = $layer;
return $new;
}
}