-
Notifications
You must be signed in to change notification settings - Fork 156
/
Copy pathGoogleAddress.cs
72 lines (61 loc) · 1.55 KB
/
GoogleAddress.cs
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
using System;
using System.Linq;
namespace Geocoding.Google
{
public class GoogleAddress : Address
{
readonly GoogleAddressType type;
readonly GoogleLocationType locationType;
readonly GoogleAddressComponent[] components;
readonly bool isPartialMatch;
readonly GoogleViewport viewport;
readonly Bounds bounds;
readonly string placeId;
public GoogleAddressType Type
{
get { return type; }
}
public GoogleLocationType LocationType
{
get { return locationType; }
}
public GoogleAddressComponent[] Components
{
get { return components; }
}
public bool IsPartialMatch
{
get { return isPartialMatch; }
}
public GoogleViewport Viewport
{
get { return viewport; }
}
public Bounds Bounds
{
get { return bounds; }
}
public string PlaceId
{
get { return placeId; }
}
public GoogleAddressComponent this[GoogleAddressType type]
{
get { return Components.FirstOrDefault(c => c.Types.Contains(type)); }
}
public GoogleAddress(GoogleAddressType type, string formattedAddress, GoogleAddressComponent[] components,
Location coordinates, GoogleViewport viewport, Bounds bounds, bool isPartialMatch, GoogleLocationType locationType, string placeId)
: base(formattedAddress, coordinates, "Google")
{
if (components == null)
throw new ArgumentNullException("components");
this.type = type;
this.components = components;
this.isPartialMatch = isPartialMatch;
this.viewport = viewport;
this.bounds = bounds;
this.locationType = locationType;
this.placeId = placeId;
}
}
}