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 ev charging station canonical #161

Merged
merged 2 commits into from
Jan 26, 2024
Merged

Conversation

aokj4ck
Copy link
Contributor

@aokj4ck aokj4ck commented Jan 25, 2024

Description

Steps to reproduce

  1. Change the CategorySearchEngine initializer in MapboxSearchController to use SBS
  2. Build and run
  3. In the SearchUI tab tap the "Charging Station" category
  • Result before this change: No results
  • Actual result / fixed result: EV Charging Station Results are shown
diff --git a/Sources/MapboxSearchUI/MapboxSearchController.swift b/Sources/MapboxSearchUI/MapboxSearchController.swift
index e133df99..39ec0b60 100644
--- a/Sources/MapboxSearchUI/MapboxSearchController.swift
+++ b/Sources/MapboxSearchUI/MapboxSearchController.swift
@@ -154,7 +154,8 @@ public class MapboxSearchController: UIViewController {
     public required init(accessToken: String, configuration: Configuration = Configuration()) {
         self.categorySearchEngine = CategorySearchEngine(
             accessToken: accessToken,
-            locationProvider: configuration.locationProvider
+            locationProvider: configuration.locationProvider,
+            supportSBS: true
         )
         self.searchEngine = SearchEngine(accessToken: accessToken, locationProvider: configuration.locationProvider)
         self.configuration = configuration
@@ -171,7 +172,7 @@ public class MapboxSearchController: UIViewController {
     /// - Parameters:
     ///   - configuration: configuration for search and categorySearch engines.
     public required init(configuration: Configuration = Configuration()) {
-        self.categorySearchEngine = CategorySearchEngine(locationProvider: configuration.locationProvider)
+        self.categorySearchEngine = CategorySearchEngine(locationProvider: configuration.locationProvider, supportSBS: true)
         self.searchEngine = SearchEngine(locationProvider: configuration.locationProvider)
         self.configuration = configuration
 

Checklist

  • Update CHANGELOG

@aokj4ck aokj4ck requested review from a team as code owners January 25, 2024 20:40
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM

@aokj4ck aokj4ck merged commit ca72601 into main Jan 26, 2024
4 checks passed
@aokj4ck aokj4ck deleted the fix-ev-charging-station-canonical-id branch January 26, 2024 17:56
aokj4ck added a commit that referenced this pull request Apr 5, 2024
- Correct EV Charging Station category SBS and search-box canonical ID
- Compare against category list from `search/searchbox/v1/list/category`
    - docs: https://docs.mapbox.com/api/search/search-box/#list-categories

1. Change the CategorySearchEngine initializer in MapboxSearchController to use SBS
2. Build and run
3. In the SearchUI tab tap the "Charging Station" category
- Result before this change: No results
- Actual result / fixed result: EV Charging Station Results are shown

- [x] Update `CHANGELOG`

Conflicts:
	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant