diff --git a/CHANGELOG.md b/CHANGELOG.md index 863458b10..8ae47e89d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ Guide: https://keepachangelog.com/en/1.0.0/ - [Offline] Added OfflineIndexObserver which accepts two blocks for indexChanged or error events. This can be assigned to the offline search engine to receive state updates. +- [Offline] Change default tileset name to `mbx-main` +- [Tests] Fix Offline tests and re-enable. +- [Tests] Add `offlineResultsUpdated` delegate function to `SearchEngineDelegateStub`. +- [Tests] Demonstrate providing a `Geometry(point: NSValue(mkCoordinate: CLLocationCoordinate2D))` with `TileRegionLoadOptions.build` function. +- [Core] Increment minimum MapboxCommon version from 24.0.0 to 24.2.0. + +**MapboxCommon**: v24.2.0 + ## 2.0.0-rc.3 - [Core] Add `SearchResultAccuracy.proximate` case which "is a known address point but does not intersect a known rooftop/parcel." diff --git a/Cartfile b/Cartfile index f4021b2b4..530d47dbc 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ binary "https://api.mapbox.com/downloads/v2/carthage/search-core-sdk/MapboxCoreSearch.xcframework.json" == 2.0.0-alpha.14 -binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" == 24.0.0 +binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" == 24.2.0 \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved index a1c6204fe..0cf38f59e 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "24.0.0" +binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "24.2.0" binary "https://api.mapbox.com/downloads/v2/carthage/search-core-sdk/MapboxCoreSearch.xcframework.json" "2.0.0-alpha.14" diff --git a/Package.swift b/Package.swift index c2df3da6a..e36ab2f8c 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import Foundation let (coreSearchVersion, coreSearchVersionHash) = ("2.0.0-alpha.14", "c3e61341f2beb1b8043f3c71caccdd9bea12a23f221cb90eb452e2abe299c3e0") -let commonMinVersion = Version("24.0.0") +let commonMinVersion = Version("24.2.0") let commonMaxVersion = Version("25.0.0") let package = Package( diff --git a/Sources/Demo/MapRootController.swift b/Sources/Demo/MapRootController.swift index 1ab8c2a86..38d191188 100644 --- a/Sources/Demo/MapRootController.swift +++ b/Sources/Demo/MapRootController.swift @@ -31,7 +31,12 @@ class MapRootController: UIViewController { engine.setOfflineMode(.enabled) { let descriptor = SearchOfflineManager.createDefaultTilesetDescriptor() - let dcLocation = NSValue(cgPoint: CGPoint(x: 38.89992081005698, y: -77.03399849939174)) + + let dcLocation = NSValue(mkCoordinate: CLLocationCoordinate2D( + latitude: 38.89992081005698, + longitude: -77.03399849939174 + )) + guard let options = MapboxCommon.TileRegionLoadOptions.build( geometry: Geometry(point: dcLocation), descriptors: [descriptor], diff --git a/Sources/MapboxSearch/PublicAPI/Offline/SearchOfflineManager.swift b/Sources/MapboxSearch/PublicAPI/Offline/SearchOfflineManager.swift index 81353e648..cf8a898cc 100644 --- a/Sources/MapboxSearch/PublicAPI/Offline/SearchOfflineManager.swift +++ b/Sources/MapboxSearch/PublicAPI/Offline/SearchOfflineManager.swift @@ -2,7 +2,7 @@ import Foundation /// OfflineManager handles `TileStore`s and responsible for creating Search `TilsetDescriptor`s public class SearchOfflineManager { - static let defaultDatasetName = "test-dataset" + static let defaultDatasetName = "mbx-main" var engine: CoreSearchEngineProtocol diff --git a/Tests/Demo.xctestplan b/Tests/Demo.xctestplan index 4adbfc008..7dcacae8b 100644 --- a/Tests/Demo.xctestplan +++ b/Tests/Demo.xctestplan @@ -35,8 +35,7 @@ "testTargets" : [ { "skippedTests" : [ - "MockServerIntegrationTestCase", - "OfflineIntegrationTests" + "MockServerIntegrationTestCase" ], "target" : { "containerPath" : "container:MapboxSearch.xcodeproj", diff --git a/Tests/MapboxSearchIntegrationTests/OfflineIntegrationTests.swift b/Tests/MapboxSearchIntegrationTests/OfflineIntegrationTests.swift index 1f836bf6c..200916951 100644 --- a/Tests/MapboxSearchIntegrationTests/OfflineIntegrationTests.swift +++ b/Tests/MapboxSearchIntegrationTests/OfflineIntegrationTests.swift @@ -6,14 +6,16 @@ import MapboxCommon @testable import MapboxSearch import XCTest -class OfflineIntegrationTests: MockServerIntegrationTestCase { +/// Note: ``OfflineIntegrationTests`` does not use Mocked data. +class OfflineIntegrationTests: MockServerIntegrationTestCase { let delegate = SearchEngineDelegateStub() let searchEngine = SearchEngine() - let dataset = "test-dataset" - let dcLocation = CGPoint(x: 38.89992081005698, y: -77.03399849939174) + let dcLocation = CLLocationCoordinate2D(latitude: 38.89992081005698, longitude: -77.03399849939174) let regionId = "dc" + // MARK: - Helpers and set up + override func setUpWithError() throws { try super.setUpWithError() @@ -36,13 +38,15 @@ class OfflineIntegrationTests: MockServerIntegrationTestCase) -> Void) -> SearchCancelable { + /// This will use the default dataset defined at ``SearchOfflineManager.defaultDatasetName`` let descriptor = SearchOfflineManager.createDefaultTilesetDescriptor() - let dcLocationValue = NSValue(cgPoint: dcLocation) + let dcLocationValue = NSValue(mkCoordinate: dcLocation) let options = MapboxCommon.TileRegionLoadOptions.build( geometry: Geometry(point: dcLocationValue), descriptors: [descriptor], acceptExpired: true )! + let cancelable = searchEngine.offlineManager.tileStore.loadTileRegion(id: regionId, options: options) { _ in } completion: { result in completion(result) @@ -54,6 +58,8 @@ class OfflineIntegrationTests: MockServerIntegrationTestCase