The Mapbox Search SDK is a developer toolkit to add location search on mobile devices. With the same speed and scale of the Mapbox Search API, the SDK is built specifically for on-demand and local search use cases, like ride-share, food delivery, and store finders apps. Whether your users are trying to find a place among the vast amount of data on a global map, or to find the exact location of a venue a few miles down the road, the Search SDK provides location search for countries all over the globe, in many different languages.
Previously, implementing search into your application required custom tuning with every API request to set a language, location biasing, and result types. There was no pre-built UI and no option for a user to see their search history, or save favorites.
The Mapbox Search SDK allows you to drop pre-tuned search into your application, removing the complexity of API configuration, while still giving you control to customize. It ships with an optional UI framework, or you can build a completely custom implementation with your own UI elements by using the core library. The Search SDK is pre-configured for autocomplete, local search biasing, and includes new features like category search, search history, and search favorites.
You can find more documentation at docs.mapbox.com:
You can install MapboxSearch and/or MapboxSearchUI packages with Swift Package Manager, Cocoapods, or Carthage. Swift Package Manage is our preferred distribution system.
Add the MapboxSearch dependency to your Package.swift or use the Xcode > Project settings > Package Dependencies tab.
dependencies: [
.package(url: "https://github.com/mapbox/mapbox-search-ios.git")
]
$HOME/.netrc
, e.g. /Users/victorprivalov/.netrc
)machine api.mapbox.com
login mapbox
password sk.ey_Your_Access_Token_With_Read_permission
To integrate latest pre-release version of MapboxSearch
into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'MapboxSearch', ">= 2.7.0-beta.1", "< 3.0"
To integrate latest pre-release version of MapboxSearchUI
into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'MapboxSearchUI', ">= 2.7.0-beta.1", "< 3.0"
Set up .netrc file for sdk registry access
$HOME/.netrc
, e.g. /Users/victorprivalov/.netrc
)machine api.mapbox.com
login mapbox
password sk.ey_Your_Access_Token_With_Read_permission
Follow the Carthage Quick Start and specificy the MapboxSearch dependency in your Cartfile
:
github "Mapbox/mapbox-search-ios" ~> 2.7.0-beta.1
We welcome feedback and code contributions!
If you found a bug or want to request a feature open a github issue. Please use the appropriate issue template.
The SDK requires Carthage which you can install using Homebrew.
brew -v
. If you don't have Homebrew, install before proceeding.brew update && brew bundle install
$HOME/.netrc
, e.g. /Users/victorprivalov/.netrc
)machine api.mapbox.com
login mapbox
password sk.ey_Your_Access_Token_With_Read_permission
./scripts/install_git_hooks
make dependencies
mapbox
or .mapbox
in your home directory with content of your access token. We also support .mapbox
file in the repository root folder. MapboxSearchDemoApplication will automatically handle this key and insert it in corresponding place.MapboxSearchDemoApplication
project and select "Info" tab for "MapboxSearchDemoApplication" target. Here you may set your accessToken for MBXAccessToken
key in "Custom iOS Target Properties" section.SearchEngine.init
and other initializers that accept an accessToken
parameter. Use this approach to deliver your key dynamically and implement a key rotation schedule.Examples of behavior that contributes to creating a positive environment include:
We recommend reading this blog post from Github on writing great PRs..
We use SemVer for versioning. For the versions available, see the tags on repository.