Last month I started working on BikeSpot again. The main goal for the next release is better location search. The app didn’t have very good search.
It was limited to locations in San Francisco only. While I currently only have bike rack data in San Francisco, I want search to be available in other cities as well. Bike parking data can be crowd sourced, so the app should not prevent any users from searching in other locations.
There was no auto complete. Everyone expects and is used to auto complete when searching. Not having it is just a bad user experience.
So I decided to use Google Maps and take advantage of its location search and place auto complete.
- response to user gestures
#####Switching from MKMapView to GMSMapView Custom my location button Implement GMSMapViewDelegate Camera position zoom Google Places API for iOS is packaged with the Google Maps SDK for iOS. Adding custom marker
#####Using Google Places API for autocomplete
Two ways for autocomplete:
- Autocomplete UI control - and there are different methods within this one
Get place predictions programmatically
After playing with different methods, I settled on adding a search bar to the navigation bar because it was the least intrusive to my existing UI
#####Google Places API iOS limitation cannot search using search string must tap on a place in the autocomplete list to search
#####Attribution If you use the Google Maps SDK for iOS in your application, you must include the attribution text as part of a legal notices section in your application. Including legal notices as an independent menu item, or as part of an “About” menu item, is recommended.
You can get the attribution text by making a call to [GMSServices openSourceLicenseInfo].