You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MapboxGeocoder/MBGeocodeOptions.swift
+17-4Lines changed: 17 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ public class GeocodeOptions: NSObject {
26
26
publicvarallowedISOCountryCodes:[String]?
27
27
28
28
/**
29
-
A loation to use as a hint when looking up the specified address.
29
+
A location to use as a hint when looking up the specified address.
30
30
31
31
This property prioritizes results that are close to a specific location, which is typically the user’s current location. If the value of this property is `nil` – which it is by default – no specific location is prioritized.
32
32
*/
@@ -46,6 +46,11 @@ public class GeocodeOptions: NSObject {
46
46
*/
47
47
publicvarallowedRegion:RectangularRegion?
48
48
49
+
/**
50
+
Limit the number of results returned. The default is `5` for forward geocoding and `1` for reverse geocoding.
51
+
*/
52
+
publicvarmaximumResultCount:UInt
53
+
49
54
// MARK: Specifying the Output Format
50
55
51
56
/**
@@ -59,7 +64,10 @@ public class GeocodeOptions: NSObject {
59
64
*/
60
65
publicvarlocale:NSLocale?
61
66
62
-
privateoverrideinit(){}
67
+
privateoverrideinit(){
68
+
self.maximumResultCount =0
69
+
super.init()
70
+
}
63
71
64
72
/**
65
73
An array of geocoding query strings to include in the request URL.
@@ -87,6 +95,9 @@ public class GeocodeOptions: NSObject {
@@ -105,10 +116,11 @@ public class ForwardGeocodeOptions: GeocodeOptions {
105
116
If true, a resulting placemark’s name may contain a word that begins with the query string. If false, the query string must match a whole word or phrase in the placemark’s name. The default value of this property is true, which is best suited for continuous search fields.
106
117
*/
107
118
publicvarautocompletesQuery=true
108
-
119
+
109
120
privateinit(queries:[String]){
110
121
super.init()
111
122
self.queries = queries
123
+
self.maximumResultCount =5
112
124
}
113
125
114
126
/**
@@ -151,10 +163,11 @@ public class ReverseGeocodeOptions: GeocodeOptions {
0 commit comments