Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix batch geocoding request handling #148

Merged
merged 17 commits into from
Jul 12, 2018
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions MapboxGeocoder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,42 @@
objects = {

/* Begin PBXBuildFile section */
0711239320E59DEA0043CB51 /* permanent_forward_single_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 0711239220E59DE90043CB51 /* permanent_forward_single_valid.json */; };
0711239420E59DEA0043CB51 /* permanent_forward_single_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 0711239220E59DE90043CB51 /* permanent_forward_single_valid.json */; };
0711239520E59DEA0043CB51 /* permanent_forward_single_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 0711239220E59DE90043CB51 /* permanent_forward_single_valid.json */; };
0711239F20E5A53E0043CB51 /* permanent_forward_multiple_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 0711239E20E5A53E0043CB51 /* permanent_forward_multiple_valid.json */; };
071123A020E5A53E0043CB51 /* permanent_forward_multiple_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 0711239E20E5A53E0043CB51 /* permanent_forward_multiple_valid.json */; };
071123A120E5A53E0043CB51 /* permanent_forward_multiple_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 0711239E20E5A53E0043CB51 /* permanent_forward_multiple_valid.json */; };
071123A320E6EC800043CB51 /* permanent_forward_multiple_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 071123A220E6EC7F0043CB51 /* permanent_forward_multiple_no_results.json */; };
071123A420E6EC800043CB51 /* permanent_forward_multiple_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 071123A220E6EC7F0043CB51 /* permanent_forward_multiple_no_results.json */; };
071123A520E6EC800043CB51 /* permanent_forward_multiple_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 071123A220E6EC7F0043CB51 /* permanent_forward_multiple_no_results.json */; };
071123A720E6EC890043CB51 /* permanent_forward_single_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 071123A620E6EC880043CB51 /* permanent_forward_single_no_results.json */; };
071123A820E6EC890043CB51 /* permanent_forward_single_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 071123A620E6EC880043CB51 /* permanent_forward_single_no_results.json */; };
071123A920E6EC890043CB51 /* permanent_forward_single_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 071123A620E6EC880043CB51 /* permanent_forward_single_no_results.json */; };
079F41E820E42EEF007EEB5E /* BatchGeocodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 079F41E720E42EEF007EEB5E /* BatchGeocodingTests.swift */; };
079F41E920E42EEF007EEB5E /* BatchGeocodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 079F41E720E42EEF007EEB5E /* BatchGeocodingTests.swift */; };
079F41EA20E42EEF007EEB5E /* BatchGeocodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 079F41E720E42EEF007EEB5E /* BatchGeocodingTests.swift */; };
07CF858220EC60B8007B26B6 /* permanent_invalid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858120EC60B8007B26B6 /* permanent_invalid.json */; };
07CF858320EC60B8007B26B6 /* permanent_invalid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858120EC60B8007B26B6 /* permanent_invalid.json */; };
07CF858420EC60B8007B26B6 /* permanent_invalid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858120EC60B8007B26B6 /* permanent_invalid.json */; };
07CF858620EC6382007B26B6 /* permanent_invalid_token.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858520EC6382007B26B6 /* permanent_invalid_token.json */; };
07CF858720EC6382007B26B6 /* permanent_invalid_token.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858520EC6382007B26B6 /* permanent_invalid_token.json */; };
07CF858820EC6382007B26B6 /* permanent_invalid_token.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858520EC6382007B26B6 /* permanent_invalid_token.json */; };
07CF858A20EC647F007B26B6 /* permanent_invalid_token_scope.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858920EC647F007B26B6 /* permanent_invalid_token_scope.json */; };
07CF858B20EC647F007B26B6 /* permanent_invalid_token_scope.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858920EC647F007B26B6 /* permanent_invalid_token_scope.json */; };
07CF858C20EC647F007B26B6 /* permanent_invalid_token_scope.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858920EC647F007B26B6 /* permanent_invalid_token_scope.json */; };
07CF858E20EEB626007B26B6 /* permanent_reverse_single_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858D20EEB625007B26B6 /* permanent_reverse_single_valid.json */; };
07CF858F20EEB626007B26B6 /* permanent_reverse_single_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858D20EEB625007B26B6 /* permanent_reverse_single_valid.json */; };
07CF859020EEB626007B26B6 /* permanent_reverse_single_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF858D20EEB625007B26B6 /* permanent_reverse_single_valid.json */; };
07CF859220EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859120EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json */; };
07CF859320EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859120EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json */; };
07CF859420EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859120EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json */; };
07CF859620EEC0E4007B26B6 /* permanent_reverse_single_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859520EEC0E3007B26B6 /* permanent_reverse_single_no_results.json */; };
07CF859720EEC0E4007B26B6 /* permanent_reverse_single_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859520EEC0E3007B26B6 /* permanent_reverse_single_no_results.json */; };
07CF859820EEC0E4007B26B6 /* permanent_reverse_single_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859520EEC0E3007B26B6 /* permanent_reverse_single_no_results.json */; };
07CF859A20EECE90007B26B6 /* permanent_reverse_multiple_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859920EECE8F007B26B6 /* permanent_reverse_multiple_no_results.json */; };
07CF859B20EECE90007B26B6 /* permanent_reverse_multiple_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859920EECE8F007B26B6 /* permanent_reverse_multiple_no_results.json */; };
07CF859C20EECE90007B26B6 /* permanent_reverse_multiple_no_results.json in Resources */ = {isa = PBXBuildFile; fileRef = 07CF859920EECE8F007B26B6 /* permanent_reverse_multiple_no_results.json */; };
35506B8B200F856400629509 /* BridgingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 35506B8A200F856400629509 /* BridgingTests.m */; };
35506B8C200F856400629509 /* BridgingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 35506B8A200F856400629509 /* BridgingTests.m */; };
35506B8D200F856400629509 /* BridgingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 35506B8A200F856400629509 /* BridgingTests.m */; };
Expand Down Expand Up @@ -170,6 +206,18 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0711239220E59DE90043CB51 /* permanent_forward_single_valid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_forward_single_valid.json; path = ../../../../.Trash/permanent_forward_single_valid.json; sourceTree = "<group>"; };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is located in the Trash on your Mac, which Bitrise has no access to.

0711239E20E5A53E0043CB51 /* permanent_forward_multiple_valid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_forward_multiple_valid.json; path = ../../../../Desktop/permanent_forward_multiple_valid.json; sourceTree = "<group>"; };
071123A220E6EC7F0043CB51 /* permanent_forward_multiple_no_results.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_forward_multiple_no_results.json; path = ../../../../Desktop/permanent_forward_multiple_no_results.json; sourceTree = "<group>"; };
071123A620E6EC880043CB51 /* permanent_forward_single_no_results.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_forward_single_no_results.json; path = ../../../../Desktop/permanent_forward_single_no_results.json; sourceTree = "<group>"; };
079F41E720E42EEF007EEB5E /* BatchGeocodingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatchGeocodingTests.swift; sourceTree = "<group>"; };
07CF858120EC60B8007B26B6 /* permanent_invalid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_invalid.json; path = ../../../../Desktop/permanent_invalid.json; sourceTree = "<group>"; };
07CF858520EC6382007B26B6 /* permanent_invalid_token.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_invalid_token.json; path = ../../../../Desktop/permanent_invalid_token.json; sourceTree = "<group>"; };
07CF858920EC647F007B26B6 /* permanent_invalid_token_scope.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_invalid_token_scope.json; path = ../../../../Desktop/permanent_invalid_token_scope.json; sourceTree = "<group>"; };
07CF858D20EEB625007B26B6 /* permanent_reverse_single_valid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_reverse_single_valid.json; path = ../../../../Desktop/permanent_reverse_single_valid.json; sourceTree = "<group>"; };
07CF859120EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_reverse_multiple_valid.json; path = ../../../../Desktop/permanent_reverse_multiple_valid.json; sourceTree = "<group>"; };
07CF859520EEC0E3007B26B6 /* permanent_reverse_single_no_results.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_reverse_single_no_results.json; path = ../../../../Desktop/permanent_reverse_single_no_results.json; sourceTree = "<group>"; };
07CF859920EECE8F007B26B6 /* permanent_reverse_multiple_no_results.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = permanent_reverse_multiple_no_results.json; path = ../../../../Desktop/permanent_reverse_multiple_no_results.json; sourceTree = "<group>"; };
35506B8A200F856400629509 /* BridgingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BridgingTests.m; sourceTree = "<group>"; };
357B4357202CC90A00735521 /* reverse_address.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = reverse_address.json; sourceTree = "<group>"; };
DA1AC0211E5C23B8006DF1D6 /* Contacts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Contacts.framework; path = System/Library/Frameworks/Contacts.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -402,6 +450,7 @@
DDF1E84B1BD6F7BA00C40C78 /* MapboxGeocoderTests */ = {
isa = PBXGroup;
children = (
079F41E720E42EEF007EEB5E /* BatchGeocodingTests.swift */,
DA701C001CB1292C00B0E520 /* GeocoderTests.swift */,
DA210BAA1CB4BE73008088FD /* ForwardGeocodingTests.swift */,
DDF1E84C1BD6F7BA00C40C78 /* ReverseGeocodingTests.swift */,
Expand All @@ -416,6 +465,17 @@
DDF1E8571BD700EB00C40C78 /* Fixtures */ = {
isa = PBXGroup;
children = (
07CF858920EC647F007B26B6 /* permanent_invalid_token_scope.json */,
07CF858520EC6382007B26B6 /* permanent_invalid_token.json */,
07CF858120EC60B8007B26B6 /* permanent_invalid.json */,
071123A620E6EC880043CB51 /* permanent_forward_single_no_results.json */,
071123A220E6EC7F0043CB51 /* permanent_forward_multiple_no_results.json */,
0711239E20E5A53E0043CB51 /* permanent_forward_multiple_valid.json */,
0711239220E59DE90043CB51 /* permanent_forward_single_valid.json */,
07CF858D20EEB625007B26B6 /* permanent_reverse_single_valid.json */,
07CF859120EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json */,
07CF859520EEC0E3007B26B6 /* permanent_reverse_single_no_results.json */,
07CF859920EECE8F007B26B6 /* permanent_reverse_multiple_no_results.json */,
DA210BAC1CB4BFF7008088FD /* forward_valid.json */,
DA58D8A01DB2ADDD00530CBB /* forward_valid_zh.json */,
DA210BAE1CB4C5A7008088FD /* forward_invalid.json */,
Expand Down Expand Up @@ -726,11 +786,22 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
07CF858720EC6382007B26B6 /* permanent_invalid_token.json in Resources */,
07CF859B20EECE90007B26B6 /* permanent_reverse_multiple_no_results.json in Resources */,
07CF859320EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json in Resources */,
071123A820E6EC890043CB51 /* permanent_forward_single_no_results.json in Resources */,
07CF859720EEC0E4007B26B6 /* permanent_reverse_single_no_results.json in Resources */,
071123A420E6EC800043CB51 /* permanent_forward_multiple_no_results.json in Resources */,
DA5170B81CF1B1F900CD6DCF /* forward_valid.json in Resources */,
357B4359202CC90A00735521 /* reverse_address.json in Resources */,
DA5170B91CF1B1F900CD6DCF /* forward_invalid.json in Resources */,
DA5170BB1CF1B1F900CD6DCF /* reverse_invalid.json in Resources */,
DA5170BA1CF1B1F900CD6DCF /* reverse_valid.json in Resources */,
07CF858B20EC647F007B26B6 /* permanent_invalid_token_scope.json in Resources */,
071123A020E5A53E0043CB51 /* permanent_forward_multiple_valid.json in Resources */,
07CF858F20EEB626007B26B6 /* permanent_reverse_single_valid.json in Resources */,
07CF858320EC60B8007B26B6 /* permanent_invalid.json in Resources */,
0711239420E59DEA0043CB51 /* permanent_forward_single_valid.json in Resources */,
DA58D8A21DB2ADDD00530CBB /* forward_valid_zh.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -746,11 +817,22 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
07CF858820EC6382007B26B6 /* permanent_invalid_token.json in Resources */,
07CF859C20EECE90007B26B6 /* permanent_reverse_multiple_no_results.json in Resources */,
07CF859420EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json in Resources */,
071123A920E6EC890043CB51 /* permanent_forward_single_no_results.json in Resources */,
07CF859820EEC0E4007B26B6 /* permanent_reverse_single_no_results.json in Resources */,
071123A520E6EC800043CB51 /* permanent_forward_multiple_no_results.json in Resources */,
DA5170E21CF2542B00CD6DCF /* forward_valid.json in Resources */,
357B435A202CC90A00735521 /* reverse_address.json in Resources */,
DA5170E31CF2542B00CD6DCF /* forward_invalid.json in Resources */,
DA5170E51CF2542B00CD6DCF /* reverse_invalid.json in Resources */,
DA5170E41CF2542B00CD6DCF /* reverse_valid.json in Resources */,
07CF858C20EC647F007B26B6 /* permanent_invalid_token_scope.json in Resources */,
071123A120E5A53E0043CB51 /* permanent_forward_multiple_valid.json in Resources */,
07CF859020EEB626007B26B6 /* permanent_reverse_single_valid.json in Resources */,
07CF858420EC60B8007B26B6 /* permanent_invalid.json in Resources */,
0711239520E59DEA0043CB51 /* permanent_forward_single_valid.json in Resources */,
DA58D8A31DB2ADDD00530CBB /* forward_valid_zh.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -789,11 +871,22 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
07CF858620EC6382007B26B6 /* permanent_invalid_token.json in Resources */,
07CF859A20EECE90007B26B6 /* permanent_reverse_multiple_no_results.json in Resources */,
07CF859220EEBF2F007B26B6 /* permanent_reverse_multiple_valid.json in Resources */,
071123A720E6EC890043CB51 /* permanent_forward_single_no_results.json in Resources */,
07CF859620EEC0E4007B26B6 /* permanent_reverse_single_no_results.json in Resources */,
071123A320E6EC800043CB51 /* permanent_forward_multiple_no_results.json in Resources */,
DA210BAD1CB4BFF7008088FD /* forward_valid.json in Resources */,
357B4358202CC90A00735521 /* reverse_address.json in Resources */,
DDF1E85C1BD70E4C00C40C78 /* reverse_invalid.json in Resources */,
DDF1E85D1BD70E4C00C40C78 /* reverse_valid.json in Resources */,
DA210BAF1CB4C5A7008088FD /* forward_invalid.json in Resources */,
07CF858A20EC647F007B26B6 /* permanent_invalid_token_scope.json in Resources */,
0711239F20E5A53E0043CB51 /* permanent_forward_multiple_valid.json in Resources */,
07CF858E20EEB626007B26B6 /* permanent_reverse_single_valid.json in Resources */,
07CF858220EC60B8007B26B6 /* permanent_invalid.json in Resources */,
0711239320E59DEA0043CB51 /* permanent_forward_single_valid.json in Resources */,
DA58D8A11DB2ADDD00530CBB /* forward_valid_zh.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -885,6 +978,7 @@
DA5170B61CF1B1EF00CD6DCF /* ReverseGeocodingTests.swift in Sources */,
DA4D90081DD63AEC006EC71A /* PlacemarkScopeTests.swift in Sources */,
DA5170B41CF1B1EF00CD6DCF /* GeocoderTests.swift in Sources */,
079F41E920E42EEF007EEB5E /* BatchGeocodingTests.swift in Sources */,
DA5170B51CF1B1EF00CD6DCF /* ForwardGeocodingTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -909,6 +1003,7 @@
DA5170E11CF2542800CD6DCF /* ReverseGeocodingTests.swift in Sources */,
DA4D90091DD63AEC006EC71A /* PlacemarkScopeTests.swift in Sources */,
DA5170DF1CF2542800CD6DCF /* GeocoderTests.swift in Sources */,
079F41EA20E42EEF007EEB5E /* BatchGeocodingTests.swift in Sources */,
DA5170E01CF2542800CD6DCF /* ForwardGeocodingTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -964,6 +1059,7 @@
DDF1E84D1BD6F7BA00C40C78 /* ReverseGeocodingTests.swift in Sources */,
DA4D90071DD63AEC006EC71A /* PlacemarkScopeTests.swift in Sources */,
DA210BAB1CB4BE73008088FD /* ForwardGeocodingTests.swift in Sources */,
079F41E820E42EEF007EEB5E /* BatchGeocodingTests.swift in Sources */,
DA701C011CB1292C00B0E520 /* GeocoderTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
8 changes: 8 additions & 0 deletions MapboxGeocoder/MBGeocodeOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ open class GeocodeOptions: NSObject {
*/
internal var queries: [String] = []

/**
The query mode of the forward or reverse geocoding request.
*/
internal var mode = "mapbox.places"

/**
An array of URL parameters to include in the request URL.
*/
Expand Down Expand Up @@ -221,6 +226,7 @@ open class ForwardBatchGeocodeOptions: ForwardGeocodeOptions, BatchGeocodeOption
*/
@objc public override init(queries: [String]) {
super.init(queries: queries)
mode = "mapbox.places-permanent"
}
}

Expand All @@ -236,6 +242,7 @@ open class ReverseBatchGeocodeOptions: ReverseGeocodeOptions, BatchGeocodeOption
*/
@objc public override init(coordinates: [CLLocationCoordinate2D]) {
super.init(coordinates: coordinates)
mode = "mapbox.places-permanent"
}

/**
Expand All @@ -245,5 +252,6 @@ open class ReverseBatchGeocodeOptions: ReverseGeocodeOptions, BatchGeocodeOption
*/
@objc public convenience init(locations: [CLLocation]) {
self.init(coordinates: locations.map { $0.coordinate })
mode = "mapbox.places-permanent"
}
}
Loading